bool TestingWidgetFacade::connectToTestingWidget(QObject* testingwidget) { if(!QObject::connect(testingwidget, SIGNAL(menuJumpRequest()), this, SLOT(switchToStartWidget()), Qt::AutoConnection)) { return 0; } if(!QObject::connect(testingwidget, SIGNAL(startTestRequest()), this, SLOT(startTest()), Qt::AutoConnection)) { return 0; } if(!QObject::connect(testingwidget, SIGNAL(finishTestRequest()), this, SLOT(finishTest()), Qt::AutoConnection)) { return 0; } if(!QObject::connect(testingwidget, SIGNAL(jumpToTaskRequest(QString)), this, SLOT(displayTaskById(QString)), Qt::AutoConnection)) { return 0; } if(!QObject::connect(testingwidget, SIGNAL(jumpToTaskHelp(QString)), this, SLOT(displayHelpById(QString)), Qt::AutoConnection)) { return 0; } if(!QObject::connect(testingwidget, SIGNAL(setTestRequest(ExamsTest)), this, SLOT(setTest(ExamsTest)), Qt::AutoConnection)) { return 0; } if(!QObject::connect(testingwidget, SIGNAL(answers(QList< QPair<QString, QString> >)), this, SLOT(calculateResults(QList<QPair<QString,QString> >)), Qt::AutoConnection)) { return 0; } if(!QObject::connect(testingwidget, SIGNAL(loadTestRequest(QString)), this, SLOT(loadTest(QString)), Qt::AutoConnection)) { return 0; } if(!QObject::connect(this, SIGNAL(timeLabelUpdate(QString)), testingwidget, SLOT(setTimeLabel(QString)), Qt::AutoConnection)) { return 0; } if(!QObject::connect(this, SIGNAL(setTaskCount(int, int, int)), testingwidget, SLOT(setTaskCount(int, int, int)), Qt::AutoConnection)) { return 0; } return 1; }
void MainWindow::makeConnections() { QPushButton *donateBtn = ui->centralWidget->findChild<QPushButton*>("donatePushButton"); if(donateBtn) connect(donateBtn, SIGNAL(clicked()), this, SLOT(openPaypalPage())); connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); connect(preferences, SIGNAL(projectChanged(Project*)), this, SLOT(switchProject(Project*))); connect(getTrackBtn(), SIGNAL(clicked()), this, SLOT(toggleTracking())); connect(trackingClock, SIGNAL(ticked()), this, SLOT(setTimeLabel())); QListView * projectLst = ui->centralWidget->findChild<QListView*>("projectLst"); connect(projectLst, SIGNAL(activated(QModelIndex)), this, SLOT(setSelectedProject(QModelIndex))); connect(projectLst, SIGNAL(clicked(QModelIndex)), this, SLOT(setSelectedProject(QModelIndex))); QPushButton * btn = ui->centralWidget->findChild<QPushButton*>("newProjectBtn"); connect(btn, SIGNAL(clicked()), this, SLOT(showProjectDialog())); connect(newProjectDialog, SIGNAL(accepted()), this, SLOT(addNewProject())); }
void GameMain::createLabel() { auto timeSubLabel=Label::createWithSystemFont("TIME","Marker Felt",36); timeSubLabel->setAnchorPoint(Vec2::ANCHOR_BOTTOM_RIGHT); timeSubLabel->setPosition(Vec2(200,1200)); this->addChild(timeSubLabel); auto time=Label::createWithSystemFont("0","Marker Felt",36); time->setAnchorPoint(Vec2::ANCHOR_BOTTOM_RIGHT); time->setPosition(Vec2(200,1140)); setTimeLabel(time); this->addChild(time); auto scoreSub=Label::createWithSystemFont("SCORE","Marker Felt",36); scoreSub->setAnchorPoint(Vec2::ANCHOR_BOTTOM_RIGHT); scoreSub->setPosition(Vec2(510,1200)); this->addChild(scoreSub); auto score=Label::createWithSystemFont("0","Marker Felt",36); score->setAnchorPoint(Vec2::ANCHOR_BOTTOM_RIGHT); score->setPosition(Vec2(510,1140)); setScoreLabel(score); this->addChild(score); }