SplashScreen : Add "ShowSplasherMessages" parameter to disable labels from the splashscreen.

This commit is contained in:
Paddle
2023-10-30 15:42:43 +01:00
committed by wwmayer
parent 8239483c35
commit d3235e0c3a
3 changed files with 16 additions and 1 deletions

View File

@@ -252,7 +252,7 @@ struct MainWindowP
QMdiArea* mdiArea;
QPointer<MDIView> activeView;
QSignalMapper* windowMapper;
QSplashScreen* splashscreen;
SplashScreen* splashscreen;
StatusBarObserver* status;
bool whatsthis;
QString whatstext;
@@ -1830,6 +1830,11 @@ void MainWindow::startSplasher()
// first search for an external image file
if (hGrp->GetBool("ShowSplasher", true)) {
d->splashscreen = new SplashScreen(this->splashImage());
if (!hGrp->GetBool("ShowSplasherMessages", true)) {
d->splashscreen->setShowMessages(false);
}
d->splashscreen->show();
#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
d->screen = d->splashscreen->screen();

View File

@@ -250,6 +250,14 @@ void SplashScreen::drawContents ( QPainter * painter )
QSplashScreen::drawContents(painter);
}
void SplashScreen::setShowMessages(bool on)
{
messages->bErr = on;
messages->bMsg = on;
messages->bLog = on;
messages->bWrn = on;
}
// ------------------------------------------------------------------------------
AboutDialogFactory* AboutDialogFactory::factory = nullptr;

View File

@@ -44,6 +44,8 @@ public:
explicit SplashScreen( const QPixmap & pixmap = QPixmap ( ), Qt::WindowFlags f = Qt::WindowFlags() );
~SplashScreen() override;
void setShowMessages(bool on);
protected:
void drawContents ( QPainter * painter ) override;