SlideShare a Scribd company logo
1 of 60
Download to read offline
Qt For Beginners - Part 3
QML and Qt Quick
Eric Magnuson, Qt Consultant
Integrated Computer Solutions
Visit us at http://www.ics.com
Watch the video: http://bit.ly/qt-beginners-qml-quick
Copyright 2016, Integrated Computers Solutions, Inc.
This work may not be reproduced in whole or in part without the express written consent of
Integrated Computer Solutions, Inc.
1
● Introduction
● Qt Quick Hello World
● QML Concepts
● Composing User Interfaces
● Nested Elements
● Graphical Types
● Text Items
Agenda
2
● Anchor Layout
● QML Components
● Qt Quick Controls
● Mouse Input
● Touch Input
● Keyboard Input
● Q&A
Agenda (continued)
3
● Introduction
● Qt Quick Hello World
● QML Concepts
● Composing User Interfaces
● Nested Elements
● Graphical Types
● Text Items
Agenda
4
What is QML?
Declarative language for User Interface structure
● Describes the user interface
β—‹ What items look like
β—‹ How items behave
● UI specified as tree of QML structures with properties
β—‹ Elements and identities
β—‹ Properties and property binding
5
● Introduction
● Qt Quick Hello World
● QML Concepts
● Composing User Interfaces
● Nested Elements
● Graphical Types
● Text Items
Agenda
6
// Simple QML example
import QtQuick 2.6
Rectangle {
width: 200
height: 200
Text {
anchors.centerIn: parent
font.pixelSize: 18
text: "Hello, world!"
}
MouseArea {
anchors.fill: parent
onClicked: {
Qt.quit()
}
}
}
Qt Quick Hello World
7
● Introduction
● Qt Quick Hello World
● QML Concepts
● Composing User Interfaces
● Nested Elements
● Graphical Types
● Text Items
Agenda
8
Properties
Objects are described by properties
● Simple name-value definitions
β—‹ width, height, color, ...
β—‹ With default values
β—‹ Each has a well-defined type
β—‹ Separated by semicolons or line breaks
● Used for
β—‹ Customizing their appearance
β—‹ Changing their behavior
9
Types of Properties
● Standard properties can be given values:
Text {
text: "Hello world"
height: 50
}
● Grouped properties keep related properties together
Text {
font.family: "Helvetica"
font.pixelSize: 24
}
● Attached properties are applied to QML structures
TextInput {
text: "Hello world"
KeyNavigation.tab: nextInput
}
β—‹ KeyNavigation.tab is not a standard property of TextInput
β—‹ Is a standard property that is attached to Items
● Custom properties can be added to any QML type
Rectangle {
property real mass: 100.0
}
10
Binding Properties
import QtQuick 2.0
Item {
width: 400; height: 200
Rectangle {
x: 100; y: 50
width: height * 2; height: 100
color: "lightblue"
}
}
● Properties can contain expressions
β—‹ See above: width is twice the height
● Not just initial assignments
● Expressions are re-evaluated when needed
11
Identifying QML Structures
The id defines an identity of a QML structure
● Lets other QML structures refer to it
β—‹ For relative alignment and positioning
β—‹ To access or modify an Item's properties
β—‹ To re-use common structures (e.g., gradients, images)
● Used to create relationships between structures
● id is not a property
β—‹ Not stored in the QObject with other properties
β—‹ More like a "label"
β—‹ A single Item can have different identities in other
files/scopes.
● parent is a special id referring to the relative
parent structure
12
Using Identities
Text {
id: title
x: 50; y: 25
text: "Qt Quick"
font.family: "Helvetica"
font.pixelSize: 50
}
Rectangle {
x: 50; y: 95; height: 5
width: title.width
color: "green"
}
● Text item has the identity, title
● width of Rectangle bound to width of title
● Try using TextInput instead of Text
13
Methods
● Most features are accessed via properties
● Methods are also used, to perform actions
β—‹ TextInput has a selectAll() method
β—‹ Timer has start(), stop() and restart() methods
β—‹ Particles has a burst() method
● All methods are public in QML
● Other methods are used to convert values between
types:
β—‹ Qt.formatDateTime(datetime, format)
β—‹ Qt.md5(data)
β—‹ Qt.tint(baseColor, tintColor)
14
Property values can have different types:
● Numbers (int and real): 400 and 1.5
● Boolean values: true and false
● Strings: "Hello Qt"
● Constants: AlignLeft
● Lists: [ ... ]
β—‹ Lists with one item can be written as just the item itself
● Scripts:
β—‹ Included directly in property definitions
● Other types:
β—‹ colors, dates, times, rects, points, sizes, 3D vectors, ...
β—‹ Usually created using constructors
Basic Types
15
● Introduction
● Qt Quick Hello World
● QML Concepts
● Composing User Interfaces
● Nested Elements
● Graphical Types
● Text Items
Agenda
16
Why use nested items, anchors and components?
● Concerns separation
● Visual grouping
● Pixel perfect items placing
and layout
● Encapsulation
● Reusability
● Look and feel changes
17
● Introduction
● Qt Quick Hello World
● QML Concepts
● Composing User Interfaces
● Nested Elements
● Graphical Types
● Text Items
Agenda
18
import QtQuick 2.0
Rectangle {
width: 400; height: 400
color: "lightblue"
Rectangle {
x: 50; y: 50; width: 300; height: 300
color: "green"
Rectangle {
x: 200; y: 150; width: 50; height: 50
color: "white"
}
}
}
● Each Item is positioned relative to its
parents
Nested Elements
19
● Introduction
● Qt Quick Hello World
● QML Concepts
● Composing User Interfaces
● Nested Elements
● Graphical Types
● Text Items
Agenda
20
Colors
● Specifying colors
β—‹ Named colors (using SVG names): "red", "green", "blue", …
β—‹ HTML style color components: "#ff0000", "#008000", "#0000ff", …
β—‹ Built-in function: Qt.rgba(0,0.5,0,1)
● Changing items opacity:
β—‹ Set opacity property between 0.0 (transparent) to 1.0 (opaque)
import QtQuick 2.0
Item {
width: 300; height: 100
Rectangle {
x: 0; y: 0; width: 100; height: 100; color: "#ff0000"
}
Rectangle {
x: 100; y: 0; width: 100; height: 100
color: Qt.rgba(0, 0.75, 0, 1)
}
Rectangle {
x: 200; y: 0; width: 100; height: 100; color: "blue"
}
}
21
Images
● Represented by the Image class
● Refer to image files with the source property
β—‹ Using absolute URLs or relative to the QML file
import QtQuick 2.0
Rectangle {
width: 400; height: 400
color: "black"
Image {
x: 150; y: 150
source: "../images/rocket.png"
}
}
β—‹ width and height are obtained from the image file
● Can be transformed
β—‹ Scaled, rotated
β—‹ About an axis or central point
22
Gradients
Define a gradient using the gradient property:
● As Gradient containing GradientStop values, each with
β—‹ A position: a number between 0 (start point) and 1 (end point)
β—‹ A color
● The start and end points are on the top and bottom edges of the item
● Gradients override color definitions
import QtQuick 2.0
Rectangle {
width: 400; height: 400
gradient: Gradient {
GradientStop {
position: 0.0; color: "green"
}
GradientStop {
position: 1.0; color: "blue"
}
}
}
● Alternative to gradients: A simple background image.
23
● Create border using part of an image:
β—‹ Corners (regions 1, 3, 7, 9) are not scaled
β—‹ Horizontal borders (2 and 8) are scaled according to horizontalTileMode
β—‹ Vertical borders (4 and 6) are scaled according to verticalTileMode
β—‹ Middle (5) is scaled according to both modes
● There are 3 different scale modes
β—‹ Stretch: scale the image to fit to the available area.
β—‹ Repeat: tile the image until there is no more space.
β—‹ Round: like Repeat, but scales the images down to ensure that the last
image is not cropped
BorderImage {
source: "content/colors.png"
border { left: 30; top: 30; right: 30; bottom: 30; }
horizontalMode: BorderImage.Stretch
verticalMode: BorderImage.Repeat
...
}
Border Images
24
● Introduction
● Qt Quick Hello World
● QML Concepts
● Composing User Interfaces
● Nested Elements
● Graphical Types
● Text Items
Agenda
25
Text Items
import QtQuick 2.0
Rectangle {
width: 400; height: 400
color: "lightblue"
Text {
x: 100; y: 100
text: "Qt Quick"
font.family : "Helvetica"
font.pixelSize : 32
}
}
● Width and height determined by the font metrics and text
● Can also use use HTML tags in the text:
"<html><b>Qt Quick</b></html>"
26
import QtQuick 2.0
Rectangle {
width: 400; height: 400 color: "lightblue"
TextInput {
x: 50; y: 100; width: 300
text: "Editable text"
font.family : "Helvetica" ; font.pixelSize : 32
}
}
● No decoration (not a QLineEdit widget)
● Gets the focus when clicked
β—‹ Need something to click on
● text property changes as the user types
Text Input
27
● Anchor Layout
● QML Components
● Qt Quick Controls
● Mouse Input
● Touch Input
● Keyboard Input
● Q&A
Agenda (continued)
28
Anchors
● Used to position and align items
● Line up edges or central lines of items
● anchors, an attached property, can specify
β—‹ A position in another item: (centerIn, fill)
β—‹ An AnchorLine of another item: (left, top)
AnchorLines:
29
import QtQuick 2.0
Rectangle {
width: 400; height: 400
color: "lightblue"
id: rectangle1
Text {
text: "Centered text" ; color: "green"
font.family : "Helvetica" ; font.pixelSize : 32
anchors.centerIn : rectangle1
}
}
● anchors.centerIn centers the Text item in
the Rectangle
β—‹ Refers to an Item, not an AnchorLine
anchors.centerIn
30
import QtQuick 2.0
Rectangle {
// The parent element
width: 400; height: 400
color: "lightblue"
Text {
text: "Centered text" ; color: "green"
font.family : "Helvetica" ; font.pixelSize : 32
anchors.centerIn : parent
}
}
● Each item can refer to its parent Item
β—‹ Using the parent ID
● Can refer to ancestors and named children of
ancestors
Anchors and Parent
31
Connecting AnchorLines Together
import QtQuick 2.0
Rectangle {
width: 300; height: 100
color: "lightblue"
Text {
y: 34
text: "Right-aligned text" ; color: "green"
font.family : "Helvetica" ; font.pixelSize : 32
anchors.right : parent.right
}
}
● AnchorLines must be parallel
β—‹ right to left but not bottom
● AnchorLines of other items are referred to directly:
β—‹ Use parent.right, not parent.anchors.right
32
Margins
● Used with anchors to add space
● Specify distances
β—‹ In pixels
β—‹ Between Items connected with anchors
33
● baseLine is another AnchorLine
import QtQuick 2.0
Rectangle {
width: 400; height: 200
color: "lightblue"
Image {
id: book; source: "../images/book.svg"
anchors.left : parent.left
anchors.leftMargin : parent.width /16
anchors.verticalCenter : parent.verticalCenter
}
Text {
text: "Writing"; font.pixelSize : 32
anchors.left : book.right; anchors.leftMargin : 32
anchors.baseline : book.verticalCenter
}
}
Margins and baseLine
34
Hints and Tips – Anchors
● Anchors can only be used with parent and sibling
items
● Anchors work on constraints
β—‹ Some items need to have well-defined positions and sizes
β—‹ Items without default sizes should be anchored to fixed or well-
defined items
● Anchors creates dependencies on geometries of
other items
β—‹ Creates an order in which geometries are calculated
β—‹ Avoid creating circular dependencies
β–  e.g., parent β†’ child β†’ parent
● Margins are only used if the corresponding
anchors are used
β—‹ e.g., leftMargin needs left to be defined
35
Strategies for Use – Anchors
Identify Items with different roles in the user interface:
● Fixed items
β—‹ Make sure these have id defined
β—‹ Unless these items can easily be referenced as parent items
● Items that dominate the user interface
β—‹ Make sure these have id defined
● Items that react to size changes of the dominant
items
β—‹ Give these anchors that refer to the dominant or fixed items
36
● Anchor Layout
● QML Components
● Qt Quick Controls
● Mouse Input
● Touch Input
● Keyboard Input
● Q&A
Agenda (continued)
37
QML Types
● Item is the base type for Visible QML objects
β—‹ Has a position, dimensions
β—‹ Usually used to group other visual Items
β—‹ Often used as the top-level Item
β—‹ Rectangle, Text, TextInput, ...
● Non-visual structures also exist:
β—‹ State, Transition, ...
β—‹ ListModel, ListElement, Path, ...
β—‹ Gradient, Timer, ...
● QQuickItem extends QObject and thus, has properties
β—‹ QML Objects can be extended with custom properties from C++
or QML
38
Agenda (continued)
● Anchor Layout
● QML Components
● Qt Quick Controls
● Mouse Input
● Touch Input
● Keyboard Input
● Q&A
39
Qt Quick Controls
● A set of controls to build entire user interfaces
in Qt Quick
● Originally designed to provide a set of ready to
use components for traditional desktop
applications
β—‹ Application Windows, Navigation and Views, Controls,
Menus
β—‹ Layouts
β—‹ System and Theme integration
● Idea and design extensible to touchscreen
applications
40
Qt Quick Controls
● Platforms supported include Windows, OS X,
Android, Linux and iOS
● Qt Quick Controls 1 are designed for desktop
platforms and look like native widgets
● Qt Quick Controls 2 (aka Qt Labs Controls) are
designed for embedded platforms and are
lighter weight
● Controls have similar APIs
41
● Anchor Layout
● QML Components
● Qt Quick Controls
● Mouse Input
● Touch Input
● Keyboard Input
● Q&A
Agenda (continued)
42
Mouse Areas
Mouse areas define parts of the screen where cursor
input occurs
● Placed and resized like ordinary items
β—‹ Using anchors if necessary
● Two ways to monitor mouse input:
β—‹ Handle signals
β—‹ Dynamic property bindings
43
import QtQuick 2.0
Rectangle {
width: 400; height: 200; color: "lightblue"
Text {
anchors.horizontalCenter : parent.horizontalCenter
anchors.verticalCenter : parent.verticalCenter
text: "Press me"; font.pixelSize : 48
MouseArea {
anchors.fill : parent
onPressed: parent.color = "green"
onReleased: parent.color = "black"
}
}
}ml
Clickable Mouse Area
44
import QtQuick 2.0
Rectangle {
width: 400; height: 200; color: "lightblue"
Rectangle {
x: 150; y: 50; width: 100; height: 100
color: mouse_area.containsMouse ? "green" : "white"
MouseArea {
id: mouse_area
anchors.fill : parent hoverEnabled : true
}
}
}
Mouse Hover and Properties
45
Mouse Area Hints and Tips
● A mouse area only responds to its
acceptedButtons
β—‹ The handlers are not called for other buttons, but
β—‹ Any click involving an allowed button is reported
β—‹ The pressedButtons property contains all buttons
β—‹ Even non-allowed buttons, if an allowed button is also
pressed
● With hoverEnabled set to false
β—‹ containsMouse can be true if the mouse area is clicked
46
● Anchor Layout
● QML Components
● Qt Quick Controls
● Mouse Input
● Touch Input
● Keyboard Input
● Q&A
Agenda (continued)
47
Touch Events
QML types that already recognize Touch events:
● Single-touch (MouseArea)
● Multi-touch (MultiPointTouchArea)
● Gestures:
β—‹ Swipe (Flickable, ListView)
β—‹ Pinch (PinchArea)
β—‹ Tap and Hold (MouseArea onPressAndHold)
48
Multi-Touch Events
MultiPointTouchArea {
anchors.fill : parent
touchPoints : [
TouchPoint { id: point1 }, TouchPoint { id: point2 }, TouchPoint { id: point3 }
]
}
TouchPoint properties:
● int x
● int y
● bool pressed
● int pointId
49
MultiPointTouchArea Signals
● onPressed(list<TouchPoint> touchPoints) onReleased(…)
touchPoints is list of changed points.
● onUpdated(…)
Called when points is updated (moved) touchPoints is list of changed
points.
● onTouchUpdated(…)
Called on any change touchPoints is list of all points.
50
MultiPointTouchArea Signals
● onGestureStarted(GestureEvent gesture)
Cancel the gesture using gesture.cancel()
● onCanceled(list<TouchPoint> touchPoints)
Called when another Item takes over touch handling.
Useful for undoing what was done on onPressed.
51
Swipe Gestures
● Built into Flickable, ListView
● snapMode: ListView.SnapOneItem
The view settles no more than one item away from the first visible item at
the time the mouse button is released.
● orientation: ListView.Horizontal
52
Pinch Gesture
Automatic pinch setup using the target property:
Image {
id: image
source: "qt-logo.jpg"
PinchArea {
anchors.fill : parent
pinch.target : parent
pinch.minimumScale : 0.5
pinch.maximumScale : 2.0
pinch.minimumRotation : -3600
pinch.maximumRotation : 3600
pinch.dragAxis : Pinch.XAxis
}
}
53
Pinch Gestures
● Signals for manual pinch handling
β—‹ onPinchStarted(PinchEvent pinch)
β—‹ onPinchUpdated(PinchEvent pinch)
β—‹ onPinchFinished()
● PinchEvent properties:
β—‹ point1, point2, center
β—‹ rotation
β—‹ scale
β—‹ accepted
Set to false in the onPinchStarted handler if the gesture should
not be handled
54
Agenda (continued)
● Anchor Layout
● QML Components
● Qt Quick Controls
● Mouse Input
● Touch Input
● Keyboard Input
● Q&A
55
Keyboard Input
Basic keyboard input is handled in two different
use cases:
● Accepting text input
β—‹ TextInput and TextEdit
● Navigation between Items
β—‹ Changing the focused Item
β—‹ Directional (arrow keys), tab and backtab
56
Raw Keyboard Input
● Raw key input can be handled by items
β—‹ With predefined handlers for commonly used keys
β—‹ Full key event information is also available
● The same focus mechanism is used as for
ordinary text input
β—‹ Enabled by setting the focus property
● Key handling is not an inherited property of items
β—‹ Enabled using the Keys attached property
● Key events can be forwarded to other objects
β—‹ Enabled using the Keys.forwardTo attached property
β—‹ Accepts a list of objects
57
Raw Keyboard Input
import QtQuick 2.0
Rectangle {
width: 400; height: 400; color: "black"
Image {
id: rocket
x: 150; y: 150
source: "../images/rocket.svg"
transformOrigin: Item.Center
}
//keyboard input detection goes here!
focus: true
}
● Can use predefined handlers for arrow keys:
Keys.onLeftPressed: rocket.rotation = (rocket.rotation - 10) % 360
Keys.onRightPressed: rocket.rotation = (rocket.rotation + 10) % 360
● Or inspect events from all key presses:
Keys.onPressed: {
event.accepted = true
if (event.key == Qt.Key_Left)
rocket.rotation = (rocket.rotation - 10) % 360;
else if (event.key == Qt.Key_Right)
rocket.rotation = (rocket.rotation + 10) % 360;
}
58
Agenda (continued)
● Anchor Layout
● QML Components
● Qt Quick Controls
● Mouse Input
● Touch Input
● Keyboard Input
● Q&A
59
Next Time on Qt for Beginners!
Join us as we explore doing more on June 9!
60

