summaryrefslogtreecommitdiffstats
path: root/doc/src/examples/qml-examples.qdoc
blob: c8a74032b47efefb7ae3a521368883d8ce1a2bf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in a
** written agreement between you and Nokia.
**
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \title Animation: Basics
    \example declarative/animation/basics

    This example shows how to create and combine \l{QML Animation}{animations} in QML.

    \table
    \row
    \o \image qml-coloranim-example.png
    \row
    \o color-animation.qml
    \endtable

    \table
    \row
    \o \image qml-propertyanim-example.png
    \row
    \o property-animation.qml
    \endtable
*/

/*!
    \title Animation: Behaviors
    \example declarative/animation/behaviors

    This example shows how to use QML behaviors. 

    \image qml-behaviors-example.png
*/

/*!
    \title Animation: Easing 
    \example declarative/animation/easing

    This example shows the different easing modes available for \l{QML Animation}{animations}.

    \image qml-easing-example.png
*/

/*!
    \title Animation: States
    \example declarative/animation/states

    These examples show how to use \l{States}{states} and \l{Transitions}{transitions}.

    The \c states.qml example shows how an item can change between states, and \c transitions.qml
    shows how these state changes can be animated.

    \table
    \row
    \o \image qml-states-example.png
    \row
    \o states.qml
    \endtable

    \table
    \row
    \o \image qml-transitions-example.png
    \row
    \o transitions.qml
    \endtable
*/

/*!
    \title Image Elements: Border Image
    \example declarative/imageelements/borderimage

    These examples show how to use the BorderImage element.

    \table
    \row
    \o \image qml-borderimage-example.png
    \row
    \o borderimage.qml
    \endtable

    \table
    \row
    \o \image qml-borderimage-shadows-example.png
    \row
    \o shadows.qml
    \endtable
*/

/*!
    \title Image Elements: Image
    \example declarative/imageelements/image

    This example shows how to use the \l Image element and its \l{Image::fillMode}{fillModes}.

    \image qml-image-example.png
*/

/*!
    \page declarative-cppextensions-reference.html
    \title C++ Extensions: Reference examples

    These examples show how QML can be extended from C++ in various ways. 
    
    The code for these examples is used throughout the \l {Extending QML in C++} reference
    documentation, which highlights the main principles demonstrated in each example.

    Furthermore, here are additional pages that discuss each example in detail:

    \list
    \o \l {declarative/cppextensions/referenceexamples/adding}{Adding Types}
    \o \l {declarative/cppextensions/referenceexamples/properties}{Object and List Property Types}
    \o \l {declarative/cppextensions/referenceexamples/coercion}{Inheritance and Coercion}
    \o \l {declarative/cppextensions/referenceexamples/default}{Default Property}
    \o \l {declarative/cppextensions/referenceexamples/grouped}{Grouped Properties}
    \o \l {declarative/cppextensions/referenceexamples/attached}{Attached Properties}
    \o \l {declarative/cppextensions/referenceexamples/signal}{Signal Support}
    \o \l {declarative/cppextensions/referenceexamples/valuesource}{Property Value Source}
    \o \l {declarative/cppextensions/referenceexamples/binding}{Binding}
    \endlist

    \note These examples all print information to the console to demonstrate the concepts presented.
    Ensure that you are able to view the application output when running these examples.
    For example, the dbgView tool on Windows can be used to display application output.
*/

/*!
    \title C++ Extensions: Plugins
    \example declarative/cppextensions/plugins

    This example shows how to create a C++ plugin extension by subclassing QDeclarativeExtensionPlugin.

    \image qml-plugins-example.png
*/

/*!
    \title LayoutItem
    \example declarative/cppextensions/qgraphicslayouts/layoutitem

    This example show how to use the LayoutItem element to integrate QML items into an existing 
    \l{Graphics View Framework}{Graphics View}-based application.

    \image qml-layoutitem-example.png
*/
/*!
    \title QGraphicsGridLayout
    \example declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout

    This example shows how to use QGraphicsGridLayout to lay out QML items. This is 
    useful if you need to integrate Qt \l{Graphics View Framework}{Graphics View} layouts with
    QML.

    \image qml-qgraphicsgridlayout-example.png
*/
/*!
    \title QGraphicsLinearLayout
    \example declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout

    This example shows how to use QGraphicsLinearLayout to lay out QML items. This is 
    useful if you need to integrate Qt \l{Graphics View Framework}{Graphics View} layouts with
    QML.
    
    \image qml-qgraphicslinearlayout-example.png
*/
/*!
    \page declarative-cppextensions-qgraphicslayouts.html
    \title C++ Extensions: QGraphicsLayouts

    These examples show how to integrate \l{Graphics View Framework}{Graphics View}
    layout components with QML:

    \list
    \o \l{declarative/cppextensions/qgraphicslayouts/layoutitem}{LayoutItem}
    \o \l{declarative/cppextensions/qgraphicslayouts/qgraphicsgridlayout}{QGraphicsGridLayout}
    \o \l{declarative/cppextensions/qgraphicslayouts/qgraphicslinearlayout}{QGraphicsLinearLayout}
    \endlist
*/

