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. Error data using QGuiApplication::screens()
Forum Updated to NodeBB v4.3 + New Features

Error data using QGuiApplication::screens()

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 403 Views 1 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.
  • J Offline
    J Offline
    JonexElectronic
    wrote on 8 May 2022, 19:21 last edited by
    #1

    Hello, I have 2 screens with different resolutions. I am trying to scale my multiscreen program after disconecting and conecting the same screen again. Before disconecting, this

    QList<QScreen *> pS=QGuiApplication::screens(); 
    

    returns to me 2 screens with the right resolution. But after disconecting and conecting the same

    QList<QScreen *> pS=QGuiApplication::screens();
    

    it returns to me 2 screens. The first one has the right resolution but the second one returns to me the maximum resolution that the first screen has. But no the resolution of the second display.

    Should I use any functions before asking for these data again?

    Any idea?
    Thanks

    J 1 Reply Last reply 9 May 2022, 02:19
    0
    • J JonexElectronic
      8 May 2022, 19:21

      Hello, I have 2 screens with different resolutions. I am trying to scale my multiscreen program after disconecting and conecting the same screen again. Before disconecting, this

      QList<QScreen *> pS=QGuiApplication::screens(); 
      

      returns to me 2 screens with the right resolution. But after disconecting and conecting the same

      QList<QScreen *> pS=QGuiApplication::screens();
      

      it returns to me 2 screens. The first one has the right resolution but the second one returns to me the maximum resolution that the first screen has. But no the resolution of the second display.

      Should I use any functions before asking for these data again?

      Any idea?
      Thanks

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 9 May 2022, 02:19 last edited by
      #2

      @JonexElectronic said in Error data using QGuiApplication::screens():

      But after disconecting and conecting the same

      QList<QScreen *> pS=QGuiApplication::screens();
      

      it returns to me 2 screens. The first one has the right resolution but the second one returns to me the maximum resolution that the first screen has. But no the resolution of the second display.

      Should I use any functions before asking for these data again?

      This sounds like a bug to me.

      Does your application emit the screenRemoved() signal when you disconnect the screen? (https://doc.qt.io/qt-5/qguiapplication.html#screenRemoved ) And similarly, does it emit the screenAdded() signal when you re-connect the screen?

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      J 1 Reply Last reply 9 May 2022, 07:29
      0
      • J JKSH
        9 May 2022, 02:19

        @JonexElectronic said in Error data using QGuiApplication::screens():

        But after disconecting and conecting the same

        QList<QScreen *> pS=QGuiApplication::screens();
        

        it returns to me 2 screens. The first one has the right resolution but the second one returns to me the maximum resolution that the first screen has. But no the resolution of the second display.

        Should I use any functions before asking for these data again?

        This sounds like a bug to me.

        Does your application emit the screenRemoved() signal when you disconnect the screen? (https://doc.qt.io/qt-5/qguiapplication.html#screenRemoved ) And similarly, does it emit the screenAdded() signal when you re-connect the screen?

        J Offline
        J Offline
        JonexElectronic
        wrote on 9 May 2022, 07:29 last edited by
        #3

        @JKSH Yes, both signals are emited.

        J 1 Reply Last reply 9 May 2022, 07:38
        0
        • J JonexElectronic
          9 May 2022, 07:29

          @JKSH Yes, both signals are emited.

          J Offline
          J Offline
          JKSH
          Moderators
          wrote on 9 May 2022, 07:38 last edited by
          #4

          @JonexElectronic said in Error data using QGuiApplication::screens():

          Yes, both signals are emited.

          OK, I suggest opening a bug report at https://bugreports.qt.io/. Please describe what you told us here (including the fact that screenRemoved() gets emitted but the screens() function still returns the wrong list), and also include your Qt version and OS version.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0

          4/4

          9 May 2022, 07:38

          • Login

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