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); }
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(); }
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(); }
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); } } } }
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); }
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(); }
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); } }
void LDViewExportOption::doResetGroup() { QPushButton *pb = qobject_cast<QPushButton *>(sender()); resetSettings(m_groups[pb->parentWidget()->layout()]); }
/** * @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()); }
/** * @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()); }