More Related Content

What's hot

Best Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIBest Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIICS
Β 
Best Practices in Qt Quick/QML - Part 1 of 4
Best Practices in Qt Quick/QML - Part 1 of 4Best Practices in Qt Quick/QML - Part 1 of 4
Best Practices in Qt Quick/QML - Part 1 of 4ICS
Β 
Best Practices in Qt Quick/QML - Part IV
Best Practices in Qt Quick/QML - Part IVBest Practices in Qt Quick/QML - Part IV
Best Practices in Qt Quick/QML - Part IVICS
Β 
Basics of Model/View Qt programming
Basics of Model/View Qt programmingBasics of Model/View Qt programming
Basics of Model/View Qt programmingICS
Β 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to QtPuja Pramudya
Β 
Introduction to QML
Introduction to QMLIntroduction to QML
Introduction to QMLAlan Uthoff
Β 
Software Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicSoftware Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicICS
Β 
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google MockICS
Β 
Hello, QML
Hello, QMLHello, QML
Hello, QMLJack Yang
Β 
Scripting Your Qt Application
Scripting Your Qt ApplicationScripting Your Qt Application
Scripting Your Qt Applicationaccount inactive
Β 
Introduction to Qt Creator
Introduction to Qt CreatorIntroduction to Qt Creator
Introduction to Qt CreatorQt
Β 
Qt Technical Presentation
Qt Technical PresentationQt Technical Presentation
Qt Technical PresentationDaniel Rocha
Β 
Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Roman Elizarov
Β 
Qt test framework
Qt test frameworkQt test framework
Qt test frameworkICS
Β 

