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. macOS showing modal that Qt app is interrumpting logout for some seconds
Forum Updated to NodeBB v4.3 + New Features

macOS showing modal that Qt app is interrumpting logout for some seconds

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 5 Posters 587 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.
  • X Offline
    X Offline
    xarli
    wrote on last edited by xarli
    #1

    Hi,

    I'm currently developing an app for macOS, using Qt 6.X the app is started on boot and will be running till is the user logs off, shutdown or restart the app.
    The issue is that a macOS is show this pop up whenever the current user session is being closed, was reviewing if I'm doing wrong on exit but just in case I compile and run on release the Hello tr() Example of Qt Creator, that is the more simplest one and still is showing the popup for a few ms.

    723ebd9e-80a7-4b3b-a072-52451202cbbf-image.png
    2f72883e-4182-4acf-ac29-9ffb01b02215-image.png

    I removed to Qtranslator part and simplified it to minimal expression.

    #include <QApplication>
    #include <QPushButton>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
        QPushButton hello("Hello world!");
        hello.resize(100, 30);
        hello.show();
        return app.exec();
    }
    

    Can anyone help me with this? Thanks in advance.

    SGaistS 1 Reply Last reply
    0
    • X xarli

      Hi,

      I'm currently developing an app for macOS, using Qt 6.X the app is started on boot and will be running till is the user logs off, shutdown or restart the app.
      The issue is that a macOS is show this pop up whenever the current user session is being closed, was reviewing if I'm doing wrong on exit but just in case I compile and run on release the Hello tr() Example of Qt Creator, that is the more simplest one and still is showing the popup for a few ms.

      723ebd9e-80a7-4b3b-a072-52451202cbbf-image.png
      2f72883e-4182-4acf-ac29-9ffb01b02215-image.png

      I removed to Qtranslator part and simplified it to minimal expression.

      #include <QApplication>
      #include <QPushButton>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QPushButton hello("Hello world!");
          hello.resize(100, 30);
          hello.show();
          return app.exec();
      }
      

      Can anyone help me with this? Thanks in advance.

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You are calling exec twice on your app object.

      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
      • X Offline
        X Offline
        xarli
        wrote on last edited by xarli
        #3

        @SGaist Hi, sorry the code was pasted wrong, is respecting the example and is only called once. I had fixed it on main post.

        Actually doing a test Qt Creator app itself is showing this popup too.

        SGaistS 1 Reply Last reply
        0
        • X xarli

          @SGaist Hi, sorry the code was pasted wrong, is respecting the example and is only called once. I had fixed it on main post.

          Actually doing a test Qt Creator app itself is showing this popup too.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Which version of Qt are you building your application with ?
          On which version of macOS ?

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

          X 1 Reply Last reply
          0
          • SGaistS SGaist

            Which version of Qt are you building your application with ?
            On which version of macOS ?

            X Offline
            X Offline
            xarli
            wrote on last edited by xarli
            #5

            Last macOS version 13.3.1, and I've tested this on Qt6.3, 6.4 and finally with Qt6.5 too.
            I have an M1, 2020 but this is happening on other macs too.

            You can open Qt Creator, try log out and the message will flash for some ms.

            M D 2 Replies Last reply
            0
            • X xarli

              Last macOS version 13.3.1, and I've tested this on Qt6.3, 6.4 and finally with Qt6.5 too.
              I have an M1, 2020 but this is happening on other macs too.

              You can open Qt Creator, try log out and the message will flash for some ms.

              M Offline
              M Offline
              mpergand
              wrote on last edited by
              #6

              I can comfirm this behaviour on MacOs 10.15 and Qt 5.15.2 as well.

              1 Reply Last reply
              0
              • X xarli

                Last macOS version 13.3.1, and I've tested this on Qt6.3, 6.4 and finally with Qt6.5 too.
                I have an M1, 2020 but this is happening on other macs too.

                You can open Qt Creator, try log out and the message will flash for some ms.

                D Offline
                D Offline
                DerReisende
                wrote on last edited by
                #7

                @xarli Does the interruption only occur when you are running the example from Qt Creator?
                I can confirm your problem when I am running the example from CLion (I don't use Qt Creator). However, I cannot confirm your described behaviour if the example is run outside of CLion. With CLion, running the example causes the display of a modal dialog from CLion which - correctly - terminates the shutdown sequence with the macOS interrupted dialog.

                1 Reply Last reply
                0
                • X Offline
                  X Offline
                  xarli
                  wrote on last edited by xarli
                  #8

                  @DerReisende No, Im testing the HelloWorld app compiled on release and executed outside Creator.

                  The strange situation is that I can reproduce this on my app distributed to final users, Qt Creator app itself, and even on the OBS Studio application that I know that uses Qt too.

                  f7faec21-b7cc-4cbc-a118-c9cbfa27073b-image.png

                  Maybe is related with the main event loop hanging somehow some ms/secs I don't know, but I think that this can be perceived as a bug for the user and for sure is a bug for me.

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    TomBdil
                    wrote on last edited by
                    #9

                    Bumping this in case someone has found a solution.

                    X 1 Reply Last reply
                    0
                    • T TomBdil

                      Bumping this in case someone has found a solution.

                      X Offline
                      X Offline
                      xarli
                      wrote on last edited by xarli
                      #10

                      @TomBdil I didnt find anything to fix that still
                      I just find this bug pending being resolved
                      https://bugreports.qt.io/browse/QTBUG-102321

                      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