0% found this document useful (0 votes)
528 views

QML Quick Reference: User Input Visual Types

QML cheatsheet

Uploaded by

vishnu vardhan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
528 views

QML Quick Reference: User Input Visual Types

QML cheatsheet

Uploaded by

vishnu vardhan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Integrated

Computer www.ics.com Updated for Qt 5.12


Solutions

QML Quick Reference

Basic Syntax Qt Quick Object Types (“import QtQuick 2.12”) Qt Quick Layouts QML Types
// Simple QML example
(“import QtQuick.Layouts 1.12”)
User Input
import QtQuick 2.12 Visual Types DoubleValidator FocusScope MultiPoint PointerEvent ColumnLayout Layout StackLayout
Rectangle {
Accessible Item SpriteSequence Drag HandlerPoint Handler PointerHandler GridLayout RowLayout
width: 640
height: 480 AnimatedImage ItemLoader SystemPalette DragEvent HoverHandler MultiPoint RegExpValidator
Text { AnimatedSprite Rectangle Text DragHandler IntValidator TouchArea Shortcut
anchors.centerIn: parent BorderImage Repeater TextEdit DropArea KeyEvent PinchArea SinglePoint Other QML Modules
text: “Hello, world!” FontLoader Rotation TextInput EnterKey KeyNavigation PinchEvent Handler
Qt.labs.calendar 1.0 QtQuick.Controls.
} Gradient Scale Transform EventPoint Keys PointHandler TextEditText
Qt.labs. Imagine 2.12
MouseArea { GradientStop Screen Translate EventTouchPoint MouseArea PointerDevice Input
folderlistmodel 2.12 QtQuick.Controls.
anchors.fill: parent Image Sprite Window Flickable MouseEvent PointerDevice TouchPoint
Qt.labs.location 1.0 Material 2.12
onClicked: { Flipable Handler WheelEvent
Qt.labs.platform 1.1 QtQuick.Controls.
Qt.quit() Positioning Canvas Qt.labs. Styles 1.4
Model/View Convenience
} Qt Test qmlmodels 1.0 QtQuick.Controls.
} Column Canvas GridView VisualData Binding Loader Qt.labs.settings 1.1 Styles.Flat 1.0
} Flow CanvasGradient ListElement Group Connections Matrix4x4 Sequence
Qt.labs. QtQuick.Controls.
Grid CanvasImageData ListModel VisualDataModel FontMetrics OpenGLInfo SignalSpy
sharedimage 1.0 Universal 2.12
LayoutMirroring CanvasPixelArray ListView VisualItemModel GraphicsInfo TextMetrics TestCase
Qt.labs.wave QtQuick.Dialogs 1.3
QML Basic Types Positioner Context2D Package XmlListModel ItemGrab Timer TouchEvent
frontmesh 1.12 QtQuick.Dialogs.
Row TextMetrics PathView XmlRole Result WorkerScript
bool double enumeration Qt3D.Animation 2.12 Private 1.1
int list real States, Transitions and Animations Qt3D.Core 2.12 QtQuick.Extras 1.4
Graphical
string url var Qt3D.Extras 2.12 QtQuick.Layouts 1.12
AnchorAnimation ParentAnimation PathLine RotationAnimation State Effects Qt3D.Input 2.12 QtQuick.Local
AnchorChanges ParentChange PathPercent RotationAnimator StateChangeScript BorderImage Qt3D.Logic 2.12 Storage 2.12
Qt Quick Basic Types Animation Path PathQuad ScaleAnimator StateGroup BorderImage Qt3D.Render 2.12 QtQuick.
(“import QtQuick 2.12”) Controller PathAnimation PathSvg ScriptAction Transition Mesh QtAudioEngine 1.1 Particles 2.12
Behavior PathArc PauseAnimation Sequential UniformAnimator Flipable QtBluetooth 5.12 QtQuick.Private
color date font ColorAnimation PathAttribute PropertyAction Animation Vector3dAnimation GridMesh QtCanvas3D 1.1 Widgets 1.1
matrix4x4 point quaternion NumberAnimation PathCubic Property Smoothed ViewTransition ShaderEffect QtCharts 2.3 QtQuick.Scene
rect size vector2d OpacityAnimator PathCurve Animation Animation XAnimator ShaderEffect QtData 2D 2.12
vector3d vector4d ParallelAnimation PathInterpolator PropertyChanges SpringAnimation YAnimator Source Visualization 1.3 QtQuick.Shapes 1.12
QtGamepad 1.12 QtQuick.
Qt Quick Controls QML Types QtGraphical Templates 2.12
Qt Quick XmlListModel Qt Quick Particles QML Types
Effects 1.0 QtQuick.VirtualKey
QML Types (“import (“import QtQuick.Particles 2.12”) (“import QtQuickControls 1.6” and “import QtQuick.Controls 2.12”) QtLocation 5.12 board.Settings 2.2
QtQuick.XmlListModel 2.12”) AbstractButton(2) Dialog(2) Page(2) StackView TextArea QtMultimedia 5.12 QtQuick.VirtualKey
Affector LineShape Action Dialog PageIndicator(2) StackView TextField QtNfc 5.12 board.Styles 2.2
XmlListModel XmlRole QtPositioning 5.12 QtQuick.Window 2.12
Age MaskShape ActionGroup(2) ButtonBox(2) Pane(2) Delegate(1) ToolBar
AngleDirection Particle Application Drawer(2) Popup(2) StatusBar(1) ToolButton QtPurchasing 1.12 QtQuick.XmlList
Window Exclusive ProgressBar SwipeDelegate(2) ToolSeparator(2) QtQml 2.12 Model 2.12
Qt Quick Window QML Types Attractor ParticleGroup
QtQml.Models 2.12 QtRemote
CumulativeDirection ParticlePainter BusyIndicator Group(1) RadioButton SwipeView(2) ToolTip(2)
(“import QtQuick.Window 2.12”) Button Frame(2) RadioDelegate(2) Switch TreeView(1) QtQml.Remote Objects 5.12
CustomParticle ParticleSystem
Direction PointDirection ButtonGroup(2) GroupBox RangeSlider(2) Switch Tumbler(2) Objects 1.0 QtScxml 5.8
CloseEvent Window
EllipseShape RectangleShape Calendar(1) ItemDelegate(2) RoundButton(2) Delegate(2) QtQml.State QtSensors 5.12
Screen
Emitter Shape CheckBox Label ScrollBar(2) Tab(1) Notes: Machine 1.12 QtTest 1.12
Friction SpriteGoal CheckDelegate(2) Menu ScrollIndicator(2) TabBar(2) (1) - Qt Quick QtQuick 2.12 QtWayland.
Qt Quick Dialogs QML Types Gravity TargetDirection ComboBox MenuBar ScrollView TabButton(2) Controls 1.x QtQuick.Controls 1.6 Compositor 1.3
(“import QtQuick.Dialogs 1.3”) GroupGoal TrailEmitter Container(2) MenuBarItem(2) Slider TabView(1) (deprecated) only. QtQuick. QtWebChannel 1.0
ImageParticle Turbulence Control(2) MenuItem SpinBox TableView (2) - Qt Quick Controls 2.12 QtWebEngine 1.8
ColorDialog FileDialog Message ItemParticle Wander DelayButton(2) MenuSeparator SplitView(1) TableView Controls 2.x only. QtQuick.Controls. QtWebSockets 1.1
Dialog FontDialog Dialog Dial(2) Overlay(2) Stack(1) Column(1) Fusion 2.12 QtWebView 1.1