What's hot (20)

Qt Application Programming with C++ - Part 1
Qt Application Programming with C++ - Part 1Qt Application Programming with C++ - Part 1
Qt Application Programming with C++ - Part 1
Β 
Best Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIBest Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part III
Β 
Best Practices in Qt Quick/QML - Part 1 of 4
Best Practices in Qt Quick/QML - Part 1 of 4Best Practices in Qt Quick/QML - Part 1 of 4
Best Practices in Qt Quick/QML - Part 1 of 4
Β 
Qt Application Programming with C++ - Part 2
Qt Application Programming with C++ - Part 2Qt Application Programming with C++ - Part 2
Qt Application Programming with C++ - Part 2
Β 
Best Practices in Qt Quick/QML - Part IV
Best Practices in Qt Quick/QML - Part IVBest Practices in Qt Quick/QML - Part IV
Best Practices in Qt Quick/QML - Part IV
Β 
Basics of Model/View Qt programming
Basics of Model/View Qt programmingBasics of Model/View Qt programming
Basics of Model/View Qt programming
Β 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to Qt
Β 
Introduction to QML
Introduction to QMLIntroduction to QML
Introduction to QML
Β 
UI Programming with Qt-Quick and QML
UI Programming with Qt-Quick and QMLUI Programming with Qt-Quick and QML
UI Programming with Qt-Quick and QML
Β 
Qt 5 - C++ and Widgets
Qt 5 - C++ and WidgetsQt 5 - C++ and Widgets
Qt 5 - C++ and Widgets
Β 
Software Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicSoftware Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business Logic
Β 
Qt programming-using-cpp
Qt programming-using-cppQt programming-using-cpp
Qt programming-using-cpp
Β 
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
[Webinar] Qt Test-Driven Development Using Google Test and Google Mock
Β 
Hello, QML
Hello, QMLHello, QML
Hello, QML
Β 
Scripting Your Qt Application
Scripting Your Qt ApplicationScripting Your Qt Application
Scripting Your Qt Application
Β 
Introduction to Qt Creator
Introduction to Qt CreatorIntroduction to Qt Creator
Introduction to Qt Creator
Β 
Qt Technical Presentation
Qt Technical PresentationQt Technical Presentation
Qt Technical Presentation
Β 
Clean Code
Clean CodeClean Code
Clean Code
Β 
Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017
Β 
Qt test framework
Qt test frameworkQt test framework
Qt test framework
Β 

