/** * @brief ctor for main window * * @param parent */ MainWindow::MainWindow(QWidget *parent): QMainWindow(parent) { m_pCentral = new QFrame; setCentralWidget(m_pCentral); m_mainLayout = new QHBoxLayout; m_mainLayout->setContentsMargins(1,1,1,1); m_mainLayout->setSpacing(1); centralWidget()->setLayout(m_mainLayout); m_mainLayout->addWidget(&m_accordion); m_accordion.setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); QAccordionItem *item = new QAccordionItem("Item1"); QTableWidget *table = new QTableWidget(); QTableWidgetItem *table_item = new QTableWidgetItem("Test talbe item"); table->setColumnCount(1); table->setRowCount(1); table->setItem(0,0,table_item); item->setWidget(table); m_accordion.addItem(item); QAccordionItem *item2 = new QAccordionItem("Item2"); QLineEdit *lineEdit = new QLineEdit(); lineEdit->setText("Testing Text"); item2->setWidget(lineEdit); m_accordion.addItem(item2); createInnerAccordion(); }
/** removes the underlying MdiSubWindow */ void FloatingWindow::removeMdiSubWindow() { MdiSubWindowParent_t *wrapper = dynamic_cast<MdiSubWindowParent_t *>(centralWidget()); if (wrapper) { wrapper->setWidget(nullptr); } }
void UIVMInformationDialog::prepareTabWidget() { /* Create tab-widget: */ m_pTabWidget = new QITabWidget; AssertPtrReturnVoid(m_pTabWidget); { /* Create tabs: */ /* Create Configuration details tab: */ UIGInformation *pInformationWidget = new UIGInformation(this); QList<UIVMItem*> items; items << new UIVMItem(gpMachine->uisession()->machine()); pInformationWidget->setItems(items); m_tabs.insert(0, pInformationWidget); m_pTabWidget->addTab(m_tabs.value(0), QString()); for (int iTabIndex = 1; iTabIndex < 2; ++iTabIndex) prepareTab(iTabIndex); /* Configure tab-widget: */ m_pTabWidget->setTabIcon(0, UIIconPool::iconSet(":/session_info_details_16px.png")); m_pTabWidget->setTabIcon(1, UIIconPool::iconSet(":/session_info_runtime_16px.png")); m_pTabWidget->setCurrentIndex(1); /* Add tab-widget into main-layout: */ centralWidget()->layout()->addWidget(m_pTabWidget); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); l = new Kek(); void (QSpinBox:: *signal)(int) = &QSpinBox::valueChanged; centralWidget()->layout()->addWidget(l); connect(ui->xSpinBox, signal, l, &Kek::xR); connect(ui->ySpinBox, signal, l, &Kek::yR); connect(ui->resetButton, &QPushButton::clicked, l, &Kek::reset); connect(ui->resetButton, &QPushButton::clicked, ui->xSpinBox, &QSpinBox::clear); connect(ui->resetButton, &QPushButton::clicked, ui->ySpinBox, &QSpinBox::clear); l->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); l->redraw(); }
MainWindow::MainWindow ( QWidget * parent ): QMainWindow(parent), m_ui(new Ui::MainWindow) { m_ui->setupUi(this); // Setup OpenGL context format QSurfaceFormat format; #ifdef __APPLE__ // Get OpenGL 3.2/4.1 core context format.setVersion(3, 2); format.setProfile(QSurfaceFormat::CoreProfile); #else // Get newest available compatibility context #endif format.setDepthBufferSize(16); // Create OpenGL context and window m_canvas.reset(new gloperate_qt::QtOpenGLWindowBase(format)); // Create widget container setCentralWidget(QWidget::createWindowContainer(m_canvas.get())); centralWidget()->setFocusPolicy(Qt::StrongFocus); }
void App::closeEvent(QCloseEvent* e) { /* Accept the close event by default */ e->accept(); QListIterator <QMdiSubWindow*> it( qobject_cast<QMdiArea*> (centralWidget())->subWindowList()); while (it.hasNext() == true) { QLCFixtureEditor* editor; QMdiSubWindow* sub; sub = it.next(); Q_ASSERT(sub != NULL); editor = static_cast<QLCFixtureEditor*> (sub->widget()); Q_ASSERT(editor != NULL); editor->show(); editor->setFocus(); if (editor->close() == false) { /* Ignore the close event if just one editor refuses */ e->ignore(); break; } } }
void UIMachineWindowSeamless::prepareMiniToolbar() { /* Get machine: */ CMachine m = machine(); /* Make sure mini-toolbar is necessary: */ bool fIsActive = m.GetExtraData(GUI_ShowMiniToolBar) != "no"; if (!fIsActive) return; /* Get the mini-toolbar alignment: */ bool fIsAtTop = m.GetExtraData(GUI_MiniToolBarAlignment) == "top"; /* Get the mini-toolbar auto-hide feature availability: */ bool fIsAutoHide = m.GetExtraData(GUI_MiniToolBarAutoHide) != "off"; m_pMiniToolBar = new VBoxMiniToolBar(centralWidget(), fIsAtTop ? VBoxMiniToolBar::AlignTop : VBoxMiniToolBar::AlignBottom, true, fIsAutoHide); m_pMiniToolBar->setSeamlessMode(true); m_pMiniToolBar->updateDisplay(true, true); QList<QMenu*> menus; QList<QAction*> actions = uisession()->newMenu()->actions(); for (int i=0; i < actions.size(); ++i) menus << actions.at(i)->menu(); *m_pMiniToolBar << menus; connect(m_pMiniToolBar, SIGNAL(minimizeAction()), this, SLOT(showMinimized())); connect(m_pMiniToolBar, SIGNAL(exitAction()), gActionPool->action(UIActionIndexRuntime_Toggle_Seamless), SLOT(trigger())); connect(m_pMiniToolBar, SIGNAL(closeAction()), gActionPool->action(UIActionIndexRuntime_Simple_Close), SLOT(trigger())); connect(m_pMiniToolBar, SIGNAL(geometryUpdated()), this, SLOT(sltUpdateMiniToolBarMask())); }
void WFrame::onCreate() { setWindowState(Qt::WindowMaximized); setWindowIcon(QIcon(":files/02.png")); setAcceptDrops(true); mapLoaded = false; wStart = new WStart(c,r); setCentralWidget(wStart); centralWidget()->show(); statusBar()->show(); statusProg = new QProgressBar(); statusProg->setMaximum(100); statusProg->setMinimum(0); statusProg->setValue(0); statusProg->setVisible(false); statusBar()->addWidget(statusProg); createActions(); createMenuBar(); }
MultipleWindowWidget::MultipleWindowWidget(const QString &name, QWidget *parent) : PositionMemoryWidget(name, parent) { mAddTabButton = new QPushButton("+"); mAddTabButton->setWhatsThis("Add a new tag to the dialog."); mRemoveTabButton = new QPushButton("-"); mRemoveTabButton->setWhatsThis("Removes a tab from the dialog."); mRemoveTabButton->setEnabled(false); mAddTabButton->setFixedWidth(30); mRemoveTabButton->setFixedWidth(30); mTabWidget = new QTabWidget(); QWidget *mainWidget = centralWidget(); QVBoxLayout *mainLayout = new QVBoxLayout(mainWidget); mainWidget->setLayout(mainLayout); QHBoxLayout *upperLayout = new QHBoxLayout(); upperLayout->setMargin(1); mainLayout->addLayout(upperLayout); mainLayout->setAlignment(upperLayout, Qt::AlignTop); upperLayout->addStretch(1000); upperLayout->addWidget(mAddTabButton); upperLayout->addWidget(mRemoveTabButton); mainLayout->addWidget(mTabWidget); connect(mAddTabButton, SIGNAL(clicked()), this, SLOT(addButtonPressed())); connect(mRemoveTabButton, SIGNAL(clicked()), this, SLOT(removeButtonPressed())); }
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) { QWidget* w(new QWidget(this)); setCentralWidget(w); QVBoxLayout* mainLayout(new QVBoxLayout(w)); mainLayout->setAlignment(Qt::AlignRight); sm::LineEdit* le(new sm::LineEdit(w)); le->show(); mainLayout->addWidget(le); sm::LineEdit* le1( new sm::LineEdit(sm::LineEdit::Ctrl::Exam, tr("Enter first name"), w)); le1->SetRegExpr(QString("[a-z]")); le1->show(); mainLayout->addWidget(le1); sm::LineEdit* le2( new sm::LineEdit(sm::LineEdit::Ctrl::Pwd, tr("Password"), w)); le2->show(); mainLayout->addWidget(le2); sm::LineEdit* le3( new sm::LineEdit(sm::LineEdit::Ctrl::ExamAndPwd, tr("Password"), w)); le3->SetRegExpr(QString("")); le3->show(); mainLayout->addWidget(le3); centralWidget()->setLayout(mainLayout); }
void MainWindow::on_actionOverlay_triggered() { QString filename = QFileDialog::getOpenFileName(); qDebug() << "load overlay: " << filename; GLWidget* glw = centralWidget()->findChild<GLWidget*>("widget"); if (filename != "") glw->data->surfset->loadOverlay(filename); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow{parent} , ui{new Ui::MainWindow} { ms_mainWindow = this; // Setup UI controls. ui->setupUi(this); m_movingPixmapOverlay = std::make_unique<Util::MovingPixmapOverlay>(centralWidget()); m_statusBarProgress = new StatusBarProgressWidget{this}; ui->statusBar->addPermanentWidget(m_statusBarProgress); setupMenu(); setupToolSelector(); setupHelpURLs(); // Setup window properties. setWindowIcon(Util::loadIcon(Q("mkvtoolnix-gui.png"), QList<int>{} << 32 << 48 << 64 << 128 << 256)); retranslateUi(); Util::restoreWidgetGeometry(this); jobTool()->loadAndStart(); #if defined(HAVE_CURL_EASY_H) silentlyCheckForUpdates(); #endif // HAVE_CURL_EASY_H }
void UIMachineWindowFullscreen::prepareMiniToolBar() { /* Get current machine: */ CMachine machine = session().GetConsole().GetMachine(); /* Check if mini tool-bar should present: */ bool fIsActive = machine.GetExtraData(VBoxDefs::GUI_ShowMiniToolBar) != "no"; if (fIsActive) { /* Get the mini tool-bar alignment: */ bool fIsAtTop = machine.GetExtraData(VBoxDefs::GUI_MiniToolBarAlignment) == "top"; /* Get the mini tool-bar auto-hide feature availability: */ bool fIsAutoHide = machine.GetExtraData(VBoxDefs::GUI_MiniToolBarAutoHide) != "off"; m_pMiniToolBar = new VBoxMiniToolBar(centralWidget(), fIsAtTop ? VBoxMiniToolBar::AlignTop : VBoxMiniToolBar::AlignBottom, true, fIsAutoHide); m_pMiniToolBar->updateDisplay(true, true); QList<QMenu*> menus; QList<QAction*> actions = uisession()->newMenu()->actions(); for (int i=0; i < actions.size(); ++i) menus << actions.at(i)->menu(); *m_pMiniToolBar << menus; connect(m_pMiniToolBar, SIGNAL(minimizeAction()), this, SLOT(showMinimized())); connect(m_pMiniToolBar, SIGNAL(exitAction()), gActionPool->action(UIActionIndexRuntime_Toggle_Fullscreen), SLOT(trigger())); connect(m_pMiniToolBar, SIGNAL(closeAction()), gActionPool->action(UIActionIndexRuntime_Simple_Close), SLOT(trigger())); } }
void UIMachineWindowSeamless::prepareVisualState() { /* Call to base-class: */ UIMachineWindow::prepareVisualState(); /* This might be required to correctly mask: */ centralWidget()->setAutoFillBackground(false); #ifdef Q_WS_WIN /* Get corresponding screen: */ int iScreen = qobject_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId); /* Prepare previous region: */ m_prevRegion = vboxGlobal().availableGeometry(iScreen); #endif /* Q_WS_WIN */ #ifdef Q_WS_MAC /* Please note: All the stuff below has to be done after the window has * switched to fullscreen. Qt changes the winId on the fullscreen * switch and make this stuff useless with the old winId. So please be * careful on rearrangement of the method calls. */ ::darwinSetShowsWindowTransparent(this, true); #endif /* Q_WS_MAC */ #ifndef Q_WS_MAC /* Prepare mini-toolbar: */ prepareMiniToolbar(); #endif /* !Q_WS_MAC */ }
LoadCoreWindow::LoadCoreWindow(QWidget *parent) : QMainWindow(parent) ,m_layout() ,m_table(new LoadCoreTableWidget()) ,m_statusLabel(new QLabel()) { QHBoxLayout *hbox = new QHBoxLayout(); QPushButton *customCoreButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOAD_CUSTOM_CORE)); connect(customCoreButton, SIGNAL(clicked()), this, SLOT(onLoadCustomCoreClicked())); connect(m_table, SIGNAL(enterPressed()), this, SLOT(onCoreEnterPressed())); connect(m_table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(onCellDoubleClicked(int,int))); setWindowTitle(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_LOAD_CORE)); setCentralWidget(new QWidget()); centralWidget()->setLayout(&m_layout); hbox->addWidget(customCoreButton); hbox->addItem(new QSpacerItem(width(), 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); m_layout.addWidget(m_table); m_layout.addLayout(hbox); statusBar()->addPermanentWidget(m_statusLabel); }
void MainWindow::createCentralWidget() { setCentralWidget(new QSplitter(this)); QSplitter* splitter = static_cast<QSplitter*>(centralWidget()); splitter->addWidget(new AccountTreeView); splitter->addWidget(createRightView()); }
void PluginArtistWindow::loadBaseUi() { setWindowTitle(tr("Artist")); setCentralWidget(new QWidget); m_view->setModel(m_model); m_view->setItemDelegate(new NavDelegate(m_view)); m_avatar->setFixedSize(100, 100); m_avatar->setFallbackSource(QUrl::fromLocalFile("/usr/share/icons/hicolor/96x96/hildon/general_default_avatar.png")); m_titleLabel->setWordWrap(true); QWidget *scrollWidget = new QWidget(m_scrollArea); QVBoxLayout *vbox = new QVBoxLayout(scrollWidget); vbox->addWidget(m_avatar, Qt::AlignLeft); vbox->addWidget(m_titleLabel, Qt::AlignLeft | Qt::AlignTop); vbox->addWidget(m_descriptionLabel, Qt::AlignTop); vbox->setStretch(2, 1); vbox->setContentsMargins(0, 0, 0, 0); m_scrollArea->setWidget(scrollWidget); m_scrollArea->setWidgetResizable(true); m_scrollArea->setFixedWidth(410); m_layout = new QHBoxLayout(centralWidget()); m_layout->addWidget(m_scrollArea); m_layout->addWidget(m_view); m_layout->setStretch(1, 1); m_layout->setContentsMargins(0, 0, 0, 0); menuBar()->addAction(m_nowPlayingAction); connect(m_view, SIGNAL(activated(QModelIndex)), this, SLOT(showWindow(QModelIndex))); connect(m_descriptionLabel, SIGNAL(anchorClicked(QUrl)), this, SLOT(showResource(QUrl))); }
void MainWindow::resizeToVideo(MediaWidget::ResizeFactor resizeFactor) { if (!isFullScreen() && !mediaWidget->sizeHint().isEmpty()) { if (isMaximized()) { setWindowState(windowState() & ~Qt::WindowMaximized); } QSize videoSize; switch (resizeFactor) { case MediaWidget::ResizeOff: break; case MediaWidget::OriginalSize: videoSize = mediaWidget->sizeHint(); break; case MediaWidget::DoubleSize: videoSize = (2 * mediaWidget->sizeHint()); break; } if (!videoSize.isEmpty()) { resize(size() - centralWidget()->size() + videoSize); } } }
void QApplicationWindow::refresh() { const ZLApplication::Toolbar::ItemVector &items = application().toolbar().items(); bool isVisibilityChanged = false; if (myToolbarMask.size() != items.size()) { isVisibilityChanged = true; myToolbarMask.clear(); myToolbarMask.assign(items.size(), false); } std::vector<bool>::iterator bt = myToolbarMask.begin(); for (ZLApplication::Toolbar::ItemVector::const_iterator it = items.begin(); it != items.end(); ++it) { if ((*it)->isButton()) { const ZLApplication::Toolbar::ButtonItem &button = (const ZLApplication::Toolbar::ButtonItem&)**it; if (application().isActionVisible(button.actionId()) != *bt) { *bt = !*bt; isVisibilityChanged = true; } ++bt; } } if (isVisibilityChanged) { bt = myToolbarMask.begin(); centralWidget()->hide(); menuBar()->clear(); for (ZLApplication::Toolbar::ItemVector::const_iterator it = items.begin(); it != items.end(); ++it) { if ((*it)->isButton()) { const ZLApplication::Toolbar::ButtonItem &button = (const ZLApplication::Toolbar::ButtonItem&)**it; if (*bt) { const QPixmap &pixmap = Resource::loadPixmap((ZLApplication::ApplicationName() + "/" + button.iconName()).c_str()); menuBar()->insertItem(pixmap, this, SLOT(emptySlot()), 0, button.actionId()); } ++bt; } } centralWidget()->show(); } for (ZLApplication::Toolbar::ItemVector::const_iterator it = items.begin(); it != items.end(); ++it) { if ((*it)->isButton()) { const ZLApplication::Toolbar::ButtonItem &button = (const ZLApplication::Toolbar::ButtonItem&)**it; int id = button.actionId(); if (menuBar()->findItem(id) != 0) { menuBar()->setItemEnabled(id, application().isActionEnabled(id)); } } } }
void MainWindow::on_actionSave_left_ROI_triggered() { QString filename = QFileDialog::getSaveFileName(this); if (filename!=""){ GLWidget* glw = centralWidget()->findChild<GLWidget*>("widget"); if (glw->data->surfset) glw->data->surfset->saveROI(filename); } }
void App::slotFileNew() { QLCFixtureEditor* editor; QMdiSubWindow* sub; sub = new QMdiSubWindow(centralWidget()); editor = new QLCFixtureEditor(sub, new QLCFixtureDef()); sub->setWidget(editor); sub->setAttribute(Qt::WA_DeleteOnClose); sub->setWindowIcon(QIcon(":/fixture.png")); qobject_cast<QMdiArea*> (centralWidget())->addSubWindow(sub); editor->show(); sub->show(); }
void MainWindow::on_actionSave_view_triggered() { QString filename = QFileDialog::getSaveFileName(this); if (filename!=""){ GLWidget* glw = centralWidget()->findChild<GLWidget*>("widget"); glw->saveView(filename); } }
void PFSViewMainWin::updateViewSize() { // QSize sz = sizeHint(); // printf( "main window: %d %d\n", sz.width(), sz.height() ); centralWidget()->updateGeometry(); resize( sizeHint() ); }
void UIVMInformationDialog::prepareCentralWidget() { /* Create central-widget: */ setCentralWidget(new QWidget); AssertPtrReturnVoid(centralWidget()); { /* Create main-layout: */ new QVBoxLayout(centralWidget()); AssertPtrReturnVoid(centralWidget()->layout()); { /* Create tab-widget: */ prepareTabWidget(); /* Create button-box: */ prepareButtonBox(); } } }
void MainWindow::on_actionLoad_right_ROI_triggered() { QString filename = QFileDialog::getOpenFileName(this); if (filename!=""){ GLWidget* glw = centralWidget()->findChild<GLWidget*>("widget"); if (glw->data->surfsetr) glw->data->surfsetr->loadROI(filename); } }
void AccountSetupPage::createContent() { MApplicationPage::createContent(); setContentsMargins(0, 0, 0, 0); setPannable(true); //% "Mail" setTitle(qtTrId("xx_page_title")); MLayout *layout = new MLayout(centralWidget()); MLinearLayoutPolicy *policy = new MLinearLayoutPolicy(layout, Qt::Vertical); //% "New mail account" creatLabel (policy, ("<b>" + qtTrId("xx_new_mail_account") + "<b>"), true); //% "We need to take some details to setup your account." creatLabel (policy, qtTrId("xx_need_account_detail"), true); // Prompt the user for name //% "What's your name?" creatLabel(policy, qtTrId("xx_enter_your_name")); m_username = new MTextEdit(MTextEditModel::SingleLine, "", this); m_username->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); policy->addItem(m_username); policy->setItemSpacing(policy->indexOf(m_username), 5); // Prompt the user for email address //% "Email address" creatLabel (policy, qtTrId("xx_email_address")); m_emailAddress = new MTextEdit(MTextEditModel::SingleLine, "", this); m_emailAddress->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); policy->addItem(m_emailAddress); policy->setItemSpacing(policy->indexOf(m_emailAddress), 5); // Prompt the user for password //% "Password" creatLabel(policy, qtTrId("xx_password")); m_password = new MTextEdit(MTextEditModel::SingleLine, "", this); m_password->setEchoMode(MTextEditModel::Password); m_password->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); policy->addItem(m_password); policy->setItemSpacing(policy->indexOf(m_password), 5); // Setup button //% "Setup account" MButton *button = new MButton(qtTrId("xx_setup_account_button_label"), this); button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); connect(button, SIGNAL(clicked(bool)), this, SLOT(setupAccount())); policy->addItem(button); policy->addStretch(); // Settings menu //% "Settings" MAction *action = new MAction(qtTrId("xx_settings_actions"), this); action->setLocation(MAction::ApplicationMenuLocation); connect(action, SIGNAL(triggered(bool)), this, SIGNAL(emailSettingsTriggered())); addAction(action); }
KTMainWindow::KTMainWindow(KTSplash *splash) : DMainWindow(), m_exposureSheet(0), m_scenes(0) { DINIT; setObjectName("KTMainWindow_"); m_osd = new KTOsd( centralWidget() ); m_statusBar = new KTStatusBar(this); setStatusBar( m_statusBar ); setWindowTitle(tr("KToon: 2D animation toolkit")); m_renderType = KToon::RenderType(DCONFIG->value("RenderType").toInt()); m_projectManager = new KTProjectManager(this); splash->setMessage( tr("Setting up the project manager") ); m_drawingSpace = new KTWorkspace; m_drawingSpace->setWindowIcon(QIcon(THEME_DIR+"/icons/illustration_mode.png")); m_drawingSpace->setScrollBarsEnabled( true ); addWidget(m_drawingSpace, tr("Illustration"), true); m_animationSpace = new KTWorkspace; m_animationSpace->setWindowIcon(QIcon(THEME_DIR+"/icons/animation_mode.png")); m_animationSpace->setScrollBarsEnabled ( true ); connect(m_animationSpace, SIGNAL(contextMenu( const QPoint& )), this, SLOT(showAnimationMenu( const QPoint& ))); addWidget(m_animationSpace, tr("Animation"), true); splash->setMessage( tr("Loading action manager...")); m_actionManager = new DActionManager(this); // Create the menubar; splash->setMessage( tr("Creating menu bar...")); setupActions(); splash->setMessage( tr("Creating GUI...")); createGUI(); setupMenu(); m_pActiveTabWidget->setCurrentIndex( 0 ); DCONFIG->beginGroup("TipOfDay"); bool showTips = qvariant_cast<bool>(DCONFIG->value("ShowOnStart", true )); if ( showTips ) { QTimer::singleShot(0, this, SLOT(showTipDialog())); } KTPluginManager::instance()->loadPlugins(); }
void SheetsPage::populateLayout() { list = new MList(centralWidget()); list->setCellCreator(new SheetsPageCellCreator()); list->setItemModel(new QStringListModel(list)); policy->addItem(list, Qt::AlignCenter); connect(list, SIGNAL(itemClicked(QModelIndex)), this, SLOT(itemClicked(QModelIndex))); }
void App::slotModeDesign() { /* Nothing to do if we're already in the desired mode */ if (m_mode == Design) return; if (m_masterTimer->runningFunctions()) { int result = QMessageBox::warning( this, tr("Switch to Design Mode"), tr("There are still running functions.\n" "Really stop them and switch back to " "Design mode?"), QMessageBox::Yes, QMessageBox::No); if (result == QMessageBox::No) return; else m_masterTimer->stopAll(); } /* Set normal palette to mode indicator */ m_modeIndicator->setText(KModeTextDesign); m_modeIndicator->setToolTip( tr("Design mode is active; editing facilities are enabled")); QPalette pal = palette(); pal.setColor(QPalette::Window, QApplication::palette().color(QPalette::Window)); pal.setColor(QPalette::WindowText, QApplication::palette().color(QPalette::WindowText)); m_modeIndicator->setPalette(pal); m_fileNewAction->setEnabled(true); m_fileOpenAction->setEnabled(true); m_fileQuitAction->setEnabled(true); m_functionManagerAction->setEnabled(true); m_outputManagerAction->setEnabled(true); m_inputManagerAction->setEnabled(true); m_busManagerAction->setEnabled(true); m_modeToggleAction->setIcon(QIcon(":/operate.png")); m_modeToggleAction->setText(tr("Operate")); m_modeToggleAction->setToolTip(tr("Switch to operate mode")); /* Allow opening a context menu */ #ifndef __APPLE__ // No centralWidget on APPLE centralWidget()->setContextMenuPolicy(Qt::CustomContextMenu); #endif m_mode = Design; emit modeChanged(Design); }
void WFrame::loadMap() { QString s = r->getFilePath() + " Erfolgreich geladen"; statusBar()->showMessage(s, 5000); wMap = new WMap(c,r); mapLoaded = true; setCentralWidget(wMap); centralWidget()->show(); }