从Qt5.1版本开始,QtQuick.Controls 1.0模块就需要启动QQmlApplicationEngine。该类自动加载qml-文件和安装视图.但我可以将t found how to applyQt::WindowFlags`‘转到该视图。有人能帮忙吗?
发布于 2013-08-13 16:54:43
您可以使用属性flags设置标志,例如:
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0
ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
flags: Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint
Button {
text: qsTr("Hello World")
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}当然,您可以使用QtQuick 2.0以及模块Controls和Window,而无需自动加载QML文件。我是通过使用QQuickView,特别是setSource()方法来实现的
https://stackoverflow.com/questions/18212895
复制相似问题