Qt 5.12.0 29-Nov-2018 Copyright © 2016-2018 Integrated Computer Solutions, Inc Page 1 of 2


QML Item Properties QML Program Options QML
activeFocus anchors.left childrenRect.width layer.samplerName state Usage: qml [options] [files]
JavaScript
activeFocusOnTab anchors.leftMargin childrenRect.x layer.samples states General Options: Debugger Options
anchors anchors.margins childrenRect.y layer.smooth transform -h, -help.................................... Print this usage information and exit
anchors.align anchors.right clip layer.sourceRect transformOrigin -v, -version............................... Print the version information and exit
Run application with option
WhenCentered anchors.rightMargin data layer.textureSize transitions -apptype [core|gui|widget]....... Select which application class to use
anchors.baseline anchors.top enabled layer.textureMirroring visible Default is gui -qmljsdebugger=port:
anchors.baselineOffset anchors.topMargin focus layer.wrapMode visibleChildren -quiet........................................ Suppress all output port from[,port to] [,host:
anchors.bottom anchors.verticalCenter height objectName width -I [path]..................................... Prepend the given path to the import paths ip address][,block]
anchors.bottomMargin anchors.vertical implicitHeight opacity x -f [file]....................................... Load the given file as a QML file
anchors.centerIn CenterOffset implicitWidth parent y -config [file].............................. Load the given file as the configuration file
anchors.fill antialiasing layer.effect resources z -- ................................................... Arguments after this one are ignored by
anchors.horizontalCenter baselineOffset layer.enabled rotation the launcher, but may be used Debugging
anchors.horizontal children layer.format scale within the QML application Functions
CenterOffset childrenRect.height layer.mipmap smooth GL options:
-desktop................................... Force use of desktop GL
-gles......................................... Force use of GLES console.assert
QML Global Object -software.................................. Force use of software rendering console.count
-scaling..................................... Enable High DPI scaling console.debug
Qt Object -no-scaling............................... Disable High DPI scaling console.error
application createQml formatTime() matrix4x4() qsTrldNoOp() resolvedUrl() Debugging options: console.exception
atob() Object() hsla() md5() qsTrNoOp() rgba() -verbose................................... Print information about what QML is doing, console.info
binding() darker() hsva openUrl qsTranslate() size() like specific file URLs being loaded console.log
btoa() exit() include() Externally() qsTranslate styleHints -translation [file]....................... Load the given file as the translations file console.profile
callLater() font() inputMethod platform NoOp() tint() -dummy-data [directory].......... Load QML files from the given directory console.profileEnd
colorEqual() fontFamilies() isQtObject() point() quaternion() vector2d() as context properties console.time
create formatDate() lighter() qsTr() quit() vector3d() -slow-animations...................... Run all animations in slow motion console.timeEnd
Component() formatDateTime() locale() qsTrld() rect() vector4d() -fixed-animations..................... Run animations off animation tick console.trace
rather than wall time console.warn
Qmlscene Options QML Item Methods print
Can make QML files executable on Linux/Unix/POSIX systems
by adding first line like the following: #!/usr/bin/env qml
Usage: qmlscene [options] filename childAt mapFromGlobal
Options: contains mapFromItem
--maximized.............................Run maximized forceActiveFocus mapToItem QML Environment Variables
--fullscreen...............................Run fullscreen grabToImage nextItemInFocusChain
--transparent............................Make the window transparent QML2_IMPORT_PATH _WORKAROUND QSG_RENDERER_BATCH
--multisample...........................Enable multisampling QMLSCENE_DEVICE QML_VISUAL_TOUCH _NODE_THRESHOLD
(OpenGL anti-aliasing) QML Profiler Options QMLSCENE_IMPORT_NAME _DEBUGGING QSG_RENDERER_BATCH
--core-profile............................Request a core profile QML_ANIMATION_TICK_DUMP QML_XHR_DUMP _VERTEX_THRESHOLD
OpenGL context qmlprofiler [options] [program] [program-options] QML_BAD_GUI_RENDER_LOOP QSG_ANTIALIASING_METHOD QSG_RENDERER_BUFFER
--no-version-detection................Do not try to detect the version qmlprofiler [options] -a,-attach <hostname> QML_CHECK_TYPES QSG_ATLAS_HEIGHT _STRATEGY
of the .qml file
Options: QML_DEBUG_LEAK QSG_ATLAS_NO_BGRA QSG_RENDERER_DEBUG
--slow-animations....................Run all animations in slow motion
-p,--port <number>....... TCP/IP port to use, _BACKTRACE _WORKAROUNDS QSG_RENDER_LOOP
--resize-to-root ........................Resize the window to the size of the
default is 3768 QML_DISABLE_DISK_CACHE QSG_ATLAS_OVERLAY QSG_RENDER_TIMING
root item
-o,--output <file>........... Save tracing data in <file> QML_DISABLE_DISTANCEFIELD QSG_ATLAS_SIZE_LIMIT QSG_TRANSIENT_IMAGES
--quit.........................................Quit immediately after starting
--record <on|off>.............Controls whether recording QML_DUMP_ERRORS QSG_ATLAS_TRANSIENT QSG_VISUALIZE
--disable-context-sharing .......Disable the use of a shared GL
starts immediately QML_FBO_FLUSH_BEFORE _IMAGE_THRESHOLD QT_D3D_ADAPTER_INDEX
context for QtQuick Windows
--include <feature,...>..... Comma-separated list _DETACH QSG_ATLAS_USE_BGRA QT_HIGHDPI_DISABLE_2X
--desktop..................................Force use of desktop GL
QML_FBO_OVERLAY _FALLBACK _IMAGE_LOADING
--gles ........................................Force use of GLES of features to include
QML_FORCE_DISK_CACHE QSG_ATLAS_WIDTH QT_QPA_PLATFORM
--software.................................Force use of software rendering when recording
QML_FORCE_THREADED QSG_DISTANCEFIELD QT_QUICK_BACKEND
--scaling ...................................Enable high DPI scaling --exclude <feature,...>.... Comma-separated list
_RENDERER _ANTIALIASING QT_QUICK_CORE_PROFILE
--no-scaling .............................Disable high DPI scaling of features to exclude
QML_IMPORT_TRACE QSG_ENABLE_COMPRESSED QT_QUICK_MULTISAMPLE
--verbose..................................Print version and graphical when recording QML_LEAK_CHECK _ATLAS QV4_FORCE_INTERPRETER
diagnostics for the run-time --interactive................... Manually control the QML_LOOKUP_HINTS QSG_FIXED_ANIMATION_STEP QV4_MM_AGGRESSIVE_GC
--apptype [gui|widgets]............Select which application class to use. recording from the
Default is widgets. QML_NO_TOUCH QSG_INFO QV4_PROFILE_WRITE
command line _COMPRESSION QSG_NO_DEPTH_BUFFER _PERF_MAP
--textrendertype [gui|native]....Select the default render type for
--verbose....................... Print debugging output QML_PARENT_TEST QSG_NO_STENCIL_BUFFER QV4_SHOW_ASM
text-like elements
-h,--help........................ Displays help information QML_PARTICLES_DEBUG QSG_OPENGL_DEBUG QV4_SHOW_BYTECODE
-I path .......................................Add path to the list of import paths
-v,--version.................... Displays version QML_SHOW_UNIT_STATS QSG_PREFER_FULLSIZE QV4_SHOW_ESCAPING_VARS
-P path......................................Add path to the list of plugin paths
-translation translationfile........Set the language to run in information QML_USE_GLYPHCACHE _GLYPHCACHE_TEXTURES STATECHANGE_DEBUG

Qt 5.12.0 29-Nov-2018 Copyright © 2016-2018 Integrated Computer Solutions, Inc. Page 2 of 2

You might also like