Fullscreen Window

301 views
Skip to first unread message

Arnold Angerer

unread,
Jan 6, 2015, 5:59:38 PM1/6/15
to go-...@googlegroups.com
Hi, 

I'm having problems showing my qml window in fullscreen mode.
The cpp/qml version works fine (Qt 5.4).

My golang attempt doesn't seem resize the window correctly. Is there any other way to show fullscreen window?

import QtQuick 2.3
import QtQuick.Window 2.2


Window {
        id: mainwindow

        Component.onCompleted: {
            mainwindow.visibility = Window.FullScreen;
            ticker.text = "ready..."
        }
        Text {
                id: ticker
                color: "black"
                anchors.centerIn: parent
        }
}




Arnold Angerer

unread,
Jan 7, 2015, 7:41:24 AM1/7/15
to go-...@googlegroups.com
Hmm, here's a workaround, not quite sure why it's working - but it's working ;)
It seems that I cannot resize the window in the Component.onComplete handler. 

I've added a timer that triggers the change after 1 millisecond:

Timer {
interval: 1
repeat: false
running: true
onTriggered: {
mainwindow.visibility = Window.FullScreen;
}
}

Djahma

unread,
Jan 7, 2015, 1:18:10 PM1/7/15
to go-...@googlegroups.com
I believe I experienced a similarly odd behaviour, and as far as I can recall the matter, it was due to Component.onCompleted being triggered upon instantiation of the object, therefore before the object is made visible.
As for workaround, maybe try to set visibility property in the Window definition rather than in onCompleted. Another way might be for onCompleted to call a function to set the visibility: the idea is in the race between onCompleted and the rendering engine, setting a function would trigger processing time to be allocated to the engine at the expense of the visibility function which would wait for its turn, so that when the engine is done, the Window is displayed.
But maybe all this is just shit talking...I haven't tried it before writing these lines:-)

Gustavo Niemeyer

unread,
Jan 7, 2015, 1:55:44 PM1/7/15
to Arnold Angerer, go-...@googlegroups.com

You can show the window directly as full screen. This issue details the method:


We should probably have something more obvious/convenient in the API itself as well.


--
You received this message because you are subscribed to the Google Groups "go-qml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-qml+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arnold Angerer

unread,
Jan 7, 2015, 3:09:08 PM1/7/15
to go-...@googlegroups.com
@Djahma: 
Setting the visibility property directly doesn't work, the property conflicts with the visible property.

@Gustavo: 
Calling the slot via Call works like a charm. I hadn't realized one could call public slots this way. 
Thanks for your work on go-qml. What a great project :)




















On Tuesday, January 6, 2015 11:59:38 PM UTC+1, Arnold Angerer wrote:
Reply all
Reply to author
Forward
0 new messages