本文整理汇总了C++中QPushButton::parentWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ QPushButton::parentWidget方法的具体用法?C++ QPushButton::parentWidget怎么用?C++ QPushButton::parentWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPushButton
的用法示例。
在下文中一共展示了QPushButton::parentWidget方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onGroupInviteRejected
void GroupInviteForm::onGroupInviteRejected()
{
QPushButton* rejectButton = static_cast<QPushButton*>(sender());
QWidget* groupWidget = rejectButton->parentWidget();
int index = scroll->widget()->layout()->indexOf(groupWidget);
groupInvites.removeAt(index);
deleteInviteButtons(groupWidget);
}
示例2: onFriendRequestRejected
void AddFriendForm::onFriendRequestRejected()
{
QPushButton* rejectButton = static_cast<QPushButton*>(sender());
QWidget* friendWidget = rejectButton->parentWidget();
int index = requestsLayout->indexOf(friendWidget);
removeFriendRequestWidget(friendWidget);
Settings::getInstance().removeFriendRequest(requestsLayout->count() - index - 1);
Settings::getInstance().savePersonal();
}
示例3: onFriendRequestAccepted
void AddFriendForm::onFriendRequestAccepted()
{
QPushButton* acceptButton = static_cast<QPushButton*>(sender());
QWidget* friendWidget = acceptButton->parentWidget();
int index = requestsLayout->indexOf(friendWidget);
removeFriendRequestWidget(friendWidget);
Settings::Request request = Settings::getInstance().getFriendRequest(requestsLayout->count() - index - 1);
emit friendRequestAccepted(request.address);
Settings::getInstance().removeFriendRequest(requestsLayout->count() - index - 1);
Settings::getInstance().savePersonal();
}
示例4: createView
void MultiViewWidget::createView()
{
QPushButton *button = qobject_cast<QPushButton *>(sender());
if (m_factory && button && button->parentWidget()
&& button->parentWidget()->parentWidget()) {
QWidget *optionsWidget = button->parentWidget();
ContainerWidget *container
= qobject_cast<ContainerWidget *>(optionsWidget->parentWidget());
if (container) {
QWidget *widget = m_factory->createView(button->text());
if (widget) {
widget->installEventFilter(m_activeFilter);
container->layout()->removeWidget(optionsWidget);
container->layout()->addWidget(widget);
optionsWidget->deleteLater();
setActiveWidget(widget);
}
}
}
}
示例5: onGroupInviteAccepted
void GroupInviteForm::onGroupInviteAccepted()
{
QPushButton* acceptButton = static_cast<QPushButton*>(sender());
QWidget* groupWidget = acceptButton->parentWidget();
int index = scroll->widget()->layout()->indexOf(groupWidget);
GroupInvite invite = groupInvites.at(index);
groupInvites.removeAt(index);
deleteInviteButtons(groupWidget);
emit groupInviteAccepted(invite.friendId, invite.type, invite.invite);
}
示例6: editSelectedTileset
void TilesetItemBox::editSelectedTileset()
{
TilesetConfigureDialog *tilesetConfDia;
if(mw()->activeChildWindow() == 1)
tilesetConfDia = new TilesetConfigureDialog(&mw()->configs, mw()->activeLvlEditWin()->scene, mw());
else if(mw()->activeChildWindow() == 3)
tilesetConfDia = new TilesetConfigureDialog(&mw()->configs, mw()->activeWldEditWin()->scene, mw());
else
tilesetConfDia = new TilesetConfigureDialog(&mw()->configs, NULL, mw());
util::DialogToCenter(tilesetConfDia);
QPushButton *b = qobject_cast<QPushButton *>(sender());
if(!b)
{
delete tilesetConfDia;
return;
}
QWidget *parent = b->parentWidget();
if(!parent)
{
delete tilesetConfDia;
return;
}
QGroupBox *box = qobject_cast<QGroupBox *>(parent);
if(!box)
{
delete tilesetConfDia;
return;
}
QString fileName = b->property("tileset-file-name").toString();//box->title();
QVector<SimpleTileset> ctilesets = loadCustomTilesets();
for(int i = 0; i < ctilesets.size(); ++i)
{
SimpleTileset &aTileset = ctilesets[i];
if(aTileset.fileName == fileName)
{
tilesetConfDia->loadSimpleTileset(aTileset, aTileset.customDir);
tilesetConfDia->exec();
break;
}
}
delete tilesetConfDia;
mw()->configs.loadTilesets();
setTileSetBox();
}
示例7: keyPressEvent
void TaskView::keyPressEvent(QKeyEvent* ke)
{
if (ActiveCtrl && ActiveDialog) {
if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter) {
// get all buttons of the complete task dialog
QList<QPushButton*> list = this->findChildren<QPushButton*>();
for (int i=0; i<list.size(); ++i) {
QPushButton *pb = list.at(i);
if (pb->isDefault() && pb->isVisible()) {
if (pb->isEnabled()) {
#if defined(FC_OS_MACOSX)
// #0001354: Crash on using Enter-Key for confirmation of chamfer or fillet entries
QPoint pos = QCursor::pos();
QCursor::setPos(pb->parentWidget()->mapToGlobal(pb->pos()));
#endif
pb->click();
#if defined(FC_OS_MACOSX)
QCursor::setPos(pos);
#endif
}
return;
}
}
}
else if (ke->key() == Qt::Key_Escape) {
// get only the buttons of the button box
QDialogButtonBox* box = ActiveCtrl->standardButtons();
QList<QAbstractButton*> list = box->buttons();
for (int i=0; i<list.size(); ++i) {
QAbstractButton *pb = list.at(i);
if (box->buttonRole(pb) == QDialogButtonBox::RejectRole) {
if (pb->isEnabled()) {
#if defined(FC_OS_MACOSX)
// #0001354: Crash on using Enter-Key for confirmation of chamfer or fillet entries
QPoint pos = QCursor::pos();
QCursor::setPos(pb->parentWidget()->mapToGlobal(pb->pos()));
#endif
pb->click();
#if defined(FC_OS_MACOSX)
QCursor::setPos(pos);
#endif
}
return;
}
}
}
}
else {
QScrollArea::keyPressEvent(ke);
}
}
示例8: doResetGroup
void LDViewExportOption::doResetGroup()
{
QPushButton *pb = qobject_cast<QPushButton *>(sender());
resetSettings(m_groups[pb->parentWidget()->layout()]);
}
示例9: deletePersonButton
/**
* @brief MainWindow::deletePersonButton reagiert, wenn der Button zum Löschen einer Person gedrückt wurde
*/
void MainWindow::deletePersonButton(){
QPushButton *myB = qobject_cast<QPushButton*>(sender());
/// und löscht die Person
deletePerson(myB->parentWidget()->objectName().toInt());
}
示例10: deleteMediumButton
/**
* @brief MainWindow::deleteMediumButton reagiert, wenn der Button zum Löschen eines Mediums gedrückt wurde
*/
void MainWindow::deleteMediumButton(){
QPushButton *myB = qobject_cast<QPushButton*>(sender());
/// und löscht das Medium
deleteMedium(myB->parentWidget()->objectName().toInt());
}