Ubuntu Pastebin

Paste from DanChapman at Wed, 6 Apr 2016 13:10:32 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
import QtQuick.Window 2.0

property string windowTitle: "My New Title"

property bool windowReady: typeof window != 'undefined'
onWindowReadyChanged: {
    // Setup a connection to QWindow::onWindowTitleChanged
    // because MainView.AppHeader might override this custom
    // title as it's no completed yet. This way we can be sure to flip it back to 
    // the correct value. This is super ugly!!!
    windowConnection.target = window
    window.title = windowTitle
}

Connections {
    id: windowConnection
    onWindowTitleChanged: {
        if (title !== windowTitle) {
            window.title = windowTitle
        }
    }
}
Download as text