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. QGuiApplication::commitDataRequest not received with local Qt but received with system Qt

QGuiApplication::commitDataRequest not received with local Qt but received with system Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
session manager
5 Posts 3 Posters 421 Views
  • 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.
  • V Offline
    V Offline
    vlanquepin
    wrote on 29 Jun 2023, 10:34 last edited by
    #1

    Hi,
    I need to prevent Fedora 36 user session from closing, so I tried to connect to QGuiApplication::commitDataRequest signal and call cancel on the QSessionManager object.

    This do the trick :

    
    Helper::Helper(QObject *parent)
        : QObject(parent)
    {
        connect(qApp, &QGuiApplication::commitDataRequest,
                this, &Helper::commitData);
    }
    
    
    void Helper::commitData(QSessionManager& manager)
    {
        manager.cancel();
    }
    
    

    But only if my code is compiled with the Qt installed on my system (Qt 5.15.10 - /usr/lib64/qt5/) and not with the Qt installed locally (Qt 5.15.2 - /home/<user>/Qt/...).
    If I execute this code compiled with the Qt installed into my home, the commitDataRequest signal is never received.

    Any idea?

    S 1 Reply Last reply 29 Jun 2023, 19:07
    0
    • V vlanquepin
      29 Jun 2023, 10:34

      Hi,
      I need to prevent Fedora 36 user session from closing, so I tried to connect to QGuiApplication::commitDataRequest signal and call cancel on the QSessionManager object.

      This do the trick :

      
      Helper::Helper(QObject *parent)
          : QObject(parent)
      {
          connect(qApp, &QGuiApplication::commitDataRequest,
                  this, &Helper::commitData);
      }
      
      
      void Helper::commitData(QSessionManager& manager)
      {
          manager.cancel();
      }
      
      

      But only if my code is compiled with the Qt installed on my system (Qt 5.15.10 - /usr/lib64/qt5/) and not with the Qt installed locally (Qt 5.15.2 - /home/<user>/Qt/...).
      If I execute this code compiled with the Qt installed into my home, the commitDataRequest signal is never received.

      Any idea?

      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 29 Jun 2023, 19:07 last edited by
      #2

      Hi and welcome to devnet,

      Does it also happen if you use Qt 6 ?

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

      V 1 Reply Last reply 30 Jun 2023, 08:36
      0
      • S SGaist
        29 Jun 2023, 19:07

        Hi and welcome to devnet,

        Does it also happen if you use Qt 6 ?

        V Offline
        V Offline
        vlanquepin
        wrote on 30 Jun 2023, 08:36 last edited by
        #3

        Thanks @SGaist!

        I installed Qt6 this morning (system and local) and yes I have the same behavior.

        I receive QGuiApplication::commitDataRequest with system Qt6 but not with local Qt6...

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vlanquepin
          wrote on 6 Jul 2023, 15:32 last edited by
          #4

          Still blocked. Anyone knows how commitDataRequest works in the low-level code? I would like to understand why my system Qt and my local Qt have not the same behavior on the same code...

          C 1 Reply Last reply 6 Jul 2023, 16:34
          0
          • V vlanquepin
            6 Jul 2023, 15:32

            Still blocked. Anyone knows how commitDataRequest works in the low-level code? I would like to understand why my system Qt and my local Qt have not the same behavior on the same code...

            C Online
            C Online
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 6 Jul 2023, 16:34 last edited by
            #5

            @vlanquepin said in QGuiApplication::commitDataRequest not received with local Qt but received with system Qt:

            Anyone knows how commitDataRequest works in the low-level code?

            Qt is open-source.

            I would guess it's coming from the platform integration plugin so it's either not built correctly in your local Qt or can not connect to your WM/DM.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            0

            1/5

            29 Jun 2023, 10:34

            • Login

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