QML Desktop Components weird Menu ...
Code:
import QtQuick 1.1
import QtDesktop 0.1
Window {
width: 600
height: 400
MenuBar{
Menu {
text: "It does"
MenuItem {
text:"not appear!!"
}
}
}
Window{
id: window1
width: 600
height: 400
MenuBar{
Menu {
text: "But it"
MenuItem {
text:"does!!"
}
}
}
ToolBar {
ToolButton {
text: "Play"
anchors.verticalCenter: parent.verticalCenter
onClicked: window1.visible = !window1.visible
}
}
}
ToolBar {
id: toolbar
anchors.right: parent.right
anchors.left: parent.left
ToolButton {
id: toolPlay
text: "Play"
anchors.left: toolDownload.right
anchors.verticalCenter: parent.verticalCenter
onClicked: window1.visible = !window1.visible
}
}
}
Anyone knows why menu in main windows does not appear, but menu in child window magically appears?
I'm totally confused with this behavior.
Re: QML Desktop Components weird Menu ...
Does it appear if you completely remove the child window?
Re: QML Desktop Components weird Menu ...
No, it doesn't.
I don't want to use child window, but only there menubar appears ....
Re: QML Desktop Components weird Menu ...
Which platform are you using?
Re: QML Desktop Components weird Menu ...
Re: QML Desktop Components weird Menu ...
Set the "visible" property of the window object to "true".
Re: QML Desktop Components weird Menu ...
Code:
Window {
width: 600
height: 400
visible: true
MenuBar{
Menu {
text: "File"
MenuItem {
text:"file"
}
}
}
Window{
id: window1
width: 600
height: 400
MenuBar{
Then child window appears immediately, but still menu appears in the middle of nowhere.
Re: QML Desktop Components weird Menu ...
This code works just fine:
Code:
import QtQuick 1.1
import QtDesktop 0.1
Window {
width: 600
height: 400
visible: true
MenuBar{
Menu {
text: "It does"
MenuItem {
text:"not appear!!"
}
}
}
}
Re: QML Desktop Components weird Menu ...
But then two windows appears.
Maybe it's something wrong with my c++ launcher.
Code:
#include <QApplication>
#include "qmlapplicationviewer.h"
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer.showExpanded();
return app->exec();
}
Re: QML Desktop Components weird Menu ...
One window is your viewer, another is the window created by "Window". If you don't want the viewer then use QDeclarativeEngine or don't show the viewer.