Windows 10 System sleep mode QML Ui Not redraw
-
Hi I came across this strange symptom while using qt 5.12.6 on window10.
I set the Qt timer to 1 minute 10 seconds and show dialog window UI after 1 minute 10 seconds.
But when the Qt timer is triggered while the window 10 system is sleeping, can't redraw.
this qt bug?The image below is the image in question. ui not redraw...
source code
==============main.cpp================
#include <QGuiApplication>
#include <QQmlApplicationEngine>int main(int argc, char *argv[])
{
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();
}=====main.qml======
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQml 2.12
import QtQuick.Controls 1.4Window {
visible: true
width: 640
height: 480
//flags: Qt.Desktop
title: qsTr("Hello World")Test1 {
id: test1
}Button {
id:test
width: 100
height: 100
onClicked: {
test1.show()
}
}
Timer {
id: timer
interval: 70000
repeat: false
triggeredOnStart: false
running: true
onTriggered: {
console.log("Triggered")
test1.show()
}
}
}=====Test1.qml======
import QtQml 2.12
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 1.4Window {
visible: false
width: 400
height: 300
flags: Qt.Window
title: qsTr("Hello World222")
color: "red"Button {
id:test
width: 100
text: "g2"
height: 100
}
}