Similar to Qt for Beginners Part 3 - QML and Qt Quick

Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgetsICS
Β 
Ubuntu app development
Ubuntu app development Ubuntu app development
Ubuntu app development Xiaoguo Liu
Β 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing moreICS
Β 
Witekio custom modern qt quick components
Witekio custom modern qt quick componentsWitekio custom modern qt quick components
Witekio custom modern qt quick componentsWitekio
Β 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programmingMohammed Romi
Β 
OpenSCAD Tutorial
OpenSCAD TutorialOpenSCAD Tutorial
OpenSCAD TutorialJohn Oliva
Β 
Integrazione QML / C++
Integrazione QML / C++Integrazione QML / C++
Integrazione QML / C++Paolo Sereno
Β 
AutoCAD Architecture
AutoCAD ArchitectureAutoCAD Architecture
AutoCAD ArchitectureRavi Bhadauria
Β 
Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011Johan Thelin
Β 
Apache Cassandra Lunch #103: Cassandra Cluster Architecture in UML and the Az...
Apache Cassandra Lunch #103: Cassandra Cluster Architecture in UML and the Az...Apache Cassandra Lunch #103: Cassandra Cluster Architecture in UML and the Az...
Apache Cassandra Lunch #103: Cassandra Cluster Architecture in UML and the Az...Anant Corporation
Β 
CL_Architecture of Cassandra Data Processing.pptx
CL_Architecture of Cassandra Data Processing.pptxCL_Architecture of Cassandra Data Processing.pptx
CL_Architecture of Cassandra Data Processing.pptxNicholasBrackley
Β 
Future of Microservices - Jakub Hadvig
Future of Microservices - Jakub HadvigFuture of Microservices - Jakub Hadvig
Future of Microservices - Jakub HadvigWEBtlak
Β 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec PolymerHoracio Gonzalez
Β 
Enhancing Design with Adaptive Content
Enhancing Design with Adaptive ContentEnhancing Design with Adaptive Content
Enhancing Design with Adaptive ContentDesign for Drupal, Boston
Β 
Blender for ArchViz.pdf
Blender for ArchViz.pdfBlender for ArchViz.pdf
Blender for ArchViz.pdfshan_1900
Β 
Introduction to the Qt Quick Scene Graph
Introduction to the Qt Quick Scene GraphIntroduction to the Qt Quick Scene Graph
Introduction to the Qt Quick Scene GraphICS
Β 
Graphical Objects and Scene Graphs
Graphical Objects and Scene GraphsGraphical Objects and Scene Graphs
Graphical Objects and Scene GraphsSyed Zaid Irshad
Β 
Best Practices in Qt Quick/QML - Part 2
Best Practices in Qt Quick/QML - Part 2Best Practices in Qt Quick/QML - Part 2
Best Practices in Qt Quick/QML - Part 2Janel Heilbrunn
Β 
Best Practices in Qt Quick/QML - Part 2
Best Practices in Qt Quick/QML - Part 2Best Practices in Qt Quick/QML - Part 2
Best Practices in Qt Quick/QML - Part 2ICS
Β 
Network programming with Qt (C++)
Network programming with Qt (C++)Network programming with Qt (C++)
Network programming with Qt (C++)Manohar Kuse
Β 

Similar to Qt for Beginners Part 3 - QML and Qt Quick (20)

Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgets
Β 
Ubuntu app development
Ubuntu app development Ubuntu app development
Ubuntu app development
Β 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing more
Β 
Witekio custom modern qt quick components
Witekio custom modern qt quick componentsWitekio custom modern qt quick components
Witekio custom modern qt quick components
Β 
Chapter02 graphics-programming
Chapter02 graphics-programmingChapter02 graphics-programming
Chapter02 graphics-programming
Β 
OpenSCAD Tutorial
OpenSCAD TutorialOpenSCAD Tutorial
OpenSCAD Tutorial
Β 
Integrazione QML / C++
Integrazione QML / C++Integrazione QML / C++
Integrazione QML / C++
Β 
AutoCAD Architecture
AutoCAD ArchitectureAutoCAD Architecture
AutoCAD Architecture
Β 
Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011Necessitas - Qt on Android - from FSCONS 2011
Necessitas - Qt on Android - from FSCONS 2011
Β 
Apache Cassandra Lunch #103: Cassandra Cluster Architecture in UML and the Az...
Apache Cassandra Lunch #103: Cassandra Cluster Architecture in UML and the Az...Apache Cassandra Lunch #103: Cassandra Cluster Architecture in UML and the Az...
Apache Cassandra Lunch #103: Cassandra Cluster Architecture in UML and the Az...
Β 
CL_Architecture of Cassandra Data Processing.pptx
CL_Architecture of Cassandra Data Processing.pptxCL_Architecture of Cassandra Data Processing.pptx
CL_Architecture of Cassandra Data Processing.pptx
Β 
Future of Microservices - Jakub Hadvig
Future of Microservices - Jakub HadvigFuture of Microservices - Jakub Hadvig
Future of Microservices - Jakub Hadvig
Β 
2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer2014 03-25 - GDG Nantes - Web Components avec Polymer
2014 03-25 - GDG Nantes - Web Components avec Polymer
Β 
Enhancing Design with Adaptive Content
Enhancing Design with Adaptive ContentEnhancing Design with Adaptive Content
Enhancing Design with Adaptive Content
Β 
Blender for ArchViz.pdf
Blender for ArchViz.pdfBlender for ArchViz.pdf
Blender for ArchViz.pdf
Β 
Introduction to the Qt Quick Scene Graph
Introduction to the Qt Quick Scene GraphIntroduction to the Qt Quick Scene Graph
Introduction to the Qt Quick Scene Graph
Β 
Graphical Objects and Scene Graphs
Graphical Objects and Scene GraphsGraphical Objects and Scene Graphs
Graphical Objects and Scene Graphs
Β 
Best Practices in Qt Quick/QML - Part 2
Best Practices in Qt Quick/QML - Part 2Best Practices in Qt Quick/QML - Part 2
Best Practices in Qt Quick/QML - Part 2
Β 
Best Practices in Qt Quick/QML - Part 2
Best Practices in Qt Quick/QML - Part 2Best Practices in Qt Quick/QML - Part 2
Best Practices in Qt Quick/QML - Part 2
Β 
Network programming with Qt (C++)
Network programming with Qt (C++)Network programming with Qt (C++)
Network programming with Qt (C++)
Β 

