Commit 96b5c37c authored by Ganesh Katrapati's avatar Ganesh Katrapati
Browse files

Liquids

parent bf645380
......@@ -9,7 +9,7 @@ int main(int argc, char *argv[])
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/Example1/main.qml"));
viewer.setMaximumSize(QSize(500,500));
viewer.setMaximumSize(QSize(540,500));
viewer.setPosition(QPoint(500,100));
viewer.showExpanded();
......
import QtQuick 2.0
ListModel {
id : liquid_list
ListElement {
name: "Water"
lcolor : "blue"
}
ListElement {
name : "Petrol"
lcolor : "black"
}
ListElement {
name : "Corn S"
lcolor : "yellow"
}
ListElement {
name : "Oil"
lcolor : "brown"
}
}
......@@ -76,6 +76,15 @@ Rectangle {
height: 218
opacity: 0.22
source: "beaker.png"
Rectangle {
id : beakerArea
x: 36
y: 79
width: 117
height: 127
}
}
GridView {
......@@ -225,6 +234,47 @@ Rectangle {
font.pixelSize: 12
}
GridView {
id: grid_view1
x: 436
y: 168
width: 51
height: 267
cellWidth: 70
model: Qt.createComponent("liquids.qml").createObject(null)
delegate: Item {
x: 5
height: 50
Column {
spacing: 5
Rectangle {
id : ltype
width: 40
height: 40
color: lcolor
anchors.horizontalCenter: parent.horizontalCenter
signal selected()
MouseArea {
anchors.fill: parent
onClicked: ltype.selected()
}
onSelected: {
namerecttext.text = "You selected " + name
beakerArea.color = lcolor
}
}
Text {
x: 5
text: name
font.bold: true
anchors.horizontalCenter: parent.horizontalCenter
}
}
}
cellHeight: 70
}
states : [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment