Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSplashScreen - Focus lost
Forum Updated to NodeBB v4.3 + New Features

QSplashScreen - Focus lost

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BrianN
    wrote on last edited by
    #1

    I have always started my application with a splash screen and clicking on the splash screen closed it normally and the main window was left on show.

    Recently clicking on the splash screen leaves the main window behind whatever window was previously on top.

    I am looking for a way to make sure my main window is on top when the splash screen is closed. If I wait for the splash screen to close on its timer this is the case.

    Thanks

    ODБOïO 1 Reply Last reply
    0
    • B BrianN

      I have always started my application with a splash screen and clicking on the splash screen closed it normally and the main window was left on show.

      Recently clicking on the splash screen leaves the main window behind whatever window was previously on top.

      I am looking for a way to make sure my main window is on top when the splash screen is closed. If I wait for the splash screen to close on its timer this is the case.

      Thanks

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        What version of Qt ?
        On what platform ?
        Can you provide a minimal compile example that reproduce that behaviour ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • B Offline
          B Offline
          BrianN
          wrote on last edited by
          #4

          Sorry for the delay answering.

          Windows QT5.12.

          If I run this application and wait 5s the splash screen that was on top closes and my dialog is visible and on top. If I instead click on the splash screen my dialog is one layer behind whichever task was previously active. In this case Qt Creator.

          For a few years it did not have this behaviour but it started recently. Sorry I cant be specific as to which version caused the issue.

          #include "dialog.h"
          #include <QApplication>
          #include <QPixmap>
          #include <QSplashScreen>
          #include <QTimer>

          int main(int argc, char *argv[])
          {
          QApplication a(argc, argv);

          QPixmap pixmap;
          pixmap.load(":/Images/xxxxxxxxSplashSmall.bmp");
          
          QSplashScreen *splash = new QSplashScreen;
          splash->setPixmap(pixmap);
          
          Dialog w;
          w.show();
          
          splash->show();
          
          // Kill the splash screen after 5s
          QTimer::singleShot(5000, splash, SLOT(close()));
          
          return a.exec();
          

          }

          Thanks

          Brian

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            What is Dialog ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • B Offline
              B Offline
              BrianN
              wrote on last edited by
              #6

              Hi,

              I just started from a bare bones application as a test program.

              dialog.h
              #ifndef DIALOG_H
              #define DIALOG_H

              #include <QDialog>

              namespace Ui {
              class Dialog;
              }

              class Dialog : public QDialog
              {
              Q_OBJECT

              public:
              explicit Dialog(QWidget *parent = nullptr);
              ~Dialog();

              private:
              Ui::Dialog *ui;
              };

              #endif // DIALOG_H

              dialog.cpp
              #include "dialog.h"
              #include "ui_dialog.h"

              Dialog::Dialog(QWidget *parent) :
              QDialog(parent),
              ui(new Ui::Dialog)
              {
              ui->setupUi(this);
              }

              Dialog::~Dialog()
              {
              delete ui;
              }

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Tested on macOS but it's working fine...

                Can you test with the 5.13 preview ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved