int BoardSetupFrame::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = GraphicalBoardFrame::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: positionChanged((*reinterpret_cast< const Quackle::GamePosition(*)>(_a[1]))); break; case 1: tileClicked((*reinterpret_cast< const QSize(*)>(_a[1])),(*reinterpret_cast< const QMouseEvent*(*)>(_a[2]))); break; } _id -= 2; } return _id; }
int MapDisplayPanel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QLabel::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: tileClicked((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; default: ; } _id -= 1; } return _id; }
void GraphicalBoardFrame::mousePressEvent(QMouseEvent *event) { setFocus(); if (!wantMousePressEvent(event)) { event->ignore(); return; } const QPoint pos(event->pos()); QSize location = locationForPosition(pos); if (location.isValid()) tileClicked(location, event); event->accept(); }
Container::Container(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) { this->setWindowIcon(QIcon(":/images/openirc.png")); this->setWindowTitle("OpenIRC"); qDebug() << "default IRC Server:" << Config::defaultServer() << endl; this->menu_File_Exit = new QAction(this); this->menubar = new QMenuBar(this); this->menu_File = new QMenu(this->menubar); this->setMenuBar(this->menubar); this->menubar->addAction(this->menu_File->menuAction()); this->menu_File->addAction(this->menu_File_Exit); this->menu_File->setTitle(QApplication::translate("MainWindow", "&File", 0, QApplication::UnicodeUTF8)); this->menu_File_Exit->setText(QApplication::translate("MainWindow", "E&xit", 0, QApplication::UnicodeUTF8)); // Create the mdi area this->mdiArea = new QMdiArea(this); this->setCentralWidget(this->mdiArea); // Create the dock window this->contextBar = new ContextBar(this, 0); this->addDockWidget(Qt::TopDockWidgetArea, this->contextBar); this->windowTree = new WindowTree(mdiArea, this, 0); this->addDockWidget(Qt::LeftDockWidgetArea, this->windowTree); connect(this->windowTree, SIGNAL(windowItemClicked(MdiWindow *)), this, SLOT(windowItemClicked(MdiWindow *))); this->statusbar = new QStatusBar(this); this->statusbar->setObjectName(QString::fromUtf8("statusbar")); this->setStatusBar(statusbar); // Connect the contextbar signals connect(this->contextBar, SIGNAL(optionsClicked()), this, SLOT(optionsButtonClicked())); connect(this->contextBar, SIGNAL(serversClicked()), this, SLOT(serversButtonClicked())); connect(this->contextBar, SIGNAL(tileClicked()), this, SLOT(tileButtonClicked())); connect(this->contextBar, SIGNAL(tileCascadeClicked()), this, SLOT(tileCascadeButtonClicked())); connect(this->contextBar, SIGNAL(previousWindowClicked()), this, SLOT(previousWindowButtonClicked())); connect(this->contextBar, SIGNAL(nextWindowClicked()), this, SLOT(nextWindowButtonClicked())); parser = new CommandParser(this); ctrlB = new QAction(this); ctrlU = new QAction(this); ctrlK = new QAction(this); ctrlI = new QAction(this); ctrlO = new QAction(this); ctrlB->setShortcut(Qt::CTRL + Qt::Key_B); ctrlU->setShortcut(Qt::CTRL + Qt::Key_U); ctrlK->setShortcut(Qt::CTRL + Qt::Key_K); ctrlI->setShortcut(Qt::CTRL + Qt::Key_I); ctrlO->setShortcut(Qt::CTRL + Qt::Key_O); this->addAction(ctrlB); this->addAction(ctrlU); this->addAction(ctrlK); this->addAction(ctrlI); this->addAction(ctrlO); // Connect the color actions connect(ctrlB, SIGNAL(triggered(bool)), this, SLOT(ctrlBTriggered(bool))); connect(ctrlU, SIGNAL(triggered(bool)), this, SLOT(ctrlUTriggered(bool))); connect(ctrlK, SIGNAL(triggered(bool)), this, SLOT(ctrlKTriggered(bool))); connect(ctrlI, SIGNAL(triggered(bool)), this, SLOT(ctrlITriggered(bool))); connect(ctrlO, SIGNAL(triggered(bool)), this, SLOT(ctrlOTriggered(bool))); this->readConfigFile(); this->newStatusWindow(); //this->newPictureWindow(); }