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 391 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 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

    JKSHJ 1 Reply Last reply
    0
    • J JonexElectronic

      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

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on 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
      0
      • JKSHJ JKSH

        @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 last edited by
        #3

        @JKSH Yes, both signals are emited.

        JKSHJ 1 Reply Last reply
        0
        • J JonexElectronic

          @JKSH Yes, both signals are emited.

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on 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

          • Login

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