Switches.qml 2.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
import Qt 4.6

QFrame {
    styleSheetFile: "switch.css";
    property var specialModeIcon;
    specialModeIcon: "images/standard.png";
    maximumWidth: 286;
    minimumWidth: 286;
    layout: QHBoxLayout {
        topMargin: 4;
        bottomMargin: 0;
        leftMargin: 4;
        rightMargin: 80;
        spacing: 0;

        QPushButton {
            checkable: true;
            checked: true;
            id: standardMode;
            toolTip: "general item properties";
            iconFromFile: "images/rect-icon.png";
            onClicked: {
                extendedMode.checked = false;
                layoutMode.checked = false;
                specialMode.checked = false;
                checked = true;
                standardPane.visible = true;
                extendedPane.visible = false;
                layoutPane.visible = false;
                specialPane.visible = false;
            }
        }
        QPushButton {
            checkable: true;
            checked: false;
            id: specialMode;
            toolTip: "type specific properties";
            iconFromFile: specialModeIcon;
            onClicked: {
                extendedMode.checked = false;
                standardMode.checked = false;
                layoutMode.checked = false;
                checked = true;
                specialPane.visible = true;
                standardPane.visible = false;
                extendedPane.visible = false;
                layoutPane.visible = false;
            }
        }
        QPushButton {
            id: extendedMode;
            toolTip: "extended properties";
            checkable: true;
            checked: false;
            iconFromFile: "images/extended.png";
            onClicked: {
                standardMode.checked = false;
                layoutMode.checked = false;
                specialMode.checked = false;
                checked = true;
                standardPane.visible = false;
                extendedPane.visible = true;
                layoutPane.visible = false;
                specialPane.visible = false;
            }
        }
        QPushButton {
            id: layoutMode;
            checkable: true;
            checked: false;
            toolTip: "layout properties";
            iconFromFile: "images/layout.png";
            onClicked: {
                extendedMode.checked = false;
                standardMode.checked = false;
                specialMode.checked = false;
                checked = true;
                standardPane.visible = false;
                extendedPane.visible = false;
                layoutPane.visible = true;
                specialPane.visible = false;
            }
        }
    }
}