Solved Why FullHD is not FullHD in Boot2Qt (Apalis iMX8)?
-
Hello.
I am using Toradex Apalis iMX8 SOM on Apalis Evaluation Board. I connected FullHD display using HDMI->DVI adapter to evaluation board. I set the jumper for I2C to read EDID from display. Monitor show that resolution is 1920x1080@60.
I use Boot2Qt 5.14.1 image downloaded from my Qt account page.Now I note that very simple QML program show that resolution is 960x540 instead of 1920x1080. What should I do to set correct resolution?
import QtQuick 2.14 import QtQuick.Window 2.14 Window { visible: true width: 1920 height: 1080 title: qsTr("Hello World") Row { id: mainScreen anchors.fill: parent Rectangle { id: control width: 100 height: parent.height border { color: "black" width: 1 } Text { width: parent.width horizontalAlignment: Text.AlignHCenter font.pointSize: 8 font.bold: true text: "Control" } } Rectangle { id: plot width: 860 // on Desktop, second rectangle fill the rest of screen with value of 1820, but in Apalis iMX8 second rectangle is fully shown with 860 height: parent.height border { color: "red" width: 1 } Text { width: parent.width horizontalAlignment: Text.AlignHCenter font.pointSize: 10 font.bold: true text: "Plot" } } } }
-
I discover that problem is in default template from wizard while I create new QML Quick Application (main.cpp file).
#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) { qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213")); qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120")); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); } QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }
If I remove first if block then resolution is OK.
-
I discover that problem is in default template from wizard while I create new QML Quick Application (main.cpp file).
#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) { qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213")); qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120")); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); } QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }
If I remove first if block then resolution is OK.