Sunday, October 6, 2013

QtQuick Controls example: GroupBox

GroupBox provides a frame, a title on top and displays various other controls inside itself. Group boxes can also be checkable.

GroupBox example
GroupBox example


import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0
import QtQuick.Layouts 1.0

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

    ColumnLayout{

        GroupBox {
            id: groupBoxA
            title: "GroupBox A"
            Layout.fillWidth: true
            Image {
                source: "http://goo.gl/kdbgF8"
            }
        }

        GroupBox {
            id: groupBoxB
            title: "GroupBox B"
            Layout.fillWidth: true
            checkable: true

            ColumnLayout {
                anchors.fill: parent
                Label { text: "Label 1" }
                Label { text: "Label 2" }
                Label { text: "Label 3" }
            }
        }

    }

}