How to create two non-classical windows in qml?
-
hi. i created a new QtQuick project. now, in main.qml file i made a window, for istance:
Rectangle{ width: 200; height: 100; ... }
how do i create another window, separated from the last one? how do i delete the "x" (close), the "_" to minimize and the other one from the window?
-
I am quite a newbie, but I think that Rectangle will draw a Rectangle, not a window. the window is created in your main.c file, if you have one! The main window often (and maybe always) is a QDeclarativeView.
So to get rid of the system controls (X and _ thing), you can play with the windows style flags, or hints.
I personnally used this in my main.c file:@QDeclarativeView view;
view.setWindowFlags(Qt::FramelessWindowHint);@And with these lines I have no window border and therefore no window system controls.
Hope this helps a bit,
Bill -
[code]#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include <QLabel>int main(int argc, char *argv[])
{
QApplication app(argc, argv);QmlApplicationViewer viewer; viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); viewer.setMainQmlFile(QLatin1String("qml/file/main.qml")); viewer.showExpanded(); viewer.setWindowTitle("title"); viewer.move(600,20); QDeclarativeView view; view.setWindowFlags(Qt::FramelessWindowHint); return app.exec();
}
[/code]
this one does not start...