diff options
author | Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> | 2018-06-08 14:59:15 +0200 |
---|---|---|
committer | Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> | 2018-06-22 11:59:54 +0000 |
commit | 9fd90b04a33293bac4d840e1f2e10f9c42b3ec13 (patch) | |
tree | f3818eda3eac49e67a0cc8b86f467fe6f21fb2ce /src/quick/util | |
parent | 1ae6ef5ec55aedacb36060e6f7790c082725a21d (diff) |
Doc: Move the code snippets to a separate snippet file
Change-Id: I17671563f2beebe16ae1d08552854eaf44ae43ee
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickimageprovider.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp index 2bb2af4fc0..f7c8724318 100644 --- a/src/quick/util/qquickimageprovider.cpp +++ b/src/quick/util/qquickimageprovider.cpp @@ -261,7 +261,7 @@ void QQuickImageResponse::cancel() an image provider named "colors", and the images to be loaded are "yellow" and "red", respectively: - \snippet imageprovider/imageprovider-example.qml 0 + \snippet imgprovider/imageprovider-example.qml 0 When these images are loaded by QML, it looks for a matching image provider and calls its requestImage() or requestPixmap() method (depending on its @@ -272,25 +272,14 @@ void QQuickImageResponse::cancel() requested by the above QML. This implementation dynamically generates QPixmap images that are filled with the requested color: - \snippet imageprovider/imageprovider.cpp 0 - \codeline - \snippet imageprovider/imageprovider.cpp 1 + \snippet imgprovider/imageprovider.cpp 0 To make this provider accessible to QML, it is registered with the QML engine with a "colors" identifier: - \code - int main(int argc, char *argv[]) - { - ... - - QQuickView view; - QQmlEngine *engine = view.engine(); - engine->addImageProvider(QLatin1String("colors"), new ColorPixmapProvider); - - ... - } - \endcode + \snippet imgprovider/imageprovider.cpp 1 + \codeline + \snippet imgprovider/imageprovider.cpp 2 Now the images can be successfully loaded in QML: |