Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Wrong window size and coordinates mapping using QML(QQuickView) on Windows 8 (Acer ICONIA W700) with Intel HD Graphics 4000
Forum Updated to NodeBB v4.3 + New Features

Wrong window size and coordinates mapping using QML(QQuickView) on Windows 8 (Acer ICONIA W700) with Intel HD Graphics 4000

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 3 Posters 4.2k 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.
  • M Offline
    M Offline
    maxus
    wrote on last edited by
    #1

    I have a problem with QML/Qt detecting incorrect screen resolution of Acer W700 (Windows 8) with Intel HD Graphics 4000 (I've tried different versions of the video driver with the same result), while using Qt 5.0.1 for Windows 32-bit (VS 2010).

    The actual screen resolution is 1920x1080, while the following code outputs 1536x864:

    @
    // main.cpp
    #include <QGuiApplication>
    #include <QtQuick/QQuickView>

    int main(int argc, char **argv)
    {
    QGuiApplication app(argc, argv);

    QQuickView view;
    view.setSource(QUrl("qrc:///main.qml"));
    view.setResizeMode( QQuickView::SizeRootObjectToView );
    
    view.showFullScreen();
    
    return app.exec&#40;&#41;;
    

    }
    @

    @
    // main.qml
    import QtQuick 2.0

    Rectangle {
    id: mainRect
    Text {
    id: thisText
    anchors.fill: parent
    font.pointSize: 30
    font.family: "Helvetica"
    horizontalAlignment: Text.AlignHCenter
    verticalAlignment: Text.AlignVCenter
    text: parseInt( mainRect.width ) + "x" + parseInt( mainRect.height )
    }
    }
    @

    The Rectangle actually fills the entire screen and if I draw anything inside it gets properly anchored (everything is drawn properly if I use relative sizes to mainRect).

    Since relative drawing works ok, I would be fine with it, but when I use touch interface the coordinates are reported in the correct resolution scale i.e. x: 0..1920; y: 0..1080, this breaks all the code related to touch, especially properties like pressed(). What is more confusing, if I use MouseArea, coordinates are being translated to this incorrect 1536x864 space.

    I though at first that my touch screen drivers are broken, but it looks like Qt itself has a defect. Same code works perfectly fine on Windows 7 with NVidia GeForce GT 610 and NVidia GeForce 310.70 drivers, reporting correct screen resolution.

    I was wondering if anyone had similar problems and are there any workarounds for this issue? Or maybe I missed something fundamental about mapping screen resolution and internal widget size?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      maxus
      wrote on last edited by
      #2

      After further investigation, it seems that something more fundamental got broken/changed during transition from Qt 4.8.4 to Qt 5.0.1. The same code for full screen behaves in a similar way if I use QWidget and QApplication classes, so the problem is not Qt Quick / QML specific, moreover I don't have this issue in Qt 4.8.4, only 5.0.1 is affected.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        chrisadams
        wrote on last edited by
        #3

        Please file a bug. This is an area I know nothing about, unfortunately.

        Cheers,
        Chris.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          maxus
          wrote on last edited by
          #4

          [quote author="chrisadams" date="1362959588"]Please file a bug. This is an area I know nothing about, unfortunately.[/quote]

          I have already submitted one: "QTBUG-30063":https://bugreports.qt-project.org/browse/QTBUG-30063
          As for now the status is still "Not Evaluated". I hope I used a proper bug tracker.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            chrisadams
            wrote on last edited by
            #5

            Thanks.

            Yes, that's the correct bug tracker.

            Cheers,
            Chris.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sl.sy.ifm
              wrote on last edited by
              #6

              when I see this it reminds me a bit on the "device-pixel-ratio" magic that current smart-phones are using when displaying web-content ... maybe Qt5 is using some similar "logical resolution" thing

              ... at least there seems to be a bigger change behind the "QDesktopWidget::screenGeometry()" API (Qt5 replaced a lot of the platform specific magic with more streamlined QPA-code)

              I first thought QScreen(Qt5) might give some more physical vs. logical information, but on a 2nd look there is not really such a separation ...

              1 Reply Last reply
              0
              • M Offline
                M Offline
                maxus
                wrote on last edited by
                #7

                It turns our that Qt 5.0.1 was not calling SetProcessDPIAware function before the initialization. More details are "here":https://bugreports.qt-project.org/browse/QTBUG-30063?focusedCommentId=198569&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-198569 and "here":http://qt-project.org/forums/viewthread/25605/#118658

                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