More from ICS

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
Β 
Practical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdfPractical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdfICS
Β 
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...ICS
Β 
Overcoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues WebinarOvercoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues WebinarICS
Β 
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdfEnhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdfICS
Β 
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdfDesigning and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdfICS
Β 
Quality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdfQuality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdfICS
Β 
Creating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdfCreating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdfICS
Β 
Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up ICS
Β 
Cybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdfCybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdfICS
Β 
MDG Panel - Creating Expert Level GUIs for Complex Medical Devices
MDG Panel - Creating Expert Level GUIs for Complex Medical DevicesMDG Panel - Creating Expert Level GUIs for Complex Medical Devices
MDG Panel - Creating Expert Level GUIs for Complex Medical DevicesICS
Β 
How to Craft a Winning IOT Device Management Solution
How to Craft a Winning IOT Device Management SolutionHow to Craft a Winning IOT Device Management Solution
How to Craft a Winning IOT Device Management SolutionICS
Β 
Bridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsBridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsICS
Β 
IoT Device Fleet Management: Create a Robust Solution with Azure
IoT Device Fleet Management: Create a Robust Solution with AzureIoT Device Fleet Management: Create a Robust Solution with Azure
IoT Device Fleet Management: Create a Robust Solution with AzureICS
Β 
Basic Cmake for Qt Users
Basic Cmake for Qt UsersBasic Cmake for Qt Users
Basic Cmake for Qt UsersICS
Β 
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...ICS
Β 
Qt Installer Framework
Qt Installer FrameworkQt Installer Framework
Qt Installer FrameworkICS
Β 
Bridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsBridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsICS
Β 
Overcome Hardware And Software Challenges - Medical Device Case Study
Overcome Hardware And Software Challenges - Medical Device Case StudyOvercome Hardware And Software Challenges - Medical Device Case Study
Overcome Hardware And Software Challenges - Medical Device Case StudyICS
Β 
User Experience Design for IoT
User Experience Design for IoTUser Experience Design for IoT
User Experience Design for IoTICS
Β 