/*!
    \title C++ Extensions: QWidgets
    \example declarative/cppextensions/qwidgets

    This example shows how to embed QWidget-based objects into QML using QGraphicsProxyWidget.

    \image qml-qwidgets-example.png
*/

/*!
    \title C++ Extensions: Image Provider
    \example declarative/cppextensions/imageprovider

    This examples shows how to use QDeclarativeImageProvider to serve images asynchronously
    into a QML item.
*/

/*!
    \title C++ Extensions: Network access manager factory
    \example declarative/cppextensions/networkaccessmanagerfactory

    This example shows how to use QDeclarativeNetworkAccessManagerFactory to create a QNetworkAccessManager
    with a proxy.
*/

/*!
    \title Internationlization
    \example declarative/i18n

    This example shows how to enable text translation in QML.

    \image qml-i18n-example.png
*/

/*!
    \title Positioners
    \example declarative/positioners

    This example shows how to use positioner elements such as \l Row, \l Column,
    \l Grid and \l Flow.

    \image qml-positioners-example.png
*/

/*!
    \title Key Interaction: Focus
    \example declarative/keyinteraction/focus

    This example shows how to handle keyboard input and focus in QML.

    \image qml-focus-example.png
*/

/*!
    \title Models and Views: AbstractItemModel
    \example declarative/modelviews/abstractitemmodel

    This example shows how to use a QAbstractItemModel subclass as a model in QML.

    \image qml-abstractitemmodel-example.png
*/

/*!
    \title Models and Views: GridView
    \example declarative/modelviews/gridview

    This example shows how to use the GridView element.

    \image qml-gridview-example.png
*/

/*!
    \title Models and Views: ListView
    \example declarative/modelviews/listview

    These examples show how to use the ListView element.

    \table
    \row
    \o \image qml-listview-dynamiclist-example.png
    \row
    \o dynamiclist.qml
    \endtable

    \table
    \row
    \o \image qml-listview-expandingdelegates-example.png
    \row
    \o expandingdelegates.qml
    \endtable

    \table
    \row
    \o \image qml-listview-highlight-example.png
    \row
    \o highlight.qml
    \endtable

    \table
    \row
    \o \image qml-listview-highlightranges-example.png
    \row
    \o highlightranges.qml
    \endtable

    \table
    \row
    \o \image qml-listview-sections-example.png
    \row
    \o sections.qml
    \endtable
*/

/*!
    \title Models and Views: Object ListModel
    \example declarative/modelviews/objectlistmodel

    This example shows how to use a QList<QObject*> as a model in QML.

    \image qml-objectlistmodel-example.png
*/

/*!
    \title Models and Views: Package
    \example declarative/modelviews/package

    This example shows how to use the \l Package element.

    \image qml-package-example.png
*/

/*!
    \title Models and Views: Parallax
    \example declarative/modelviews/parallax

    This example shows how to combine and switch between views.

    \image qml-parallax-example.png
*/

/*!
    \title Models and Views: String ListModel
    \example declarative/modelviews/stringlistmodel

    This example shows how to use a QStringList as a model in QML.

    \image qml-stringlistmodel-example.png
*/

/*!
    \title Models and Views: VisualItemModel
    \example declarative/modelviews/visualitemmodel

    This example shows how to use the VisualItemModel element.

    \image qml-visualitemmodel-example.png
*/

/*!
    \title Models and Views: WebView
    \example declarative/modelviews/webview

    These examples shows how to use the WebView element.

    \table
    \row
    \o \image qml-webview-alert-example.png
    \row
    \o alert.qml
    \endtable

    \table
    \row
    \o \image qml-webview-autosize-example.png
    \row
    \o autosize.qml
    \endtable

    \table
    \row
    \o \image qml-webview-googlemaps-example.png
    \row
    \o googlemaps.qml
    \endtable

    \table
    \row
    \o \image qml-webview-inlinehtml-example.png
    \row
    \o inlinehtml.qml
    \endtable

    \table
    \row
    \o \image qml-webview-newwindows-example.png
    \row
    \o newwindows.qml
    \endtable
*/

/*!
    \title SQL Local Storage
    \example declarative/sqllocalstorage

    This example shows how to use the SQL Local Storage API in QML.
*/

