Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QtQuick wrong Device Pixel Ratio (DPR) when using multiple screens with different DPR

    General and Desktop
    screen device p
    3
    14
    2006
    Loading More Posts
    • 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
      bdg85 last edited by bdg85

      Hi,

      I have a retina mac book pro connected with a bigger screen:
      Screen1: LCD (retina, devicePixelRatio=2) 1280x800 (in device points)
      Screen2: LED Cinema Display (non retina, devicePixelRatio=1) 1920x1200

      The problem is this:
      If my QtQuick main window starts in Screen2, it detects the wrong screen (Screen1). Therefore, if I drag the window to Screen1, no signal is raised that the monitor is changed. This prevents me to update my OpenGL renderer with the new devicePixelRatio.

      I have written a simple test application in QML to show this:


      import QtQuick 2.4
      import QtQuick.Controls 1.3
      import QtQuick.Window 2.2
      
      ApplicationWindow {
          id: appWin
          title: qsTr("Hello World")
          width: 440
          height: 320
          visible: true
      
          Screen.onDevicePixelRatioChanged: {
              console.log("dpr changed");
              dprSignalId.text = "dpr changed at seconds: " + new Date().getSeconds();
          }
      
          Column{
             Text{
                 id: screenTextId
                 text: Screen.name + " " + Screen.devicePixelRatio + " " + Screen.width + "x" + Screen.height
             }
             Text{
                 id: dprSignalId
             }
          }
      }
      

      B 1 Reply Last reply Reply Quote 0
      • B
        bdg85 @bdg85 last edited by

        Anyone?

        Just ask if the question was unclear: I may add further details.

        mrjj 1 Reply Last reply Reply Quote 0
        • mrjj
          mrjj Lifetime Qt Champion @bdg85 last edited by

          @bdg85

          Your question is very clear. ( and i dont even know quick)

          Im just wondering if you would have better luck in the QT Quick group
          as what I have seen here is mostly c++

          1 Reply Last reply Reply Quote 0
          • B
            bdg85 last edited by

            Thank you for the advice!
            I'll post there straight away.

            Feel free to remove this one for cross-posting issues.

            mrjj 1 Reply Last reply Reply Quote 0
            • mrjj
              mrjj Lifetime Qt Champion @bdg85 last edited by

              @bdg85
              Well unlike other forums
              cross-posting is not really frown upon here :)

              Good luck

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                @mrjj well… It depends ;) Asking to move the post to a better suited sub-forum is the usual thing to do

                @bdg85 Did you check the bug report system ? IIRC, there was something about that (but I can't be 100% positive)

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

                mrjj 1 Reply Last reply Reply Quote 0
                • mrjj
                  mrjj Lifetime Qt Champion @SGaist last edited by

                  @SGaist Oh - my bad- ok, And my move, you mean delete and post again. I assume.

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    No no, you can ask an moderator or admin to do that

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

                    mrjj 1 Reply Last reply Reply Quote 0
                    • mrjj
                      mrjj Lifetime Qt Champion @SGaist last edited by

                      @SGaist Aha, and you are a moderator or how would i spot one?

                      1 Reply Last reply Reply Quote 0
                      • SGaist
                        SGaist Lifetime Qt Champion last edited by

                        I looks like currently there's no easy way like a badge for that, would be nice though. Yes I am

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

                        mrjj 1 Reply Last reply Reply Quote 0
                        • mrjj
                          mrjj Lifetime Qt Champion @SGaist last edited by

                          @SGaist
                          Oh ok, so the flag icon is not for that. ? So say i had a post that needed moving. Would I then message you or post a "please move" or how would one go about it ? Maybe this not the right place to ask. just wondering.

                          1 Reply Last reply Reply Quote 0
                          • SGaist
                            SGaist Lifetime Qt Champion last edited by

                            The flag is to tell moderator that there might be something fishy with a post/thread like content unrelated to Qt, spam etc. and they should look at it.

                            To move a thread, you would start a chat with a moderator to ask to move your thread when you see it's not in the right section.

                            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 Reply Quote 0
                            • mrjj
                              mrjj Lifetime Qt Champion last edited by

                              Is there any way to see from profile if they are a mod/admin ?
                              thank you for the clarification.

                              1 Reply Last reply Reply Quote 0
                              • SGaist
                                SGaist Lifetime Qt Champion last edited by

                                Currently it doesn't seem so

                                You're welcome

                                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 Reply Quote 0
                                • First post
                                  Last post