More from ICS (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
Β 
Practical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdfPractical Advice for FDA’s 510(k) Requirements.pdf
Practical Advice for FDA’s 510(k) Requirements.pdf
Β 
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Accelerating Development of a Safety-Critical Cobot Welding System with Qt/QM...
Β 
Overcoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues WebinarOvercoming CMake Configuration Issues Webinar
Overcoming CMake Configuration Issues Webinar
Β 
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdfEnhancing Quality and Test in Medical Device Design - Part 2.pdf
Enhancing Quality and Test in Medical Device Design - Part 2.pdf
Β 
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdfDesigning and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Designing and Managing IoT Devices for Rapid Deployment - Webinar.pdf
Β 
Quality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdfQuality and Test in Medical Device Design - Part 1.pdf
Quality and Test in Medical Device Design - Part 1.pdf
Β 
Creating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdfCreating Digital Twins Using Rapid Development Techniques.pdf
Creating Digital Twins Using Rapid Development Techniques.pdf
Β 
Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up Secure Your Medical Devices From the Ground Up
Secure Your Medical Devices From the Ground Up
Β 
Cybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdfCybersecurity and Software Updates in Medical Devices.pdf
Cybersecurity and Software Updates in Medical Devices.pdf
Β 
MDG Panel - Creating Expert Level GUIs for Complex Medical Devices
MDG Panel - Creating Expert Level GUIs for Complex Medical DevicesMDG Panel - Creating Expert Level GUIs for Complex Medical Devices
MDG Panel - Creating Expert Level GUIs for Complex Medical Devices
Β 
How to Craft a Winning IOT Device Management Solution
How to Craft a Winning IOT Device Management SolutionHow to Craft a Winning IOT Device Management Solution
How to Craft a Winning IOT Device Management Solution
Β 
Bridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsBridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory Teams
Β 
IoT Device Fleet Management: Create a Robust Solution with Azure
IoT Device Fleet Management: Create a Robust Solution with AzureIoT Device Fleet Management: Create a Robust Solution with Azure
IoT Device Fleet Management: Create a Robust Solution with Azure
Β 
Basic Cmake for Qt Users
Basic Cmake for Qt UsersBasic Cmake for Qt Users
Basic Cmake for Qt Users
Β 
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
Software Update Mechanisms: Selecting the Best Solutin for Your Embedded Linu...
Β 
Qt Installer Framework
Qt Installer FrameworkQt Installer Framework
Qt Installer Framework
Β 
Bridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory TeamsBridging the Gap Between Development and Regulatory Teams
Bridging the Gap Between Development and Regulatory Teams
Β 
Overcome Hardware And Software Challenges - Medical Device Case Study
Overcome Hardware And Software Challenges - Medical Device Case StudyOvercome Hardware And Software Challenges - Medical Device Case Study
Overcome Hardware And Software Challenges - Medical Device Case Study
Β 
User Experience Design for IoT
User Experience Design for IoTUser Experience Design for IoT
User Experience Design for IoT
Β 

Recently uploaded

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
Β 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
Β 
call girls in Vaishali (Ghaziabad) πŸ” >ΰΌ’8448380779 πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Vaishali (Ghaziabad) πŸ” >ΰΌ’8448380779 πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈcall girls in Vaishali (Ghaziabad) πŸ” >ΰΌ’8448380779 πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Vaishali (Ghaziabad) πŸ” >ΰΌ’8448380779 πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈDelhi Call girls
Β 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
Β 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
Β 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
Β 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
Β 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
Β 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
Β 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
Β 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
Β 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
Β 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
Β 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
Β 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
Β 
CHEAP Call Girls in Pushp Vihar (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE9953056974 Low Rate Call Girls In Saket, Delhi NCR
Β 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
Β 
CALL ON βž₯8923113531 πŸ”Call Girls Kakori Lucknow best sexual service Online β˜‚οΈ
CALL ON βž₯8923113531 πŸ”Call Girls Kakori Lucknow best sexual service Online  β˜‚οΈCALL ON βž₯8923113531 πŸ”Call Girls Kakori Lucknow best sexual service Online  β˜‚οΈ
CALL ON βž₯8923113531 πŸ”Call Girls Kakori Lucknow best sexual service Online β˜‚οΈanilsa9823
Β 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
Β 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
Β 

Recently uploaded (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Β 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
Β 
call girls in Vaishali (Ghaziabad) πŸ” >ΰΌ’8448380779 πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Vaishali (Ghaziabad) πŸ” >ΰΌ’8448380779 πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈcall girls in Vaishali (Ghaziabad) πŸ” >ΰΌ’8448380779 πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
call girls in Vaishali (Ghaziabad) πŸ” >ΰΌ’8448380779 πŸ” genuine Escort Service πŸ”βœ”οΈβœ”οΈ
Β 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Β 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
Β 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
Β 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
Β 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Β 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
Β 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
Β 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Β 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
Β 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Β 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
Β 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Β 
CHEAP Call Girls in Pushp Vihar (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )πŸ” 9953056974πŸ”(=)/CALL GIRLS SERVICE
Β 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
Β 
CALL ON βž₯8923113531 πŸ”Call Girls Kakori Lucknow best sexual service Online β˜‚οΈ
CALL ON βž₯8923113531 πŸ”Call Girls Kakori Lucknow best sexual service Online  β˜‚οΈCALL ON βž₯8923113531 πŸ”Call Girls Kakori Lucknow best sexual service Online  β˜‚οΈ
CALL ON βž₯8923113531 πŸ”Call Girls Kakori Lucknow best sexual service Online β˜‚οΈ
Β 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
Β 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
Β 

Qt for Beginners Part 3 - QML and Qt Quick

  • 1. Qt For Beginners - Part 3 QML and Qt Quick Eric Magnuson, Qt Consultant Integrated Computer Solutions Visit us at http://www.ics.com Watch the video: http://bit.ly/qt-beginners-qml-quick Copyright 2016, Integrated Computers Solutions, Inc. This work may not be reproduced in whole or in part without the express written consent of Integrated Computer Solutions, Inc. 1
  • 2. ● Introduction ● Qt Quick Hello World ● QML Concepts ● Composing User Interfaces ● Nested Elements ● Graphical Types ● Text Items Agenda 2
  • 3. ● Anchor Layout ● QML Components ● Qt Quick Controls ● Mouse Input ● Touch Input ● Keyboard Input ● Q&A Agenda (continued) 3
  • 4. ● Introduction ● Qt Quick Hello World ● QML Concepts ● Composing User Interfaces ● Nested Elements ● Graphical Types ● Text Items Agenda 4
  • 5. What is QML? Declarative language for User Interface structure ● Describes the user interface β—‹ What items look like β—‹ How items behave ● UI specified as tree of QML structures with properties β—‹ Elements and identities β—‹ Properties and property binding 5
  • 6. ● Introduction ● Qt Quick Hello World ● QML Concepts ● Composing User Interfaces ● Nested Elements ● Graphical Types ● Text Items Agenda 6
  • 7. // Simple QML example import QtQuick 2.6 Rectangle { width: 200 height: 200 Text { anchors.centerIn: parent font.pixelSize: 18 text: "Hello, world!" } MouseArea { anchors.fill: parent onClicked: { Qt.quit() } } } Qt Quick Hello World 7
  • 8. ● Introduction ● Qt Quick Hello World ● QML Concepts ● Composing User Interfaces ● Nested Elements ● Graphical Types ● Text Items Agenda 8
  • 9. Properties Objects are described by properties ● Simple name-value definitions β—‹ width, height, color, ... β—‹ With default values β—‹ Each has a well-defined type β—‹ Separated by semicolons or line breaks ● Used for β—‹ Customizing their appearance β—‹ Changing their behavior 9
  • 10. Types of Properties ● Standard properties can be given values: Text { text: "Hello world" height: 50 } ● Grouped properties keep related properties together Text { font.family: "Helvetica" font.pixelSize: 24 } ● Attached properties are applied to QML structures TextInput { text: "Hello world" KeyNavigation.tab: nextInput } β—‹ KeyNavigation.tab is not a standard property of TextInput β—‹ Is a standard property that is attached to Items ● Custom properties can be added to any QML type Rectangle { property real mass: 100.0 } 10
  • 11. Binding Properties import QtQuick 2.0 Item { width: 400; height: 200 Rectangle { x: 100; y: 50 width: height * 2; height: 100 color: "lightblue" } } ● Properties can contain expressions β—‹ See above: width is twice the height ● Not just initial assignments ● Expressions are re-evaluated when needed 11
  • 12. Identifying QML Structures The id defines an identity of a QML structure ● Lets other QML structures refer to it β—‹ For relative alignment and positioning β—‹ To access or modify an Item's properties β—‹ To re-use common structures (e.g., gradients, images) ● Used to create relationships between structures ● id is not a property β—‹ Not stored in the QObject with other properties β—‹ More like a "label" β—‹ A single Item can have different identities in other files/scopes. ● parent is a special id referring to the relative parent structure 12
  • 13. Using Identities Text { id: title x: 50; y: 25 text: "Qt Quick" font.family: "Helvetica" font.pixelSize: 50 } Rectangle { x: 50; y: 95; height: 5 width: title.width color: "green" } ● Text item has the identity, title ● width of Rectangle bound to width of title ● Try using TextInput instead of Text 13
  • 14. Methods ● Most features are accessed via properties ● Methods are also used, to perform actions β—‹ TextInput has a selectAll() method β—‹ Timer has start(), stop() and restart() methods β—‹ Particles has a burst() method ● All methods are public in QML ● Other methods are used to convert values between types: β—‹ Qt.formatDateTime(datetime, format) β—‹ Qt.md5(data) β—‹ Qt.tint(baseColor, tintColor) 14
  • 15. Property values can have different types: ● Numbers (int and real): 400 and 1.5 ● Boolean values: true and false ● Strings: "Hello Qt" ● Constants: AlignLeft ● Lists: [ ... ] β—‹ Lists with one item can be written as just the item itself ● Scripts: β—‹ Included directly in property definitions ● Other types: β—‹ colors, dates, times, rects, points, sizes, 3D vectors, ... β—‹ Usually created using constructors Basic Types 15
  • 16. ● Introduction ● Qt Quick Hello World ● QML Concepts ● Composing User Interfaces ● Nested Elements ● Graphical Types ● Text Items Agenda 16
  • 17. Why use nested items, anchors and components? ● Concerns separation ● Visual grouping ● Pixel perfect items placing and layout ● Encapsulation ● Reusability ● Look and feel changes 17
  • 18. ● Introduction ● Qt Quick Hello World ● QML Concepts ● Composing User Interfaces ● Nested Elements ● Graphical Types ● Text Items Agenda 18
  • 19. import QtQuick 2.0 Rectangle { width: 400; height: 400 color: "lightblue" Rectangle { x: 50; y: 50; width: 300; height: 300 color: "green" Rectangle { x: 200; y: 150; width: 50; height: 50 color: "white" } } } ● Each Item is positioned relative to its parents Nested Elements 19
  • 20. ● Introduction ● Qt Quick Hello World ● QML Concepts ● Composing User Interfaces ● Nested Elements ● Graphical Types ● Text Items Agenda 20
  • 21. Colors ● Specifying colors β—‹ Named colors (using SVG names): "red", "green", "blue", … β—‹ HTML style color components: "#ff0000", "#008000", "#0000ff", … β—‹ Built-in function: Qt.rgba(0,0.5,0,1) ● Changing items opacity: β—‹ Set opacity property between 0.0 (transparent) to 1.0 (opaque) import QtQuick 2.0 Item { width: 300; height: 100 Rectangle { x: 0; y: 0; width: 100; height: 100; color: "#ff0000" } Rectangle { x: 100; y: 0; width: 100; height: 100 color: Qt.rgba(0, 0.75, 0, 1) } Rectangle { x: 200; y: 0; width: 100; height: 100; color: "blue" } } 21
  • 22. Images ● Represented by the Image class ● Refer to image files with the source property β—‹ Using absolute URLs or relative to the QML file import QtQuick 2.0 Rectangle { width: 400; height: 400 color: "black" Image { x: 150; y: 150 source: "../images/rocket.png" } } β—‹ width and height are obtained from the image file ● Can be transformed β—‹ Scaled, rotated β—‹ About an axis or central point 22
  • 23. Gradients Define a gradient using the gradient property: ● As Gradient containing GradientStop values, each with β—‹ A position: a number between 0 (start point) and 1 (end point) β—‹ A color ● The start and end points are on the top and bottom edges of the item ● Gradients override color definitions import QtQuick 2.0 Rectangle { width: 400; height: 400 gradient: Gradient { GradientStop { position: 0.0; color: "green" } GradientStop { position: 1.0; color: "blue" } } } ● Alternative to gradients: A simple background image. 23
  • 24. ● Create border using part of an image: β—‹ Corners (regions 1, 3, 7, 9) are not scaled β—‹ Horizontal borders (2 and 8) are scaled according to horizontalTileMode β—‹ Vertical borders (4 and 6) are scaled according to verticalTileMode β—‹ Middle (5) is scaled according to both modes ● There are 3 different scale modes β—‹ Stretch: scale the image to fit to the available area. β—‹ Repeat: tile the image until there is no more space. β—‹ Round: like Repeat, but scales the images down to ensure that the last image is not cropped BorderImage { source: "content/colors.png" border { left: 30; top: 30; right: 30; bottom: 30; } horizontalMode: BorderImage.Stretch verticalMode: BorderImage.Repeat ... } Border Images 24
  • 25. ● Introduction ● Qt Quick Hello World ● QML Concepts ● Composing User Interfaces ● Nested Elements ● Graphical Types ● Text Items Agenda 25
  • 26. Text Items import QtQuick 2.0 Rectangle { width: 400; height: 400 color: "lightblue" Text { x: 100; y: 100 text: "Qt Quick" font.family : "Helvetica" font.pixelSize : 32 } } ● Width and height determined by the font metrics and text ● Can also use use HTML tags in the text: "<html><b>Qt Quick</b></html>" 26
  • 27. import QtQuick 2.0 Rectangle { width: 400; height: 400 color: "lightblue" TextInput { x: 50; y: 100; width: 300 text: "Editable text" font.family : "Helvetica" ; font.pixelSize : 32 } } ● No decoration (not a QLineEdit widget) ● Gets the focus when clicked β—‹ Need something to click on ● text property changes as the user types Text Input 27
  • 28. ● Anchor Layout ● QML Components ● Qt Quick Controls ● Mouse Input ● Touch Input ● Keyboard Input ● Q&A Agenda (continued) 28
  • 29. Anchors ● Used to position and align items ● Line up edges or central lines of items ● anchors, an attached property, can specify β—‹ A position in another item: (centerIn, fill) β—‹ An AnchorLine of another item: (left, top) AnchorLines: 29
  • 30. import QtQuick 2.0 Rectangle { width: 400; height: 400 color: "lightblue" id: rectangle1 Text { text: "Centered text" ; color: "green" font.family : "Helvetica" ; font.pixelSize : 32 anchors.centerIn : rectangle1 } } ● anchors.centerIn centers the Text item in the Rectangle β—‹ Refers to an Item, not an AnchorLine anchors.centerIn 30
  • 31. import QtQuick 2.0 Rectangle { // The parent element width: 400; height: 400 color: "lightblue" Text { text: "Centered text" ; color: "green" font.family : "Helvetica" ; font.pixelSize : 32 anchors.centerIn : parent } } ● Each item can refer to its parent Item β—‹ Using the parent ID ● Can refer to ancestors and named children of ancestors Anchors and Parent 31
  • 32. Connecting AnchorLines Together import QtQuick 2.0 Rectangle { width: 300; height: 100 color: "lightblue" Text { y: 34 text: "Right-aligned text" ; color: "green" font.family : "Helvetica" ; font.pixelSize : 32 anchors.right : parent.right } } ● AnchorLines must be parallel β—‹ right to left but not bottom ● AnchorLines of other items are referred to directly: β—‹ Use parent.right, not parent.anchors.right 32
  • 33. Margins ● Used with anchors to add space ● Specify distances β—‹ In pixels β—‹ Between Items connected with anchors 33
  • 34. ● baseLine is another AnchorLine import QtQuick 2.0 Rectangle { width: 400; height: 200 color: "lightblue" Image { id: book; source: "../images/book.svg" anchors.left : parent.left anchors.leftMargin : parent.width /16 anchors.verticalCenter : parent.verticalCenter } Text { text: "Writing"; font.pixelSize : 32 anchors.left : book.right; anchors.leftMargin : 32 anchors.baseline : book.verticalCenter } } Margins and baseLine 34
  • 35. Hints and Tips – Anchors ● Anchors can only be used with parent and sibling items ● Anchors work on constraints β—‹ Some items need to have well-defined positions and sizes β—‹ Items without default sizes should be anchored to fixed or well- defined items ● Anchors creates dependencies on geometries of other items β—‹ Creates an order in which geometries are calculated β—‹ Avoid creating circular dependencies β–  e.g., parent β†’ child β†’ parent ● Margins are only used if the corresponding anchors are used β—‹ e.g., leftMargin needs left to be defined 35
  • 36. Strategies for Use – Anchors Identify Items with different roles in the user interface: ● Fixed items β—‹ Make sure these have id defined β—‹ Unless these items can easily be referenced as parent items ● Items that dominate the user interface β—‹ Make sure these have id defined ● Items that react to size changes of the dominant items β—‹ Give these anchors that refer to the dominant or fixed items 36
  • 37. ● Anchor Layout ● QML Components ● Qt Quick Controls ● Mouse Input ● Touch Input ● Keyboard Input ● Q&A Agenda (continued) 37
  • 38. QML Types ● Item is the base type for Visible QML objects β—‹ Has a position, dimensions β—‹ Usually used to group other visual Items β—‹ Often used as the top-level Item β—‹ Rectangle, Text, TextInput, ... ● Non-visual structures also exist: β—‹ State, Transition, ... β—‹ ListModel, ListElement, Path, ... β—‹ Gradient, Timer, ... ● QQuickItem extends QObject and thus, has properties β—‹ QML Objects can be extended with custom properties from C++ or QML 38
  • 39. Agenda (continued) ● Anchor Layout ● QML Components ● Qt Quick Controls ● Mouse Input ● Touch Input ● Keyboard Input ● Q&A 39
  • 40. Qt Quick Controls ● A set of controls to build entire user interfaces in Qt Quick ● Originally designed to provide a set of ready to use components for traditional desktop applications β—‹ Application Windows, Navigation and Views, Controls, Menus β—‹ Layouts β—‹ System and Theme integration ● Idea and design extensible to touchscreen applications 40
  • 41. Qt Quick Controls ● Platforms supported include Windows, OS X, Android, Linux and iOS ● Qt Quick Controls 1 are designed for desktop platforms and look like native widgets ● Qt Quick Controls 2 (aka Qt Labs Controls) are designed for embedded platforms and are lighter weight ● Controls have similar APIs 41
  • 42. ● Anchor Layout ● QML Components ● Qt Quick Controls ● Mouse Input ● Touch Input ● Keyboard Input ● Q&A Agenda (continued) 42
  • 43. Mouse Areas Mouse areas define parts of the screen where cursor input occurs ● Placed and resized like ordinary items β—‹ Using anchors if necessary ● Two ways to monitor mouse input: β—‹ Handle signals β—‹ Dynamic property bindings 43
  • 44. import QtQuick 2.0 Rectangle { width: 400; height: 200; color: "lightblue" Text { anchors.horizontalCenter : parent.horizontalCenter anchors.verticalCenter : parent.verticalCenter text: "Press me"; font.pixelSize : 48 MouseArea { anchors.fill : parent onPressed: parent.color = "green" onReleased: parent.color = "black" } } }ml Clickable Mouse Area 44
  • 45. import QtQuick 2.0 Rectangle { width: 400; height: 200; color: "lightblue" Rectangle { x: 150; y: 50; width: 100; height: 100 color: mouse_area.containsMouse ? "green" : "white" MouseArea { id: mouse_area anchors.fill : parent hoverEnabled : true } } } Mouse Hover and Properties 45
  • 46. Mouse Area Hints and Tips ● A mouse area only responds to its acceptedButtons β—‹ The handlers are not called for other buttons, but β—‹ Any click involving an allowed button is reported β—‹ The pressedButtons property contains all buttons β—‹ Even non-allowed buttons, if an allowed button is also pressed ● With hoverEnabled set to false β—‹ containsMouse can be true if the mouse area is clicked 46
  • 47. ● Anchor Layout ● QML Components ● Qt Quick Controls ● Mouse Input ● Touch Input ● Keyboard Input ● Q&A Agenda (continued) 47
  • 48. Touch Events QML types that already recognize Touch events: ● Single-touch (MouseArea) ● Multi-touch (MultiPointTouchArea) ● Gestures: β—‹ Swipe (Flickable, ListView) β—‹ Pinch (PinchArea) β—‹ Tap and Hold (MouseArea onPressAndHold) 48
  • 49. Multi-Touch Events MultiPointTouchArea { anchors.fill : parent touchPoints : [ TouchPoint { id: point1 }, TouchPoint { id: point2 }, TouchPoint { id: point3 } ] } TouchPoint properties: ● int x ● int y ● bool pressed ● int pointId 49
  • 50. MultiPointTouchArea Signals ● onPressed(list<TouchPoint> touchPoints) onReleased(…) touchPoints is list of changed points. ● onUpdated(…) Called when points is updated (moved) touchPoints is list of changed points. ● onTouchUpdated(…) Called on any change touchPoints is list of all points. 50
  • 51. MultiPointTouchArea Signals ● onGestureStarted(GestureEvent gesture) Cancel the gesture using gesture.cancel() ● onCanceled(list<TouchPoint> touchPoints) Called when another Item takes over touch handling. Useful for undoing what was done on onPressed. 51
  • 52. Swipe Gestures ● Built into Flickable, ListView ● snapMode: ListView.SnapOneItem The view settles no more than one item away from the first visible item at the time the mouse button is released. ● orientation: ListView.Horizontal 52
  • 53. Pinch Gesture Automatic pinch setup using the target property: Image { id: image source: "qt-logo.jpg" PinchArea { anchors.fill : parent pinch.target : parent pinch.minimumScale : 0.5 pinch.maximumScale : 2.0 pinch.minimumRotation : -3600 pinch.maximumRotation : 3600 pinch.dragAxis : Pinch.XAxis } } 53
  • 54. Pinch Gestures ● Signals for manual pinch handling β—‹ onPinchStarted(PinchEvent pinch) β—‹ onPinchUpdated(PinchEvent pinch) β—‹ onPinchFinished() ● PinchEvent properties: β—‹ point1, point2, center β—‹ rotation β—‹ scale β—‹ accepted Set to false in the onPinchStarted handler if the gesture should not be handled 54
  • 55. Agenda (continued) ● Anchor Layout ● QML Components ● Qt Quick Controls ● Mouse Input ● Touch Input ● Keyboard Input ● Q&A 55
  • 56. Keyboard Input Basic keyboard input is handled in two different use cases: ● Accepting text input β—‹ TextInput and TextEdit ● Navigation between Items β—‹ Changing the focused Item β—‹ Directional (arrow keys), tab and backtab 56
  • 57. Raw Keyboard Input ● Raw key input can be handled by items β—‹ With predefined handlers for commonly used keys β—‹ Full key event information is also available ● The same focus mechanism is used as for ordinary text input β—‹ Enabled by setting the focus property ● Key handling is not an inherited property of items β—‹ Enabled using the Keys attached property ● Key events can be forwarded to other objects β—‹ Enabled using the Keys.forwardTo attached property β—‹ Accepts a list of objects 57
  • 58. Raw Keyboard Input import QtQuick 2.0 Rectangle { width: 400; height: 400; color: "black" Image { id: rocket x: 150; y: 150 source: "../images/rocket.svg" transformOrigin: Item.Center } //keyboard input detection goes here! focus: true } ● Can use predefined handlers for arrow keys: Keys.onLeftPressed: rocket.rotation = (rocket.rotation - 10) % 360 Keys.onRightPressed: rocket.rotation = (rocket.rotation + 10) % 360 ● Or inspect events from all key presses: Keys.onPressed: { event.accepted = true if (event.key == Qt.Key_Left) rocket.rotation = (rocket.rotation - 10) % 360; else if (event.key == Qt.Key_Right) rocket.rotation = (rocket.rotation + 10) % 360; } 58
  • 59. Agenda (continued) ● Anchor Layout ● QML Components ● Qt Quick Controls ● Mouse Input ● Touch Input ● Keyboard Input ● Q&A 59
  • 60. Next Time on Qt for Beginners! Join us as we explore doing more on June 9! 60