/*!
    \title Text: Fonts
    \example declarative/text/fonts

    These examples show how to discover available fonts from QML and manipulate
    text in various ways.

    \table
    \row
    \o \image qml-fonts-availableFonts-example.png
    \row
    \o availableFonts.qml
    \endtable

    \table
    \row
    \o \image qml-fonts-banner-example.png
    \row
    \o banner.qml
    \endtable

    \table
    \row
    \o \image qml-fonts-fonts-example.png
    \row
    \o fonts.qml
    \endtable

    \table
    \row
    \o \image qml-fonts-hello-example.png
    \row
    \o hello.qml
    \endtable
*/

/*!
    \title Text: Text Selection
    \example declarative/text/textselection

    This example shows how text selection, copy and paste operations
    can be implemented on top of the TextEdit element.

    \image qml-textselection-example.png
*/

/*!
    \title Threading: Threaded ListModel
    \example declarative/threading/threadedlistmodel

    This example shows how to use a ListModel from multiple threads using
    WorkerScript.
*/

/*!
    \title Threading: WorkerScript
    \example declarative/threading/workerscript

    This example shows how to use the WorkerScript element for threading in QML.
*/

/*!
    \title Toys: Clocks
    \example declarative/toys/clocks

    This example displays a set of clocks with different times for different cities.
    Each clock is created by combining \l Image elements with \l Rotation transforms 
    and \l SpringFollow animations.

    \image qml-clocks-example.png
*/

/*!
    \title Toys: Corkboards
    \example declarative/toys/corkboards

    This example presents a flickable set of interactive corkboards. It is created
    through a combination of elements like \l ListModel, \l Repeater and \l TextEdit
    together with rotation and scaling transforms, animation and mouse interaction.

    \image qml-corkboards-example.png
*/

/*!
    \title Toys: Dynamic Scene
    \example declarative/toys/dynamicscene

    This example presents an interactive drag-and-drop scene. It demonstrates
    how to use QML's \l{Dynamic Object Creation} support to dynamically create and
    destroy objects.

    \image qml-dynamicscene-example.png
*/

/*!
    \title Toys: Tic-Tac-Toe
    \example declarative/toys/tic-tac-toe

    This example presents a simple implementation of Tic Tac Toe.

    \image qml-tic-tac-toe-example.png
*/

/*!
    \title Toys: TV Tennis
    \example declarative/toys/tvtennis

    This example shows how to use animation components such as \l SpringFollow,
    \l SequentialAnimation and \l PropertyAction to create a game of TV tennis.

    \image qml-tvtennis-example.png
*/

/*!
    \title Touch Interaction: Gestures
    \example declarative/touchinteraction/gestures

    This example shows how to use the GestureArea element.
*/

/*!
    \title Touch Interaction: MouseArea
    \example declarative/touchinteraction/mousearea

    This example shows how to use the MouseArea element to access information
    about mouse input.

    \image qml-mousearea-example.png
*/

/*!
    \title UI Components: Dial
    \example declarative/ui-components/dialcontrol

    This example shows how to create a dial-type control. It combines
    \l Image elements with \l Rotation transforms and \l SpringFollow animations
    to produce an interactive speedometer-type dial.

    \image qml-dialcontrol-example.png
*/


/*!
    \title UI Components: Flipable
    \example declarative/ui-components/flipable

    This example shows how to use the \l Flipable element.

    \image qml-flipable-example.png
*/

/*!
    \title UI Components: Progress Bars
    \example declarative/ui-components/progressbar

    This example shows how to create a progress bar.

    \image qml-progressbar-example.png
*/

/*!
    \title UI Components: Scroll Bar
    \example declarative/ui-components/scrollbar

    This example shows how to create scroll bars for a \l Flickable element
    using the \l {Flickable::visibleArea.xPosition}{Flickable::visibleArea}
    properties.

    \image qml-scrollbar-example.png
*/

/*!
    \title UI Components: Search Box
    \example declarative/ui-components/searchbox

    This example shows how to combine TextInput, FocusScope and BorderImage
    elements to display multiple text input fields.

    \image qml-searchbox-example.png
*/

/*!
    \title UI Components: Slide Switch
    \example declarative/ui-components/slideswitch

    This example shows how to create a slide switch control.

    \image qml-slideswitch-example.png
*/

/*!
    \title UI Components: Spinner
    \example declarative/ui-components/spinner

    This example shows how to create a spinner-type component using the PathView element.

    \image qml-spinner-example.png
*/

/*!
    \title UI Components: Tab Widget
    \example declarative/ui-components/tabwidget

    This example shows how to create a tab widget.

    \image qml-tabwidget-example.png
*/

/*!
    \title XML: XMLHttpRequest
    \example declarative/xml/xmlhttprequest

    This example shows how to use the \l XmlHttpRequest API in QML.

    \image qml-xmlhttprequest-example.png
*/