环境
系统:Windows10 64位 家庭中文版
Qt版本:5.6.0 msvc2013 64位
编译器:Visual Studio 2013 专业版
现象
QML程序在启动时,有一瞬间明显的黑屏。
触发条件
1.全屏显示;
2.程序的flags包含Qt.FramelessWindowHint。
根本原因
不详
解决方法
设置程序的显示大小,不要刚好等于屏幕大小。
测试代码
由于现在取消了0积分的资源,我直接把关键的测试代码贴上来,有问题请留言:
import QtQuick 2.6
import QtQuick.Window 2.2
Window {
visible: true
//宽或高加减一个不等于0的数,即可去除。
width: Screen.width + 1;
height: Screen.height;
flags: Qt.FramelessWindowHint
Text {
id: text;
text: qsTr("text");
width: parent.width;
height: parent.height;
}
}