qmlFrontend/qml/qmlFrontend/main.qml
author unc0rr
Mon, 22 Sep 2014 02:10:39 +0400
branchqmlfrontend
changeset 10420 02c573d19224
parent 10402 3313336c1ee0
child 10422 4cf23d4c7624
permissions -rw-r--r--
flib: - Ability to pass raw data via IPC qmlfrontend: - Pass message received by callback through event loop to handle it in main thread - Get preview image from engine on button click and render it in Image object

import QtQuick 2.0
import Hedgewars.Engine 1.0

Rectangle {
    width: 400
    height: 400

    HWButton {
        id: hwbutton1
        x: 8
        y: 66
        width: 166
        height: 158

        onClicked: {
            HWEngine.run()
        }

        Connections {
            target: HWEngine
            onPreviewImageChanged: previewImage.source = "image://preview/1"
        }
    }

    HWButton {
        id: hwbutton2
        x: 192
        y: 66
        width: 200
        height: 139
    }

    Image {
        id: previewImage
        x: 70
        y: 250
        width: 256
        height: 128
        cache: false
    }
}