Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

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

$
0
0
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 1920×1080, while the following code outputs 1536×864: // 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(); } // 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 1536×864 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?

Viewing all articles
Browse latest Browse all 4972

Trending Articles