QQuickView in fullscreen
-
Hi everyone,
I was looking for a way to implement fullscreen support such as the fullscreen button on OSX as well as on Windows but I didn't find any good answer so I was wondering if anyone knows a way to simply add the fullscreen button in a QQuickView ?
Thanks
-
Set Qt::WindowFullscreenButtonHint on the window (the QQuickView).
-
As a flag ?
-
Tried it and it works, thanks :)
However, how can I make my root qml resize so it takes the whole screen ? right now it keeps the same size as before going to fullscreen. -
Try changing to SizeRootObjectToView: http://qt-project.org/doc/qt-5.0/qtquick/qquickview.html#resizeMode-prop
-
-Since i remember SizeRootObjectToView will still not be fullscreen except you set the width and height of the top-level object to your full-screen resolution.-
Nevermind, found out that it'll resize the top-level object.
bq. If this property is set to SizeRootObjectToView, the view will automatically resize the root item to the size of the view.
-
It is set to this property but does not seems to work , i'll try to look harder into that , it might be because I have a minimum size
-
Just set your qml-resoultion to your screen-resolution and set the flag for your viewer to Qt::FramelessWindowHint.
-
In Qt 5.3 the QQuickView has a showFullScreen method that to what the name suggest without setting any special flag.
Of course, you still need to resize your root object correctly or let the QQuickView resize it for you specifying SizeRootObjectToView
It works on Windows and Mac.