void GameMenuScene::setupButtons(LinearLayout* rightLayout) { // A label that shows the nickname of the current player. Press it to change player playerStatus = new PlayerStatus(this); playerStatus->setPaddings(0.2); rightLayout->addItem(playerStatus, 1.0 / 6.0); connect(playerStatus, SIGNAL(pressed()), this, SLOT(playerControlPressed())); PlayerManager* playerManager = BotNeumannApp::getInstance()->getPlayerManager(); connect(playerManager, SIGNAL(playerChanged(Player*)), this, SLOT(playerChanged(Player*))); // Create the buttons for each game mode and configuration const QString buttonBackground("gm_button_background"); trainingButton = new SvgButton(buttonBackground, this, tr("Training")); missionsButton = new SvgButton(buttonBackground, this, tr("Missions")); collaborationButton = new SvgButton(buttonBackground, this, tr("Collaboration")); createButton = new SvgButton(buttonBackground, this, tr("Create")); // Add the menu buttons to the layout rightLayout->addItem( trainingButton, 1.0 / 6.0 ); rightLayout->addItem( missionsButton, 1.0 / 6.0 ); rightLayout->addItem( collaborationButton, 1.0 / 6.0 ); rightLayout->addItem( createButton, 1.0 / 6.0 ); // React to each button change connect(trainingButton, SIGNAL(pressed()), this, SLOT(trainingButtonPressed())); connect(missionsButton, SIGNAL(pressed()), this, SLOT(missionsButtonPressed())); connect(collaborationButton, SIGNAL(pressed()), this, SLOT(collaborationButtonPressed())); connect(createButton, SIGNAL(pressed()), this, SLOT(createButtonPressed())); // Disable if there is not an active player playerChanged( BotNeumannApp::getInstance()->getCurrentPlayer() ); // Create the info, rewards and config buttons setupConfigButtons(rightLayout); }
NewStyleWidget::NewStyleWidget(QWidget *parent) : QWidget(parent) { widget.setupUi(this); QButtonGroup *bg = new QButtonGroup(this); bg->addButton(widget.paragraph); bg->addButton(widget.character); connect(widget.create, SIGNAL(pressed()), this, SLOT(createButtonPressed())); }
int importCSVForm::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDialog::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: initialize((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< DBBrowserDB*(*)>(_a[2]))); break; case 1: createButtonPressed(); break; case 2: preview(); break; case 3: fieldSeparatorChanged(); break; case 4: textQuoteChanged(); break; case 5: extractFieldNamesChanged((*reinterpret_cast< bool(*)>(_a[1]))); break; case 6: languageChange(); break; default: ; } _id -= 7; } return _id; }