BasicSteps 3: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
===Categories:===
[[Category:Developing_with_Qt::Qt Quick::Tutorial]]


* [[:Category:Developing with Qt|Developing_with_Qt]]
<code>
** [[:Category:Developing with Qt::Qt Quick|Qt_Quick]]
 
* [[:Category:Developing with Qt::Qt Quick::Tutorial|Tutorial]]
// File: BasicSteps_3.qml<br />// NOTE: For the three images voringsfossen1.jpg, bergen.jpg and cotton_grass.jpg,<br />// you can take any image in JPEG format with the size 280x210 pixels.<br />import QtQuick 1.0
 
Rectangle {<br /> width: 3 * 300; height: 300
 
// Photo 1<br /> Rectangle {<br /> x: 0; y: 0<br /> width: 300; height: 300<br /> color: &quot;#FFF8DC&amp;quot; // cornsilk
 
Image {<br /> x: 10; y: 25<br /> source: &quot;voringsfossen1.jpg&amp;quot;<br /> }
 
Text {<br /> x: 0; y: 235<br /> text: &quot;Voringsfossen&amp;quot;<br /> font.pixelSize: 20<br /> width: 300; horizontalAlignment: Text.AlignHCenter<br /> height: 65; verticalAlignment: Text.AlignVCenter<br /> }<br /> }
 
// Photo 2<br /> Rectangle {<br /> x: 300; y: 0<br /> width: 300; height: 300<br /> color: &quot;#FFF8DC&amp;quot; // cornsilk
 
Image {<br /> x: 10; y: 25<br /> source: &quot;bergen.jpg&amp;quot;<br /> }
 
Text {<br /> x: 0; y: 235<br /> text: &quot;Bergen&amp;quot;<br /> font.pixelSize: 20<br /> width: 300; horizontalAlignment: Text.AlignHCenter<br /> height: 65; verticalAlignment: Text.AlignVCenter<br /> }<br /> }
 
// Photo 3<br /> Rectangle {<br /> x: 2 * 300; y: 0<br /> width: 300; height: 300<br /> color: &quot;#FFF8DC&amp;quot; // cornsilk
 
Image {<br /> x: 10; y: 25<br /> source: &quot;cotton_grass.jpg&amp;quot;<br /> }
 
Text {<br /> x: 0; y: 235<br /> text: &quot;Cotton Grass&amp;quot;<br /> font.pixelSize: 20<br /> width: 300; horizontalAlignment: Text.AlignHCenter<br /> height: 65; verticalAlignment: Text.AlignVCenter<br /> }<br /> }<br />}

Revision as of 10:20, 24 February 2015


// File: BasicSteps_3.qml
// NOTE: For the three images voringsfossen1.jpg, bergen.jpg and cotton_grass.jpg,
// you can take any image in JPEG format with the size 280x210 pixels.
import QtQuick 1.0

Rectangle {
width: 3 * 300; height: 300

// Photo 1
Rectangle {
x: 0; y: 0
width: 300; height: 300
color: "#FFF8DC&quot; // cornsilk

Image {
x: 10; y: 25
source: "voringsfossen1.jpg&quot;
}

Text {
x: 0; y: 235
text: "Voringsfossen&quot;
font.pixelSize: 20
width: 300; horizontalAlignment: Text.AlignHCenter
height: 65; verticalAlignment: Text.AlignVCenter
}
}

// Photo 2
Rectangle {
x: 300; y: 0
width: 300; height: 300
color: "#FFF8DC&quot; // cornsilk

Image {
x: 10; y: 25
source: "bergen.jpg&quot;
}

Text {
x: 0; y: 235
text: "Bergen&quot;
font.pixelSize: 20
width: 300; horizontalAlignment: Text.AlignHCenter
height: 65; verticalAlignment: Text.AlignVCenter
}
}

// Photo 3
Rectangle {
x: 2 * 300; y: 0
width: 300; height: 300
color: "#FFF8DC&quot; // cornsilk

Image {
x: 10; y: 25
source: "cotton_grass.jpg&quot;
}

Text {
x: 0; y: 235
text: "Cotton Grass&quot;
font.pixelSize: 20
width: 300; horizontalAlignment: Text.AlignHCenter
height: 65; verticalAlignment: Text.AlignVCenter
}
}
}