3

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.

rolinger
  • 665
  • 7
  • 17

3 Answers3

17

Marko Frelih,

It's easy, just put flags: Qt.FramelessWindowHint inside your ApplicationWindow QML code

Vinícius A. Jorge
  • 731
  • 1
  • 6
  • 9
7

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.

MartinJ
  • 1,656
  • 9
  • 8
  • 1
    Is it possible to achieve this with pure QML code, i.e. from QML file directly, without C++ side "intervention"? – KernelPanic Sep 04 '15 at 12:10
2

Use flags: Qt.WindowFullScreen it works .

Other options:

flags : Qt::WindowFlags

ketan
  • 19,129
  • 42
  • 60
  • 98
anil valmiki
  • 181
  • 1
  • 11
  • @ketan, can you please answer below question, http://stackoverflow.com/questions/36639380/artificial-emboldening-of-bold-fails-for-some-characters-in-qt-5-2-1 – anil valmiki Apr 22 '16 at 03:40