我有 Debian Bullseye,带有集成显卡的 Intel Celeron J1800。Qt 来自 Debian 版本 5.12.5
试图将屏幕旋转到纵向模式。
QT_QPA_EGLFS_ROTATION=90 /opt/app/bin/app
但是窗口只是调整了大小,放大了大约 120%。
我的代码
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.addImportPath("qrc:/");
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();
}
和 QML
ApplicationWindow {
id: window
visible: true
flags: Qt.FramelessWindowHint
StackView { ... }
}
QWebEngineView 和小部件运行良好