PidMain::PidMain(QWidget *parent) : QMainWindow(parent) { setupUi(this); // Connect signals // File connect(menuOpenImage, SIGNAL( triggered() ), this, SLOT( openImage() )); connect(menuSaveCurrent, SIGNAL( triggered() ), this, SLOT( saveCurrentAs() )); // Image connect(menuGenerateGrayScale, SIGNAL( triggered() ), this, SLOT( generateGrayScale() )); connect(menuGenerateHistogram, SIGNAL( triggered() ), this, SLOT( generateHistogram() )); // Help connect(menuOpenAbout, SIGNAL( triggered() ), this, SLOT( openAboutDialog() )); connect(menuOpenHelp, SIGNAL( triggered() ), this, SLOT( openHelpDialog() )); // Filters connect(menuFiltersAltaIdeal, SIGNAL( triggered() ), this, SLOT( openPassaAltaIdeal() )); connect(menuFiltersBaixaIdeal, SIGNAL( triggered() ), this, SLOT( openPassaBaixaIdeal() )); connect(menuFiltersIdeal, SIGNAL( triggered() ), this, SLOT( openIdeal() )); connect(menuButterworthBaixa, SIGNAL( triggered() ), this, SLOT( openButterworthBaixa() )); connect(menuButterworthAlta, SIGNAL( triggered() ), this, SLOT( openButterworthAlta() )); // initializing some widgets mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { QCoreApplication::setOrganizationName("polyvision UG"); QCoreApplication::setOrganizationDomain("polyvision.org"); QCoreApplication::setApplicationName("RaceLapTimer"); ui->setupUi(this); setWindowTitle(QString("OpenRaceLapTimer by airbirds.de - v%1").arg(RLT_VERSION)); setWindowIcon(QIcon("app_icon.png")); QVBoxLayout *pLayout = new QVBoxLayout(ui->centralWidget); m_pTabWidget = new QTabWidget(); pLayout->addWidget(m_pTabWidget); this->m_pRLTDatabase = RLTDatabase::instance(); m_pConfigurationWidget = new ConfigurationWidget(); m_pConfigurationWidget->setMainWindow(this); this->m_pTabWidget->addTab(m_pConfigurationWidget,"Configuration"); m_pPilotsWidget = new PilotsWidget(); this->m_pTabWidget->addTab(m_pPilotsWidget,"Pilots"); m_pRaceTableWidget = new RaceTableWidget(); this->m_pTabWidget->addTab(m_pRaceTableWidget,"Races"); m_pCurrentRaceWidget = new CurrentRaceWidget(); this->m_pTabWidget->addTab(m_pCurrentRaceWidget,"Current Race"); this->m_pLabelCOMPortStatus = new QLabel(this); this->m_pLabelCOMPortStatus->setText("not connected to COM port"); this->ui->statusBar->addWidget(m_pLabelCOMPortStatus); this->m_pLabelLastIncommingSignal = new QLabel(this); this->m_pLabelLastIncommingSignal->setText("XXX-XXX-XXX"); this->ui->statusBar->addWidget(m_pLabelLastIncommingSignal); connect(CurrentRace::instance(),SIGNAL(pilotDataChanged()),this,SLOT(onCurrentRacePilotDataChanged())); connect(CurrentRace::instance(),SIGNAL(fastedLapChanged()),this,SLOT(onCurrentRaceFastestLapDataChanged())); connect(CurrentRace::instance(),SIGNAL(raceFinished()),this,SLOT(onCurentRaceFinished())); connect(m_pRaceTableWidget,SIGNAL(signalStartRace()),this,SLOT(onStartRaceClicked())); connect(m_pCurrentRaceWidget,SIGNAL(signalStopRace()),this,SLOT(onStopRaceClicked())); connect(m_pCurrentRaceWidget,SIGNAL(signalSimulate(QString)),this,SLOT(onSimulateClicked(QString))); connect(this->ui->actionAbout, SIGNAL(triggered()), this, SLOT(openAboutDialog())); }
MainWindow::MainWindow(QWidget *parent, kitrokopter::API *api) : QMainWindow(parent), ui(new Ui::MainWindow), api(api), gamepad(new Gamepad(this)), quadcopterModel(new QuadcopterModel(this, api)), quadcopterDebugDialog(0), trackedFilter(new QuadcopterTrackedFilter(this)), untrackedFilter(new QuadcopterTrackedFilter(this)), calibrationDialog(0) { ui->setupUi(this); setWindowIcon(QIcon(":/icons/images/Logo64.png")); ui->mainToolBar->hide(); initGamepad(); trackedFilter->setSourceModel(quadcopterModel); untrackedFilter->setSourceModel(quadcopterModel); trackedFilter->filterTracked(); untrackedFilter->filterUntracked(); ui->trackedList->setModel(trackedFilter); ui->untrackedList->setModel(untrackedFilter); irrlichtWidget = new QIrrlichtWidget(ui->superWidget); irrlichtWidget->setMinimumSize(QSize(640, 480)); QSizePolicy policy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); policy.setHorizontalStretch(255); irrlichtWidget->setSizePolicy(policy); ui->superWidget->layout()->addWidget(irrlichtWidget); gui3d = new Gui3D(irrlichtWidget, api); connect(ui->launchButton, SIGNAL(clicked()), this, SLOT(launch())); connect(ui->loadFormationButton, SIGNAL(clicked()), this, SLOT(loadFormation())); connect(ui->scanButton, SIGNAL(clicked()), this, SLOT(scanForQuadcopters())); connect(ui->actionShutdown_everything, SIGNAL(triggered()), this, SLOT(shutdownEverything())); connect(ui->actionQuadcopters, SIGNAL(triggered()), this, SLOT(openQuadcopterDebugDialog())); connect(ui->trackedList, SIGNAL(activated(QModelIndex)), this, SLOT(openQuadcopterDetailDialog(QModelIndex))); connect(ui->untrackedList, SIGNAL(activated(QModelIndex)), this, SLOT(openQuadcopterDetailDialog(QModelIndex))); connect(ui->calibrateCamerasButton, SIGNAL(clicked()), this, SLOT(openCalibrationDialog())); connect(ui->startSystemButton, SIGNAL(clicked()), this, SLOT(startSystem())); connect(ui->actionGamepad, SIGNAL(triggered()), this, SLOT(openGamepadDebugDialog())); connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(openAboutDialog())); }
// Open one of the window types McoStatus AllWins::openWindow(MS_WindowTypes type,int32 winNum,void *data,Document *doc) { McoStatus state; MS_WindowTypes t; switch (type) { case Gammut_Dialog1: case Gammut_Dialog_Src: case Gammut_Dialog_Dst: state = OpenGammutDialog(data,type,doc); break; case Startup_Dialog: state = openLogoWin(); break; case PrintWindow: state = openMainWindow(doc); break; case AboutWindow: state = openAboutDialog(); break; case StripDialog: state = openStripWindow(doc); break; case CalibDialog: state = openCalibWindow(doc); break; case SelAdjWindow: state = openTweakWin(doc); break; case OptionWindow: state = openOptionWin(doc); break; case CropWindow: state = openCropWin(doc); break; case TechkonWindow: state = openTechkonWindow(doc); break; case TcrWindow: state = openTcrWindow(doc); break; case GretagSLWindow: state = openGTSLWindow(doc); break; case GretagSCWindow: state = openSpChWindow(doc); break; case ProcessTherm: case ProcessThermClose: state = openProcessTherm(doc,type); break; case GammutSurfaceTherm1: state = openGammutSurface1(); break; case GammutSurfaceTherm_Src: case GammutSurfaceTherm_Dst: state = openGammutSurface2(doc,data,type); break; case GammutCompTherm: state = openGammutCompTherm(doc); break; case DisplayWindow: state = openDisplayWindow(doc,data,winNum); break; // polaroid window case TabbedDocWindow: state = openProfDocWin(doc); break; default: return MCO_UNSUPPORTED_OPERATION; } if (state != MCO_SUCCESS) return state; // Make the window the front window return MCO_SUCCESS; }