Problem with ApplicationWindow on QT Quick 2 Application
QML and Qt Quick
5
Posts
2
Posters
1.6k
Views
1
Watching
-
Hi everyone.
I have problem trying to use ApplicationWindow.
@import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480menuBar: MenuBar { Menu { title: qsTr("File") MenuItem { text: qsTr("Exit") onTriggered: Qt.quit(); } } } Button { text: qsTr("Hello World") anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter }}@
When i use Rectlange instead of ApplicationWindow then everythig is ok, but i need a ApplicationWindow for can adds convenience for positioning items.
Thanks.
-
It is listed on the overview page here:
http://doc-snapshot.qt-project.org/qt5-stable/qtquickcontrols/qtquickcontrols-overview.htmlYou have to use QmlApplicationEngine as the example shows