int fullScreenWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QGraphicsView::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: pauseSlot(); break; case 1: resumeSlot(); break; case 2: stopSlot(); break; default: ; } _id -= 3; } return _id; }
void KUI_project::setupActions() { KAction *action = new KAction(this); action->setIcon(KIcon("edit-delete")); action->setText(i18n("&Aim")); collection->addAction("aim", action); connect(action, SIGNAL(triggered(bool)), this, SLOT(aimSlot())); action = new KAction(this); action->setIcon(KIcon("media-record")); action->setText(i18n("&Record")); connect(action, SIGNAL(triggered(bool)), this, SLOT(recordSlot())); collection->addAction("record", action); action = new KAction(this); action->setIcon(KIcon("media-playback-start")); action->setText(i18n("&Play")); connect(action, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this , SLOT(playSlot())); collection->addAction("play",action); action = new KAction(this); action->setIcon(KIcon("media-playback-pause")); action->setText(i18n("&Pause")); connect(action, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this , SLOT(pauseSlot())); collection->addAction("pause",action); action = new KAction(this); action->setIcon(KIcon("media-playback-stop")); action->setText(i18n("&Stop")); connect(action, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this , SLOT(stopSlot())); collection->addAction("stop",action); action = new KAction(this); action->setIcon(KIcon("media-playback-start")); action->setText(i18n("&Play")); connect(action, SIGNAL(triggered(Qt::MouseButtons,Qt::KeyboardModifiers)), this , SLOT(playAfterPauseSlot())); collection->addAction("playAfterPause",action); action = new KAction(this); action->setIcon(KIcon("list-add")); action->setText(i18n("&Add")); connect(action, SIGNAL(triggered(bool)), this, SLOT(addSlot())); collection->addAction("add", action); action = new KAction(this); action->setIcon(KIcon("list-remove")); action->setText(i18n("&Remove")); connect(action, SIGNAL(triggered(bool)), this, SLOT(removeSlot())); collection->addAction("remove", action); }
//Create the actions of main window void MainWindow::createActions() { //Game menu KStandardGameAction::gameNew( this, SLOT(gameNewSlot() ), actionCollection() ); KStandardGameAction::highscores( this, SLOT( showHighscoresSlot() ), actionCollection() ); closeGameAction = KStandardGameAction::end( this, SLOT( playerClosedGameSlot() ), actionCollection() ); closeGameAction->setEnabled( false ); pauseAction = KStandardGameAction::pause( this, SLOT( pauseSlot() ), actionCollection() ); pauseAction->setEnabled( false ); KStandardGameAction::quit( this, SLOT( close() ), actionCollection() ); //Move menu moveLeftAction = new KAction( this ); moveLeftAction->setText( i18n( "Move Left" ) ); moveLeftAction->setShortcut( Qt::Key_Left ); moveLeftAction->setIcon( KIcon( ":/pics/move_left.png" ) ); moveLeftAction->setEnabled( false ); actionCollection()->addAction( "move_left", moveLeftAction ); moveRightAction = new KAction( this ); moveRightAction->setText( i18n( "Move Right" ) ); moveRightAction->setShortcut( Qt::Key_Right ); moveRightAction->setIcon( KIcon( ":/pics/move_right.png" ) ); moveRightAction->setEnabled( false ); actionCollection()->addAction( "move_right", moveRightAction ); moveDownAction = new KAction( this ); moveDownAction->setText( i18n( "Move Down" ) ); moveDownAction->setShortcut( Qt::Key_Down ); moveDownAction->setIcon( KIcon( ":/pics/move_down.png" ) ); moveDownAction->setEnabled( false ); actionCollection()->addAction( "move_down", moveDownAction ); fastMoveDownAction = new KAction( this ); fastMoveDownAction->setText( i18n( "Fast Move Down" ) ); fastMoveDownAction->setShortcut( Qt::Key_Space ); fastMoveDownAction->setIcon( KIcon( ":/pics/fast_move_down.png" ) ); fastMoveDownAction->setEnabled( false ); actionCollection()->addAction( "fast_move_down", fastMoveDownAction ); rotateLeftAction = new KAction( this ); rotateLeftAction->setText( i18n( "Rotate Left" ) ); rotateLeftAction->setShortcut( Qt::Key_X ); rotateLeftAction->setIcon( KIcon( ":/pics/rotate_left.png" ) ); rotateLeftAction->setEnabled( false ); actionCollection()->addAction( "rotate_left", rotateLeftAction ); rotateRightAction = new KAction( this ); rotateRightAction->setText( i18n( "Rotate Right" ) ); rotateRightAction->setShortcut( Qt::Key_Up ); rotateRightAction->setIcon( KIcon( ":/pics/rotate_right.png" ) ); rotateRightAction->setEnabled( false ); actionCollection()->addAction( "rotate_right", rotateRightAction ); connect( moveLeftAction, SIGNAL( triggered() ), centralTable, SLOT( moveLeftSlot() ) ); connect( moveRightAction, SIGNAL( triggered() ), centralTable, SLOT( moveRightSlot() ) ); connect( moveDownAction, SIGNAL( triggered() ), centralTable, SLOT( moveDownSlot() ) ); connect( fastMoveDownAction, SIGNAL( triggered() ), centralTable, SLOT( fastMoveDownSlot() ) ); connect( rotateLeftAction, SIGNAL( triggered() ), centralTable, SLOT( rotateLeftSlot() ) ); connect( rotateRightAction, SIGNAL( triggered() ), centralTable, SLOT( rotateRightSlot() ) ); }