How can I remove borders from a Windows QML application
Question
This is similar to question 4799748, but I'd like to remove Windows borders from a QML application, so it starts up without minimise/maximise/close etc.
I guess I need to set the Window flags to Qt.CustomizeWindowHint, but I'm new to QML and can't see how to do that. The editor auto-completes the Qt.CustomizeWindowHint text, but I can't see how to apply that to the top level window.
Solution
You need to set the Qt::FramelessWindowHint
window flag. Since QDeclarativeView doesn't have a constructor accepting window flags you will have to set them after creating the view:
QDeclarativeView *viewer = new QDeclarativeView(0);
viewer->setWindowFlags(Qt::FramelessWindowHint);
viewer->setSource(QUrl::fromLocalFile("main.qml"));
viewer->show();
BTW, if you are using qmlviewer, you can pass -frameless
to remove the border from its window.
OTHER TIPS
Marko Frelih,
It's easy, just put flags: Qt.FramelessWindowHint
inside your ApplicationWindow QML code