// creates a view for this controller void MWidgetControllerPrivate::createView() { Q_Q(MWidgetController); // check that we don't have a view yet Q_ASSERT(!view); if (!constructingView) { constructingView = true; view = MTheme::view(q); constructingView = false; } if (view) { configureView(view); q->updateGeometry(); } }
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), m_view(0) { m_hostInfoManager = new HostInfoManager; m_monitor = new Monitor(m_hostInfoManager, this); m_viewMode = new QActionGroup(this); QMenu* fileMenu = menuBar()->addMenu(tr("&File")); QAction* quitAction = fileMenu->addAction(tr("&Quit")); quitAction->setShortcut(QKeySequence::Quit); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); QMenu* viewMenu = menuBar()->addMenu(tr("&View")); QMenu* modeMenu = viewMenu->addMenu(tr("&Mode")); m_listView = modeMenu->addAction(tr("&List View")); m_listView->setCheckable(true); m_viewMode->addAction(m_listView); connect(m_listView, SIGNAL(triggered()), this, SLOT(setupListView())); m_starView = modeMenu->addAction(tr("&Star View")); m_starView->setCheckable(true); m_viewMode->addAction(m_starView); connect(m_starView, SIGNAL(triggered()), this, SLOT(setupStarView())); m_detailedView = modeMenu->addAction(tr("&Detailed Host View")); m_detailedView->setCheckable(true); m_viewMode->addAction(m_detailedView); connect(m_detailedView, SIGNAL(triggered()), this, SLOT(setupDetailedHostView())); QAction* actionStart = viewMenu->addAction(tr("&Start")); connect(actionStart, SIGNAL(triggered()), this, SLOT(startView())); QAction* actionStop = viewMenu->addAction(tr("Stop")); connect(actionStop, SIGNAL(triggered()), this, SLOT(stopView())); viewMenu->addSeparator(); QAction* actionCheckNodes = viewMenu->addAction(tr("Check Nodes")); connect(actionCheckNodes, SIGNAL(triggered()), this, SLOT(checkNodes())); viewMenu->addSeparator(); m_configView = viewMenu->addAction(tr("Configure View...")); connect(m_configView, SIGNAL(triggered()), this, SLOT( configureView())); m_systrayAction = viewMenu->addAction(tr("System Tray")); m_systrayAction->setCheckable(true); QMenu* helpMenu = menuBar()->addMenu(tr("&Help")); helpMenu->addAction(tr("About..."), this, SLOT(showAboutDialog())); readSettings(); // Avoid useless creation and connection if the system does not have a systray if (QSystemTrayIcon::isSystemTrayAvailable()) { m_systemTrayIcon = new QSystemTrayIcon(this); m_systemTrayIcon->setIcon(QIcon(":bigIcon.png")); m_systemTrayMenu = new QMenu(this); m_systemTrayMenu->addAction(quitAction); m_systemTrayIcon->setContextMenu(m_systemTrayMenu); connect(m_systemTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(systemTrayIconActivated(QSystemTrayIcon::ActivationReason))); connect(m_systrayAction, SIGNAL(triggered(bool)), m_systemTrayIcon, SLOT(setVisible(bool))); // Only show the systray if enabled if (m_systrayAction->isChecked()) m_systemTrayIcon->show(); } else { m_systrayAction->setEnabled(false); } setWindowIcon(QIcon(":bigIcon.png")); m_monitor->checkScheduler(); }
void Sbrowse::setQuery(QString queryStr) { model.setQuery(queryStr); configureView(); }
void Sbrowse::commonConstructor() { setModel(&model); configureView(); }
/** * Method is used to initialize engine core. */ void Core::initializeCore() { createWindow(); configureView(); }
QQuickView *view() { return configureView(new QQuickView); }