diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-29 16:41:59 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-29 16:52:58 +0100 |
commit | b684ba219493fb7b0108ae367d6d033aaa28053b (patch) | |
tree | f1fec8922da198e231416b50ef8f441ef6db065b /examples | |
parent | 97a5cf86345fd72cdff83c03664c19a8f5cdf79a (diff) | |
parent | 8354851b628ebae567a9125cbd0ba69268470c1b (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
dependencies.yaml
Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
Diffstat (limited to 'examples')
20 files changed, 98 insertions, 23 deletions
diff --git a/examples/quick/quickwidgets/quickwidget/fbitem.cpp b/examples/quick/quickwidgets/quickwidget/fbitem.cpp index 95ff2da2e0..3e98168dcf 100644 --- a/examples/quick/quickwidgets/quickwidget/fbitem.cpp +++ b/examples/quick/quickwidgets/quickwidget/fbitem.cpp @@ -49,9 +49,9 @@ ****************************************************************************/ #include "fbitem.h" -#include <QtGui/QOpenGLFramebufferObject> -#include <QtGui/QOpenGLContext> -#include <QtGui/QOpenGLFunctions> +#include <QOpenGLFramebufferObject> +#include <QOpenGLContext> +#include <QOpenGLFunctions> #include <QtCore/QDebug> #if QT_CONFIG(opengl) diff --git a/examples/quick/scenegraph/fboitem/fboinsgrenderer.cpp b/examples/quick/scenegraph/fboitem/fboinsgrenderer.cpp index 8ba5bddb2a..1c7be258be 100644 --- a/examples/quick/scenegraph/fboitem/fboinsgrenderer.cpp +++ b/examples/quick/scenegraph/fboitem/fboinsgrenderer.cpp @@ -51,7 +51,7 @@ #include "fboinsgrenderer.h" #include "logorenderer.h" -#include <QtGui/QOpenGLFramebufferObject> +#include <QOpenGLFramebufferObject> #include <QtQuick/QQuickWindow> #include <qsgsimpletexturenode.h> diff --git a/examples/quick/scenegraph/openglunderqml/squircle.cpp b/examples/quick/scenegraph/openglunderqml/squircle.cpp index 828857fe24..1c4563baa5 100644 --- a/examples/quick/scenegraph/openglunderqml/squircle.cpp +++ b/examples/quick/scenegraph/openglunderqml/squircle.cpp @@ -51,8 +51,8 @@ #include "squircle.h" #include <QtQuick/qquickwindow.h> -#include <QtGui/QOpenGLShaderProgram> -#include <QtGui/QOpenGLContext> +#include <QOpenGLShaderProgram> +#include <QOpenGLContext> #include <QtCore/QRunnable> //! [7] diff --git a/examples/quick/scenegraph/openglunderqml/squircle.h b/examples/quick/scenegraph/openglunderqml/squircle.h index c24fdd50c2..ecd92161fc 100644 --- a/examples/quick/scenegraph/openglunderqml/squircle.h +++ b/examples/quick/scenegraph/openglunderqml/squircle.h @@ -52,8 +52,8 @@ #define SQUIRCLE_H #include <QtQuick/QQuickItem> -#include <QtGui/QOpenGLShaderProgram> -#include <QtGui/QOpenGLFunctions> +#include <QOpenGLShaderProgram> +#include <QOpenGLFunctions> diff --git a/examples/quick/scenegraph/textureinthread/threadrenderer.cpp b/examples/quick/scenegraph/textureinthread/threadrenderer.cpp index c364d0b7dd..5fd8037193 100644 --- a/examples/quick/scenegraph/textureinthread/threadrenderer.cpp +++ b/examples/quick/scenegraph/textureinthread/threadrenderer.cpp @@ -54,8 +54,8 @@ #include <QtCore/QMutex> #include <QtCore/QThread> -#include <QtGui/QOpenGLContext> -#include <QtGui/QOpenGLFramebufferObject> +#include <QOpenGLContext> +#include <QOpenGLFramebufferObject> #include <QtGui/QGuiApplication> #include <QtGui/QOffscreenSurface> diff --git a/examples/quick/scenegraph/twotextureproviders/xorblender.cpp b/examples/quick/scenegraph/twotextureproviders/xorblender.cpp index d5881b9adc..667b0bf8c7 100644 --- a/examples/quick/scenegraph/twotextureproviders/xorblender.cpp +++ b/examples/quick/scenegraph/twotextureproviders/xorblender.cpp @@ -52,8 +52,8 @@ #include <QtCore/QPointer> -#include <QtGui/QOpenGLContext> -#include <QtGui/QOpenGLFunctions> +#include <QOpenGLContext> +#include <QOpenGLFunctions> #include <QtQuick/QSGMaterial> #include <QtQuick/QSGTexture> diff --git a/examples/quick/shadereffects/content/shaders/+qsb/blur.frag b/examples/quick/shadereffects/content/shaders/+qsb/blur.frag Binary files differindex 1c79359297..d29b2d4365 100644 --- a/examples/quick/shadereffects/content/shaders/+qsb/blur.frag +++ b/examples/quick/shadereffects/content/shaders/+qsb/blur.frag diff --git a/examples/quick/shadereffects/content/shaders/+qsb/colorize.frag b/examples/quick/shadereffects/content/shaders/+qsb/colorize.frag Binary files differindex 45c5301f31..58bb5aaa8e 100644 --- a/examples/quick/shadereffects/content/shaders/+qsb/colorize.frag +++ b/examples/quick/shadereffects/content/shaders/+qsb/colorize.frag diff --git a/examples/quick/shadereffects/content/shaders/+qsb/genie.vert b/examples/quick/shadereffects/content/shaders/+qsb/genie.vert Binary files differindex dd94129cf7..540cb6a85b 100644 --- a/examples/quick/shadereffects/content/shaders/+qsb/genie.vert +++ b/examples/quick/shadereffects/content/shaders/+qsb/genie.vert diff --git a/examples/quick/shadereffects/content/shaders/+qsb/outline.frag b/examples/quick/shadereffects/content/shaders/+qsb/outline.frag Binary files differindex 470e2bd6e6..633fe0f926 100644 --- a/examples/quick/shadereffects/content/shaders/+qsb/outline.frag +++ b/examples/quick/shadereffects/content/shaders/+qsb/outline.frag diff --git a/examples/quick/shadereffects/content/shaders/+qsb/shadow.frag b/examples/quick/shadereffects/content/shaders/+qsb/shadow.frag Binary files differindex 128af21daa..8059fab6ac 100644 --- a/examples/quick/shadereffects/content/shaders/+qsb/shadow.frag +++ b/examples/quick/shadereffects/content/shaders/+qsb/shadow.frag diff --git a/examples/quick/shadereffects/content/shaders/+qsb/wobble.frag b/examples/quick/shadereffects/content/shaders/+qsb/wobble.frag Binary files differindex 9b27ae87cb..85fb453659 100644 --- a/examples/quick/shadereffects/content/shaders/+qsb/wobble.frag +++ b/examples/quick/shadereffects/content/shaders/+qsb/wobble.frag diff --git a/examples/quick/shapes/content/item18.qml b/examples/quick/shapes/content/item18.qml new file mode 100644 index 0000000000..3774d19bc5 --- /dev/null +++ b/examples/quick/shapes/content/item18.qml @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQuick module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.15 +import QtQuick.Shapes 1.0 + +Rectangle { + color: "lightGray" + + Shape { + anchors.centerIn: parent + width: 200 + height: 100 + + ShapePath { + id: capTest + strokeColor: "black" + strokeWidth: 1 + fillColor: "black" + + PathText { x: 0; y: 100; font.family: "Arial"; font.pixelSize: 150; text: "Qt!" } + } + } +} diff --git a/examples/quick/shapes/content/shapegallery.qml b/examples/quick/shapes/content/shapegallery.qml index 86445e25c2..e5a7c51483 100644 --- a/examples/quick/shapes/content/shapegallery.qml +++ b/examples/quick/shapes/content/shapegallery.qml @@ -130,6 +130,10 @@ Rectangle { name: "Tiger" shapeUrl: "item17.qml" } + ListElement { + name: "Text" + shapeUrl: "item18.qml" + } } property int gridSpacing: 10 diff --git a/examples/quick/shapes/shapes.pro b/examples/quick/shapes/shapes.pro index ff6fa422fb..f99d941804 100644 --- a/examples/quick/shapes/shapes.pro +++ b/examples/quick/shapes/shapes.pro @@ -24,7 +24,8 @@ OTHER_FILES += content/main.qml \ content/item13.qml \ content/item14.qml \ content/item15.qml \ - content/item17.qml + content/item17.qml \ + content/item18.qml target.path = $$[QT_INSTALL_EXAMPLES]/quick/shapes INSTALLS += target diff --git a/examples/quick/shapes/shapes.qrc b/examples/quick/shapes/shapes.qrc index e03c0e8a0a..6de463dd33 100644 --- a/examples/quick/shapes/shapes.qrc +++ b/examples/quick/shapes/shapes.qrc @@ -28,5 +28,6 @@ <file alias="item14.qml">content/item14.qml</file> <file alias="item15.qml">content/item15.qml</file> <file alias="item17.qml">content/item17.qml</file> + <file alias="item18.qml">content/item18.qml</file> </qresource> </RCC> diff --git a/examples/quick/shared/LauncherList.qml b/examples/quick/shared/LauncherList.qml index 9859b5b635..f6001cc681 100644 --- a/examples/quick/shared/LauncherList.qml +++ b/examples/quick/shared/LauncherList.qml @@ -75,6 +75,7 @@ Rectangle { id: launcherList clip: true delegate: SimpleLauncherDelegate{ + required property url url onClicked: root.showExample(url) } model: ListModel {id:myModel} diff --git a/examples/quick/shared/SimpleLauncherDelegate.qml b/examples/quick/shared/SimpleLauncherDelegate.qml index 7f07dea52a..097954cb89 100644 --- a/examples/quick/shared/SimpleLauncherDelegate.qml +++ b/examples/quick/shared/SimpleLauncherDelegate.qml @@ -51,6 +51,9 @@ import QtQuick 2.12 Rectangle { id: container + required property string name + required property string description + property Item exampleItem width: ListView.view.width height: button.implicitHeight + 22 @@ -110,7 +113,7 @@ Rectangle { anchors.leftMargin: 10 anchors.right: parent.right anchors.rightMargin: 10 - text: name + text: container.name color: "black" font.pixelSize: 22 wrapMode: Text.WrapAtWordBoundaryOrAnywhere @@ -122,7 +125,7 @@ Rectangle { id: buttonLabel2 anchors.left: parent.left anchors.leftMargin: 10 - text: description + text: container.description wrapMode: Text.WrapAtWordBoundaryOrAnywhere color: "#666" font.pixelSize: 12 diff --git a/examples/quick/text/doc/src/text.qdoc b/examples/quick/text/doc/src/text.qdoc index d8bd8d349a..6378e3efe6 100644 --- a/examples/quick/text/doc/src/text.qdoc +++ b/examples/quick/text/doc/src/text.qdoc @@ -49,9 +49,6 @@ Simply by name, using the font.family property directly: \snippet text/fonts/fonts.qml name - or using a \l FontLoader type: - \snippet text/fonts/fonts.qml fontloader - or using a FontLoader and specifying a local font file: \snippet text/fonts/fonts.qml fontloaderlocal diff --git a/examples/quick/text/fonts/fonts.qml b/examples/quick/text/fonts/fonts.qml index d356e00417..f4e721b6c1 100644 --- a/examples/quick/text/fonts/fonts.qml +++ b/examples/quick/text/fonts/fonts.qml @@ -56,9 +56,6 @@ Rectangle { width: 320; height: 480 color: "steelblue" -//! [fontloader] - FontLoader { id: fixedFont; name: "Courier" } -//! [fontloader] //! [fontloaderlocal] FontLoader { id: localFont; source: "content/fonts/tarzeau_ocr_a.ttf" } //! [fontloaderlocal] @@ -94,14 +91,14 @@ Rectangle { width: parent.width horizontalAlignment: Text.AlignRight wrapMode: Text.WordWrap - font { family: fixedFont.name; pixelSize: 20; weight: Font.Bold; capitalization: Font.AllLowercase } + font { family: "Courier"; pixelSize: 20; weight: Font.Bold; capitalization: Font.AllLowercase } } Text { text: myText color: "lightsteelblue" width: parent.width wrapMode: Text.WordWrap - font { family: fixedFont.name; pixelSize: 20; italic: true; capitalization: Font.SmallCaps } + font { family: "Courier"; pixelSize: 20; italic: true; capitalization: Font.SmallCaps } } Text { text: myText |