void FoursquareAuthPage::createContent(void) { MApplicationPage::createContent(); setStyleName("CommonApplicationPage"); setPannable(false); MAction *cancelAction = new MAction(tr("Cancel"), this); cancelAction->setLocation(MAction::ToolBarLocation); connect(cancelAction, SIGNAL(triggered()), this, SLOT(dismiss())); addAction(cancelAction); QGraphicsAnchorLayout *layout = new QGraphicsAnchorLayout(); layout->setContentsMargins(0, 0, 0, 0); m_header = new ViewHeader(tr("Foursquare authentication")); layout->addCornerAnchors(m_header, Qt::TopLeftCorner, layout, Qt::TopLeftCorner); layout->addCornerAnchors(m_header, Qt::TopRightCorner, layout, Qt::TopRightCorner); QGraphicsGridLayout *subLayout = new QGraphicsGridLayout(); layout->addCornerAnchors(subLayout, Qt::TopLeftCorner, m_header, Qt::BottomLeftCorner); layout->addCornerAnchors(subLayout, Qt::BottomRightCorner, layout, Qt::BottomRightCorner); m_view = new QGraphicsWebView(); m_view->setResizesToContents(false); m_view->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); connect(m_view, SIGNAL(loadStarted()), this, SLOT(pageLoadStarted())); connect(m_view, SIGNAL(loadFinished(bool)), this, SLOT(pageLoadFinished(bool))); subLayout->addItem(m_view, 0, 0); m_nam = new FoursquareAuthNetworkAccessManager(m_view->page()->networkAccessManager(), REDIRECT_URL, this); connect(m_nam, SIGNAL(tokenReceived(QString)), this, SLOT(tokenReceived(QString))); m_view->page()->setNetworkAccessManager(m_nam); centralWidget()->setLayout(layout); Q_EMIT(created()); }
void MainPage::createContent(void) { m_bluez->start(); MApplicationPage::createContent(); setStyleName("CommonApplicationPage"); setPannable(false); createObjectMenuActions(); createActions(); QGraphicsAnchorLayout *layout = new QGraphicsAnchorLayout(); layout->setContentsMargins(0, 0, 0, 0); ViewHeader *header = new ViewHeader(tr("Stored tags")); layout->addCornerAnchors(header, Qt::TopLeftCorner, layout, Qt::TopLeftCorner); LabelOrList *list = new LabelOrList(TagStorage::storage(), _getTagListCellCreator, tr("You don't have any " "stored tags currently. " "Create some or harvest " "existing ones by touching " "them."), false, false); list->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); layout->addCornerAnchors(list, Qt::TopLeftCorner, header, Qt::BottomLeftCorner); layout->addCornerAnchors(list, Qt::BottomRightCorner, layout, Qt::BottomRightCorner); connect(list, SIGNAL(itemClicked(const QModelIndex &)), this, SLOT(tagSelected(const QModelIndex &))); connect(list, SIGNAL(itemLongTapped(const QModelIndex &, const QPointF &)), this, SLOT(tagLongSelected(const QModelIndex &, const QPointF &))); centralWidget()->setLayout(layout); }
void StatusIndicatorMenuDropDownView::applyStyle() { MSceneWindowView::applyStyle(); if (pannableViewport == NULL) { QGraphicsAnchorLayout *backgroundLayout = new QGraphicsAnchorLayout; backgroundLayout->setContentsMargins(0, 0, 0, 0); backgroundLayout->setSpacing(0); backgroundLayout->addCornerAnchors(backgroundWidget, Qt::TopLeftCorner, backgroundLayout, Qt::TopLeftCorner); backgroundLayout->setMaximumHeight(0); // Put all the stuff into the scene window layout pannableViewport = createPannableArea(); topRowWidget = createTopRow(); QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addItem(topRowWidget); layout->addItem(backgroundLayout); layout->addItem(pannableViewport); controller->setLayout(layout); } }
void tst_QGraphicsAnchorLayout::linearVsAnchorNested() { QFETCH(int, whichLayout); QSizeF min(10, 10); QSizeF pref(80, 80); QSizeF max(150, 150); QGraphicsWidget *a = createItem(min, pref, max, "a"); QGraphicsWidget *b = createItem(min, pref, max, "b"); QGraphicsWidget *c = createItem(min, pref, max, "c"); QGraphicsWidget *d = createItem(min, pref, max, "d"); QGraphicsLayout *layout; if (whichLayout == 0) { QGraphicsLinearLayout *linear1 = new QGraphicsLinearLayout; QGraphicsLinearLayout *linear2 = new QGraphicsLinearLayout(Qt::Vertical); QGraphicsLinearLayout *linear3 = new QGraphicsLinearLayout; linear1->addItem(a); linear1->addItem(linear2); linear2->addItem(b); linear2->addItem(linear3); linear3->addItem(c); linear3->addItem(d); layout = linear1; } else if (whichLayout == 1) { QGraphicsAnchorLayout *anchor = new QGraphicsAnchorLayout; // A anchor->addCornerAnchors(a, Qt::TopLeftCorner, anchor, Qt::TopLeftCorner); anchor->addCornerAnchors(a, Qt::TopRightCorner, b, Qt::TopLeftCorner); anchor->addCornerAnchors(a, Qt::BottomLeftCorner, anchor, Qt::BottomLeftCorner); anchor->addCornerAnchors(a, Qt::BottomRightCorner, c, Qt::BottomLeftCorner); // B anchor->addCornerAnchors(b, Qt::TopRightCorner, anchor, Qt::TopRightCorner); anchor->addCornerAnchors(b, Qt::BottomLeftCorner, c, Qt::TopLeftCorner); anchor->addCornerAnchors(b, Qt::BottomRightCorner, d, Qt::TopRightCorner); // C anchor->addCornerAnchors(c, Qt::TopRightCorner, d, Qt::TopLeftCorner); anchor->addCornerAnchors(c, Qt::BottomRightCorner, d, Qt::BottomLeftCorner); // D anchor->addCornerAnchors(d, Qt::BottomRightCorner, anchor, Qt::BottomRightCorner); layout = anchor; } else { QGraphicsAnchorLayout *anchor = new QGraphicsAnchorLayout; // A anchor->addAnchor(a, Qt::AnchorLeft, anchor, Qt::AnchorLeft); anchor->addAnchors(a, anchor, Qt::Vertical); anchor->addAnchor(a, Qt::AnchorRight, b, Qt::AnchorLeft); anchor->addAnchor(a, Qt::AnchorRight, c, Qt::AnchorLeft); // B anchor->addAnchor(b, Qt::AnchorTop, anchor, Qt::AnchorTop); anchor->addAnchor(b, Qt::AnchorRight, anchor, Qt::AnchorRight); anchor->addAnchor(b, Qt::AnchorBottom, c, Qt::AnchorTop); anchor->addAnchor(b, Qt::AnchorBottom, d, Qt::AnchorTop); // C anchor->addAnchor(c, Qt::AnchorRight, d, Qt::AnchorLeft); anchor->addAnchor(c, Qt::AnchorBottom, anchor, Qt::AnchorBottom); // D anchor->addAnchor(d, Qt::AnchorRight, anchor, Qt::AnchorRight); anchor->addAnchor(d, Qt::AnchorBottom, anchor, Qt::AnchorBottom); layout = anchor; } QSizeF sizeHint; // warm up instruction cache layout->invalidate(); sizeHint = layout->effectiveSizeHint(Qt::PreferredSize); // ...then measure... QBENCHMARK { // To ensure that all sizeHints caches are invalidated in // the LinearLayout setup, we must call updateGeometry on the // children. If we didn't, only the top level layout would be // re-calculated. static_cast<QGraphicsLayoutItem *>(a)->updateGeometry(); static_cast<QGraphicsLayoutItem *>(b)->updateGeometry(); static_cast<QGraphicsLayoutItem *>(c)->updateGeometry(); static_cast<QGraphicsLayoutItem *>(d)->updateGeometry(); layout->invalidate(); sizeHint = layout->effectiveSizeHint(Qt::PreferredSize); } }
int main(int argc, char *argv[]) { QApplication app(argc, argv); QGraphicsScene *scene = new QGraphicsScene(); Widget *a = new Widget(Qt::blue, Qt::white, "a"); a->setPreferredSize(100, 100); Widget *b = new Widget(Qt::green, Qt::black, "b"); b->setPreferredSize(100, 100); Widget *c = new Widget(Qt::red, Qt::black, "c"); c->setPreferredSize(100, 100); QGraphicsAnchorLayout *layout = new QGraphicsAnchorLayout(); /* //! [adding a corner anchor in two steps] layout->addAnchor(a, Qt::AnchorTop, layout, Qt::AnchorTop); layout->addAnchor(a, Qt::AnchorLeft, layout, Qt::AnchorLeft); //! [adding a corner anchor in two steps] */ //! [adding a corner anchor] layout->addCornerAnchors(a, Qt::TopLeftCorner, layout, Qt::TopLeftCorner); //! [adding a corner anchor] //! [adding anchors] layout->addAnchor(b, Qt::AnchorLeft, a, Qt::AnchorRight); layout->addAnchor(b, Qt::AnchorTop, a, Qt::AnchorBottom); //! [adding anchors] // Place a third widget below the second. layout->addAnchor(b, Qt::AnchorBottom, c, Qt::AnchorTop); /* //! [adding anchors to match sizes in two steps] layout->addAnchor(b, Qt::AnchorLeft, c, Qt::AnchorLeft); layout->addAnchor(b, Qt::AnchorRight, c, Qt::AnchorRight); //! [adding anchors to match sizes in two steps] */ //! [adding anchors to match sizes] layout->addAnchors(b, c, Qt::Horizontal); //! [adding anchors to match sizes] // Anchor the bottom-right corner of the third widget to the bottom-right // corner of the layout. layout->addCornerAnchors(c, Qt::BottomRightCorner, layout, Qt::BottomRightCorner); QGraphicsWidget *w = new QGraphicsWidget(0, Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint); w->setPos(20, 20); w->setMinimumSize(100, 100); w->setPreferredSize(320, 240); w->setLayout(layout); w->setWindowTitle(QApplication::translate("simpleanchorlayout", "QGraphicsAnchorLayout in use")); scene->addItem(w); QGraphicsView *view = new QGraphicsView(); view->setScene(scene); view->setWindowTitle(QApplication::translate("simpleanchorlayout", "Simple Anchor Layout")); view->resize(360, 320); view->show(); return app.exec(); }
void CreateEditPage::createContent(void) { MApplicationPage::createContent(); setStyleName("CommonApplicationPage"); setPannable(false); createActions(); QGraphicsAnchorLayout *anchor = new QGraphicsAnchorLayout(); anchor->setContentsMargins(0, 0, 0, 0); anchor->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); ViewHeader *header = new ViewHeader(m_tag == TagStorage::NULL_TAG ? tr("Create tag contents") : tr("Edit tag contents")); anchor->addCornerAnchors(header, Qt::TopLeftCorner, anchor, Qt::TopLeftCorner); #ifdef LABEL_SIZE m_size = new MLabel(); m_size->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); m_size->setAlignment(Qt::AlignRight); anchor->addAnchor(m_size, Qt::AnchorBottom, anchor, Qt::AnchorBottom); anchor->addAnchor(m_size, Qt::AnchorRight, anchor, Qt::AnchorRight); #endif MWidget *layoutContainer = new MWidget(); layoutContainer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); m_layout = new QGraphicsLinearLayout(Qt::Vertical, layoutContainer); m_layout->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); m_name = new LabeledTextEdit(tr("Ok"), LabeledTextEdit::SingleLineEditAndLabel); m_name->setLabel(tr("Tag name")); m_name->setPrompt(tr("Enter tag name")); m_name->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); m_layout->addItem(m_name); m_layout->setAlignment(m_name, Qt::AlignLeft); connect(m_name, SIGNAL(contentsChanged(void)), this, SLOT(nameChanged(void))); MSeparator *sep = new MSeparator; sep->setStyleName("CommonHorizontalSeparator"); sep->setOrientation(Qt::Horizontal); layout()->addItem(sep); createPageSpecificContent(); MPannableViewport *view = new MPannableViewport(); view->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); view->setPanDirection(Qt::Vertical); view->setMinimumSize(100, 100); view->setWidget(layoutContainer); anchor->addAnchor(view, Qt::AnchorTop, header, Qt::AnchorBottom); #ifdef LABEL_SIZE anchor->addAnchor(view, Qt::AnchorBottom, m_size, Qt::AnchorTop); #else anchor->addAnchor(view, Qt::AnchorBottom, anchor, Qt::AnchorBottom); #endif anchor->addAnchor(view, Qt::AnchorLeft, anchor, Qt::AnchorLeft); anchor->addAnchor(view, Qt::AnchorRight, anchor, Qt::AnchorRight); centralWidget()->setLayout(anchor); if (m_tag == TagStorage::NULL_TAG) { setContentValidity(false); setNameValidity(false); setupNewData(); } else { load(); } }
void CurrentTrack::init() { DEBUG_BLOCK PERF_LOG( "Begin init" ); // Call the base implementation. Context::Applet::init(); setToolTip( i18n( "Right-click to configure" ) ); m_ratingWidget = new RatingWidget( this ); m_ratingWidget->setSpacing( 2 ); m_ratingWidget->setMinimumSize( m_albumWidth + 10, 30 ); m_ratingWidget->setMaximumSize( m_albumWidth + 10, 30 ); connect( m_ratingWidget, SIGNAL(ratingChanged(int)), SLOT(trackRatingChanged(int)) ); QLabel *collectionLabel = new QLabel( i18n( "Local Collection" ) ); collectionLabel->setAttribute( Qt::WA_NoSystemBackground ); collectionLabel->setAlignment( Qt::AlignCenter ); m_collectionLabel = new QGraphicsProxyWidget( this ); m_collectionLabel->setWidget( collectionLabel ); m_title = new TextScrollingWidget( this ); m_artist = new TextScrollingWidget( this ); m_album = new TextScrollingWidget( this ); m_byText = new QGraphicsSimpleTextItem( i18nc( "What artist is this track by", "By" ), this ); m_onText = new QGraphicsSimpleTextItem( i18nc( "What album is this track on", "On" ), this ); m_recentWidget = new RecentlyPlayedListWidget( this ); m_recentHeader = new TextScrollingWidget( this ); m_recentHeader->setDrawBackground( true ); m_recentHeader->setAlignment( Qt::AlignLeft ); QFont recentHeaderFont; recentHeaderFont.setPointSize( recentHeaderFont.pointSize() + 2 ); m_recentHeader->setFont( recentHeaderFont ); m_title->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_artist->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_album->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_collectionLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_recentHeader->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); m_recentWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); m_recentWidget->setMinimumHeight( 10 ); m_albumCover = new DropPixmapLayoutItem( this ); m_albumCover->setPreferredSize( QSizeF( m_albumWidth, m_albumWidth ) ); connect( m_albumCover, SIGNAL(imageDropped(QPixmap)), SLOT(coverDropped(QPixmap)) ); const QBrush brush = normalBrush(); m_title->setBrush( brush ); m_artist->setBrush( brush ); m_album->setBrush( brush ); m_byText->setBrush( brush ); m_onText->setBrush( brush ); const QFont tinyFont = KGlobalSettings::smallestReadableFont(); m_byText->setFont( tinyFont ); m_onText->setFont( tinyFont ); m_actionsLayout = new QGraphicsLinearLayout; m_actionsLayout->setMinimumWidth( 10 ); m_actionsLayout->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); QGraphicsLinearLayout *titlesLayout = new QGraphicsLinearLayout( Qt::Vertical ); titlesLayout->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); titlesLayout->setMinimumWidth( 10 ); titlesLayout->setSpacing( 2 ); titlesLayout->addItem( m_title ); titlesLayout->addItem( m_artist ); titlesLayout->addItem( m_album ); titlesLayout->addItem( m_actionsLayout ); titlesLayout->setItemSpacing( 2, 4 ); // a bit more spacing for the actions row const qreal pad = standardPadding(); QGraphicsAnchorLayout *l = new QGraphicsAnchorLayout( this ); l->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); l->addCornerAnchors( m_ratingWidget, Qt::BottomLeftCorner, l, Qt::BottomLeftCorner ); l->addCornerAnchors( m_ratingWidget, Qt::BottomLeftCorner, m_collectionLabel, Qt::BottomLeftCorner ); l->addCornerAnchors( m_ratingWidget, Qt::TopRightCorner, m_collectionLabel, Qt::TopRightCorner ); l->addCornerAnchors( m_recentHeader, Qt::TopRightCorner, l, Qt::TopRightCorner ); l->addAnchor( m_albumCover, Qt::AnchorBottom, m_ratingWidget, Qt::AnchorTop )->setSpacing( 4 ); l->addAnchor( m_albumCover, Qt::AnchorHorizontalCenter, m_ratingWidget, Qt::AnchorHorizontalCenter ); l->addAnchor( titlesLayout, Qt::AnchorTop, l, Qt::AnchorTop )->setSpacing( 18 ); l->addAnchor( titlesLayout, Qt::AnchorRight, l, Qt::AnchorRight )->setSpacing( pad ); l->addAnchors( m_recentWidget, m_recentHeader, Qt::Horizontal ); l->addAnchor( m_recentWidget, Qt::AnchorTop, m_recentHeader, Qt::AnchorBottom ); l->addAnchor( m_recentWidget, Qt::AnchorRight, m_recentHeader, Qt::AnchorRight ); l->addAnchor( m_recentWidget, Qt::AnchorLeft, m_ratingWidget, Qt::AnchorRight )->setSpacing( pad * 2 ); l->addAnchor( m_recentWidget, Qt::AnchorBottom, m_albumCover, Qt::AnchorBottom )->setSpacing( 20 ); qreal midSpacing = qMax( m_byText->boundingRect().width(), m_onText->boundingRect().width() ) + pad; l->addAnchor( titlesLayout, Qt::AnchorLeft, m_ratingWidget, Qt::AnchorRight )->setSpacing( midSpacing ); l->anchor( m_recentHeader, Qt::AnchorTop, l, Qt::AnchorTop )->setSpacing( 2 ); // Read config KConfigGroup config = Amarok::config("Current Track Applet"); const QString fontDesc = config.readEntry( "Font", QString() ); QFont font; if( !fontDesc.isEmpty() ) font.fromString( fontDesc ); else font.setPointSize( font.pointSize() + 3 ); m_showEditTrackDetailsAction = config.readEntry( "ShowEditTrackAction", true ); m_title->setFont( font ); m_artist->setFont( font ); m_album->setFont( font ); m_title->setAlignment( Qt::AlignLeft ); m_artist->setAlignment( Qt::AlignLeft ); m_album->setAlignment( Qt::AlignLeft ); dataEngine( "amarok-current" )->setProperty( "coverWidth", m_albumWidth ); dataEngine( "amarok-current" )->connectSource( "current", this ); connect( The::paletteHandler(), SIGNAL(newPalette(QPalette)), SLOT(paletteChanged(QPalette)) ); connect( CollectionManager::instance(), SIGNAL(collectionDataChanged(Collections::Collection*)), this, SLOT(queryCollection()), Qt::QueuedConnection ); queryCollection(); setView( Stopped ); PERF_LOG( "Finished init" ); }
void StelMainView::init(QSettings* conf) { gui = new StelGui(); #if STEL_USE_NEW_OPENGL_WIDGETS //glWidget->initializeGL(); // protected... //Q_ASSERT(glWidget->isValid()); #else Q_ASSERT(glWidget->isValid()); glWidget->makeCurrent(); #endif // Should be check of requirements disabled? if (conf->value("main/check_requirements", true).toBool()) { // Find out lots of debug info about supported version of OpenGL and vendor/renderer. processOpenGLdiagnosticsAndWarnings(conf, glWidget); } stelApp= new StelApp(); stelApp->setGui(gui); stelApp->init(conf); StelActionMgr *actionMgr = stelApp->getStelActionManager(); actionMgr->addAction("actionSave_Screenshot_Global", N_("Miscellaneous"), N_("Save screenshot"), this, "saveScreenShot()", "Ctrl+S"); actionMgr->addAction("actionSet_Full_Screen_Global", N_("Display Options"), N_("Full-screen mode"), this, "fullScreen", "F11"); StelPainter::initGLShaders(); skyItem = new StelSkyItem(); guiItem = new StelGuiItem(); QGraphicsAnchorLayout* l = new QGraphicsAnchorLayout(rootItem); l->setSpacing(0); l->setContentsMargins(0,0,0,0); l->addCornerAnchors(skyItem, Qt::TopLeftCorner, l, Qt::TopLeftCorner); l->addCornerAnchors(skyItem, Qt::BottomRightCorner, l, Qt::BottomRightCorner); l->addCornerAnchors(guiItem, Qt::BottomLeftCorner, l, Qt::BottomLeftCorner); l->addCornerAnchors(guiItem, Qt::TopRightCorner, l, Qt::TopRightCorner); rootItem->setLayout(l); scene()->addItem(rootItem); nightModeEffect = new NightModeGraphicsEffect(this); updateNightModeProperty(); rootItem->setGraphicsEffect(nightModeEffect); QSize size = glWidget->windowHandle()->screen()->size(); size = QSize(conf->value("video/screen_w", size.width()).toInt(), conf->value("video/screen_h", size.height()).toInt()); bool fullscreen = conf->value("video/fullscreen", true).toBool(); // Without this, the screen is not shown on a Mac + we should use resize() for correct work of fullscreen/windowed mode switch. --AW WTF??? resize(size); QDesktopWidget *desktop = QApplication::desktop(); int screen = conf->value("video/screen_number", 0).toInt(); if (screen < 0 || screen >= desktop->screenCount()) { qWarning() << "WARNING: screen" << screen << "not found"; screen = 0; } QRect screenGeom = desktop->screenGeometry(screen); if (fullscreen) { // The "+1" below is to work around Linux/Gnome problem with mouse focus. move(screenGeom.x()+1, screenGeom.y()+1); // The fullscreen window appears on screen where is the majority of // the normal window. Therefore we crop the normal window to the // screen area to ensure that the majority is not on another screen. setGeometry(geometry() & screenGeom); setFullScreen(true); } else { setFullScreen(false); int x = conf->value("video/screen_x", 0).toInt(); int y = conf->value("video/screen_y", 0).toInt(); move(x + screenGeom.x(), y + screenGeom.y()); } flagInvertScreenShotColors = conf->value("main/invert_screenshots_colors", false).toBool(); setFlagCursorTimeout(conf->value("gui/flag_mouse_cursor_timeout", false).toBool()); setCursorTimeout(conf->value("gui/mouse_cursor_timeout", 10.f).toFloat()); maxfps = conf->value("video/maximum_fps",10000.f).toFloat(); minfps = conf->value("video/minimum_fps",10000.f).toFloat(); flagMaxFpsUpdatePending = false; // XXX: This should be done in StelApp::init(), unfortunately for the moment we need init the gui before the // plugins, because the gui create the QActions needed by some plugins. StelApp::getInstance().initPlugIns(); // activate DE430/431 StelApp::getInstance().getCore()->initEphemeridesFunctions(); // The script manager can only be fully initialized after the plugins have loaded. StelApp::getInstance().initScriptMgr(); // Set the global stylesheet, this is only useful for the tooltips. StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui()); if (gui!=NULL) setStyleSheet(gui->getStelStyle().qtStyleSheet); connect(&StelApp::getInstance(), SIGNAL(visionNightModeChanged(bool)), this, SLOT(updateNightModeProperty())); QThread::currentThread()->setPriority(QThread::HighestPriority); startMainLoop(); }