anchors
, clip
, width
, height
, opacity
, x
, y
, rotation
, scale
, …import QtQuick 1.0 Item { width: 100 height: 100 }
width
and height
are properties.Item { width: 100; height: 100 }
radius
property to create rounded borders.import QtQuick 1.0 Rectangle { width: 100 height: 100 color: "red" border.color: "black" border.width: 5 radius: 10 }
anchors.fill: parent
line says that the Rectangle should fill its parent (i.e., the Item).import QtQuick 1.0 Item { width: 100 height: 100 Rectangle { anchors.fill: parent color: "red" border.color: "black" border.width: 5 radius: 10 } }
import QtQuick 1.0 Item { width: 300 height: 300 Image { x: 30 y: 40 source:"images/spaceship.png" } }
import QtQuick 1.0 Item { width: 300 height: 300 Image { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter source:"images/spaceship.png" } }
import QtQuick 1.0 Item { width: 100 height: 100 Text { text: "Hello World!" font.family: "Helvetica" font.pixelSize: 14 color: "blue" x: 0 y: 0 } }
import QtQuick 1.0 Item { width: 200 height: 100 Text { text: "Enter your name:" font.family: "Helvetica" font.pixelSize: 14 color: "blue" x: 0 y: 0 } TextInput { text: "Default Text" font.family: "Helvetica" font.pixelSize: 14 color: "red" x: 10 y: 20 focus: true } }
id
property.... Text { id: myMessage text: "Hello World!" font.family: "Helvetica" font.pixelSize: 14 color: "blue" x: 0 y: 0 } Image { id: spaceshipImage anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter source:"images/spaceship.png" } ...