Integrated
Computer www.ics.com Updated for Qt 5.5
Solutions
QML Quick Reference
Basic Syntax Qt Quick Object Types (“import QtQuick 2.5”) Qt Quick Window QML
// Simple QML example
Types (“import
Visual Types User Input Positioning QtQuick.Window 2.2”)
import QtQuick 2.5
Rectangle { Accessible Loader Text DoubleValidator Keys TextInput Column
width: 640 AnimatedImage Rectangle Transform Drag MouseArea TouchPoint Flow
AnimatedSprite Repeater Translate DragEvent MouseEvent WheelEvent CloseEvent Screen Window
height: 480 Grid
Text { BorderImage Rotation Window DropArea MultiPointTouchArea LayoutMirroring
anchors.centerIn: parent FontLoader Scale Flickable PinchArea Positioner
text: "Hello, world!" Gradient Screen FocusScope PinchEvent Row Qt Quick Dialogs QML
} GradientStop Sprite IntValidator RegExpValidator Types (“import
Image SpriteSequence KeyEvent Shortcut
MouseArea {
Item SystemPalette KeyNavigation TextEdit QtQuick.Dialogs 1.2”)
anchors.fill: parent
onClicked: {
Qt.quit() States, Transitions and Animations QtTest ColorDialog Dialog FileDialog
} AnchorAnimation ParentChange PathPercent ScaleAnimator UniformAnimator SignalSpy FontDialog MessageDialog
} AnchorChanges Path PathQuad ScriptAction Vector3dAnimation TestCase
} AnimationController PathAnimation PathSvg SequentialAnimation ViewTransition
Behavior PathArc PauseAnimation SmoothedAnimation XAnimator
ColorAnimation PathAttribute PropertyAction SpringAnimation YAnimator
Qt Quick Layouts QML
QML Basic Types NumberAnimation PathCubic PropertyAnimation State Types (“import
OpacityAnimator PathCurve PropertyChanges StateChangeScript QtQuick.Layouts 1.2”)
ParallelAnimation PathInterpolator RotationAnimation StateGroup
bool double enumeration
ParentAnimation PathLine RotationAnimator Transition
int list real ColumnLayout GridLayout
string url var Model/View Layout RowLayout
Graphical Effects Convenience Canvas
GridView VisualDataGroup Flipable Binding Canvas
ListElement VisualDataModel GridMesh Connections CanvasGradient
Qt Quick Basic Types ListModel VisualItemModel ShaderEffect FontMetrics CanvasImageData Other QML Modules
(“import QtQuick 2.4”) ListView XmlListModel ShaderEffectSource OpenGLInfo CanvasPixelArray
import Enginio 1.0
Package XmlRole TextMetrics Context2D
import Qt3D 2.0
PathView Timer TextMetrics
color date font import QtAudioEngine 1.0
WorkerScript import QtBluetooth 5.2
matrix4x4 point quaternion
rect size vector2d import QtCanvas3D 1.0
vector3d vector4d Qt Quick Particles QML Types Qt Quick Controls QML Types import QtQuick.Extras 1.4
import QtGraphicalEffects 1.0
(“import QtQuick.Particles 2.0”) (“import QtQuick.Controls 1.4”) import QtLocation 5.3
import QtMultimedia 5.4
Qt Quick XmlListModel Affector GroupGoal Shape Action MenuBar StatusBar import QtNfc 5.2
QML Types (“import Age ImageParticle SpriteGoal ApplicationWindow MenuItem Switch import QtPositioning 5.2
QtQuick.XmlListModel 2.0”) AngleDirection ItemParticle TargetDirection BusyIndicator MenuSeparator Tab import QtQml.StateMachine 1.0
Attractor LineShape TrailEmitter Button ProgressBar TabView import QtQuick.Controls.Styles 1.4
CumulativeDirection MaskShape Turbulence Calendar RadioButton TableView import QtQuick.LocalStorage 2.0
XmlListModel XmlRole CustomParticle Particle Wander CheckBox ScrollView TableViewColumn import QtSensors 5.0
Direction ParticleGroup ComboBox Slider TextArea import QtTest 1.1
EllipseShape ParticlePainter ExclusiveGroup SpinBox TextField import QtWebChannel 1.0
Emitter ParticleSystem GroupBox SplitView ToolBar import QtWebEngine 1.0
Friction PointDirection Label Stack ToolButton import QtWebKit 2.0 (deprecated)
Gravity RectangleShape Menu StackView TreeView import QtWebSockets 1.0
StackViewDelegate import QtWinExtras 1.0
import QtQml.Models 2.2
Qt 5.5.0, 14-Dec-2015 Copyright © 2015 Integrated Computer Solutions, Inc. Page 1 of 2
Integrated
Computer www.ics.com Updated for Qt 5.5
Solutions
QML Item Properties QML Program Options Debugging
Usage: qml [options] [files]
Functions
activeFocus anchors.margins childrenRect.height layer.mipmap states
activeFocusOnTab anchors.right childrenRect.width layer.sampleName transform General Options: console.assert
anchors anchors.rightMargin childrenRect.x layer.smooth transformOrigin -h, -help...................................Print this usage information and exit console.count
anchors.alignWhenCentered anchors.top childrenRect.y layer.sourceRect transitions -v, -version...............................Print the version information and exit console.debug
anchors.baseline anchors.topMargin clip layer.textureSize visible -apptype [core|gui|widget] ......Select which application class to use console.error
anchors.baselineOffset anchors.verticalCenter data layer.wrapMode visibleChildren Default is gui console.exception
anchors.bottom anchors.verticalCenterOffset enabled objectName width -quiet ......................................Suppress all output console.info
anchors.bottomMargin antialiasing focus opacity x -I [path] ...................................Prepend the given path to the import paths console.log
anchors.centerIn baselineOffset height parent y -f [file] ..................................... Load the given file as a QML file console.profileEnd
anchors.fill children implicitHeight resources z -config [file] .............................Load the given file as the configuration file console.time
anchors.horizontalCenter implicitWidth rotation -- ............................................Arguments after this one are ignored by the console.timeEnd
anchors.horizontalCenterOffset layer.effect scale launcher, but may be used within the QML console.trace
anchors.left layer.enabled smooth application console.warn
anchors.leftMargin layer.format state
Debugging options:
-verbose .................................Print information about what QML is doing, console.error
like specific file URLs being loaded print
-translation [file] ......................Load the given file as the translations file
QML Global Object -dummy-data [directory] .........Load QML files from the given directory as QML JavaScript
JavaScript Objects Qt Object formatTime() qsTr() rect()
context properties Debugger Options
-slow-animations ....................Run all animations in slow motion
hsla() qsTrld() resolvedUrl()
and Functions application -fixed-animations ....................Run animations off animation tick rather Run application with
include() qsTrldNoOp() rgba()
DOMException atob() than wall time option -qmljsdebugger=port:
inputMethod qsTrNoOp() size()
QT_TRANSLATE_NOOP() binding() isQtObject() qsTranslate() tint() Can make QML files executable on Linux/Unix/POSIX systems by adding port from[,port to]
QT_TRID_NOOP() btoa() lighter() qsTranslateNoOp() vector2d() first line like the following: #!/usr/bin/env qml [,host:ip address][,block]
QT_TR_NOOP() colorEqual() locale() quatenion() vector3d()
XMLHttpRequest createComponent() matrix4x4() quit() vector4d()
console createQmlObject() md5() QML Environment Variables
gc() darker() openUrlExternally() QML Item Methods
print() font() platform QML2_IMPORT_PATH QSG_FIXED_ANIMATION_STEP
qsTr() fontFamilies() point() childAt mapFromItem QMLSCENE_DEVICE QSG_PREFER_FULLSIZE_GLYPHCACHE_
qsTrId() formatDate() contains mapToItem QMLSCENE_IMPORT_NAME TEXTURES
qsTranslate() formatDateTime() forceActiveFocus nextItemInFocusChain QML_ANIMATION_TICK_DUMP QSG_RENDERER_BATCH_NODE_THRESHOLD
QML_BAD_GUI_RENDER_LOOP QSG_RENDERER_BATCH_VERTEX_
QML_CHECK_TYPES THRESHOLD
QML_DEBUGGER_VERBOSE QSG_RENDERER_BUFFER_STRATEGY
Qmlscene Options QML Profiler Options QML_DEBUG_LEAK_BACKTRACE QSG_RENDERER_DEBUG
QML_DISABLE_DISTANCEFIELD QSG_RENDER_LOOP
Usage: qmlscene [options] filename qmlprofiler [options] [program] [program-options] QML_DUMP_ERRORS QSG_RENDER_TIMING
Options: qmlprofiler [options] -attach [hostname] QML_FBO_FLUSH_BEFORE_DETACH QSG_SANITY_CHECK
--maximized ........................ Run maximized Options: QML_FBO_OVERLAY QSG_VISUALIZE
--fullscreen .......................... Run fullscreen -help ............................Show this information QML_FORCE_THREADED_RENDERER QV4_FORCE_INTERPRETER
--transparent ....................... Make the window transparent and exit QML_IMPORT_TRACE QV4_MM_AGGRESSIVE_GC
--multisample ...................... Enable multisampling (OpenGL anti-aliasing) -fromStart ....................Record as soon as QML_LEAK_CHECK QV4_MM_MAXBLOCK_SHIFT
--no-version-detection ......... Do not try to detect the version of the .qml file the engine is started QML_LOOKUP_HINTS QV4_MM_MAX_CHUNK_SIZE
--slow-animations ................ Run all animations in slow motion -p number, -port number ...TCP/IP port to use, QML_PARENT_TEST QV4_MM_STATS
--resize-to-root ..................... Resize the window to the size of the root item default is 3768 QML_PARTICLES_DEBUG QV4_NO_INTERPRETER_STACK_SLOT_
--quit .................................... Quit immediately after starting -v, -verbose .................Print debugging output QML_USE_GLYPHCACHE_WORKAROUND ALLOCATION
--disable-context-sharing .....Disable the use of a shared GL context for -version .......................Show the version of QML_VISUAL_TOUCH_DEBUGGING QV4_NO_OPT
QtQuick Windows qmlprofiler and exit QML_XHR_DUMP QV4_NO_REGALLOC
-I path .................................. Add path to the list of import paths QSG_ANTIALIASING_METHOD QV4_NO_SSA
Commands: QSG_ATLAS_HEIGHT QV4_SHOW_ASM
-B name file ......................... Add a named bundle r, record .......................Switch recording on or off
-translation translationfile .... Set the language to run in QSG_ATLAS_OVERLAY QV4_SHOW_IR
q, quit ...........................Terminate program QSG_ATLAS_SIZE_LIMIT STATECHANGE_DEBUG
QSG_ATLAS_WIDTH
QSG_DISTANCEFIELD_ANTIALIASING
Qt 5.5.0, 14-Dec-2015 Copyright © 2015 Integrated Computer Solutions, Inc. Page 2 of 2