Hi all,
Just checked out qt51rc1.
I tried to use qqmlapplicationengine to show a qml file. It seems the application runs silently without showing anything.
I did it very simple:
in c++
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
// QtQuick2ApplicationViewer viewer;
// viewer.setMainQmlFile(QStringLiteral(“qml/QMLApplication/main2.qml”));
// viewer.showExpanded();
QQmlApplicationEngine engine(“qml/QMLApplication/main2.qml”);
return app.exec();
}
I qml:
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0
Rectangle
{
width: 640
height: 480
Button {
text: qsTr(“Hello World”)
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
If I use the commented out viewer it works.
But Id like to use an ApplicationWindow instead of a Rectangle as root item.
Am I missing something or is this just a bug in qt5.1?
Cheers and thx to everyone
↧