Tuesday, October 8, 2013

QtQuick example: Image

Example to use Image:

QtQuick example: Image
QtQuick example: Image


import QtQuick 2.1
import QtQuick.Controls 1.0

ApplicationWindow {
    title: "Qteveloper (http://qteveloper.blogspot.com/)"
    width: 420
    height: 380

    menuBar: MenuBar {
        Menu {
            title: "Load Image"
            MenuItem {
                text: "image1"
                onTriggered: myImage.source = "http://goo.gl/kdbgF8"
            }
            MenuItem {
                text: "image2"
                onTriggered: myImage.source = "http://goo.gl/6n8lX7"
            }
            MenuItem {
                text: "no image"
                onTriggered: myImage.source = ""
            }
        }
    }

    Image{
        id: myImage
        anchors.centerIn: parent
        source: "http://goo.gl/kdbgF8"
    }

}