diff options
author | Dennis Oberst <dennis.oberst@qt.io> | 2023-03-01 13:58:51 +0100 |
---|---|---|
committer | Dennis Oberst <dennis.oberst@qt.io> | 2023-03-09 17:26:59 +0000 |
commit | de5e0422ca14ad1bc042889fa68772bf6912a215 (patch) | |
tree | 8b4854a193d5bd8df9e8cf91a0a20dd8f7c3f7ba /examples | |
parent | fbb470b40b2c86a55751bf3099cc0424f66c7274 (diff) |
Example: remove runfunction example
This example shows how to use QtConcurrent::run by calling a global
function and printing the thread ID. As the documentation already
explains the functionality very well, I don't think this example is
necessary.
https://doc.qt.io/qt-6/qtconcurrentrun.html
Task-number: QTBUG-111165
Pick-to: 6.5 6.5.0
Change-Id: I42a718cdaabdaeeab39b933d12c67d11978c95da
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/qtconcurrent/CMakeLists.txt | 1 | ||||
-rw-r--r-- | examples/qtconcurrent/qtconcurrent.pro | 2 | ||||
-rw-r--r-- | examples/qtconcurrent/runfunction/CMakeLists.txt | 32 | ||||
-rw-r--r-- | examples/qtconcurrent/runfunction/doc/src/qtconcurrent-runfunction.qdoc | 15 | ||||
-rw-r--r-- | examples/qtconcurrent/runfunction/main.cpp | 24 | ||||
-rw-r--r-- | examples/qtconcurrent/runfunction/runfunction.pro | 7 |
6 files changed, 0 insertions, 81 deletions
diff --git a/examples/qtconcurrent/CMakeLists.txt b/examples/qtconcurrent/CMakeLists.txt index 07b4f9d67c..77244436e4 100644 --- a/examples/qtconcurrent/CMakeLists.txt +++ b/examples/qtconcurrent/CMakeLists.txt @@ -7,6 +7,5 @@ endif() if(TARGET Qt6::Widgets) qt_internal_add_example(imagescaling) qt_internal_add_example(progressdialog) - qt_internal_add_example(runfunction) qt_internal_add_example(wordcount) endif() diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro index ccebd0d18c..1db6013c4a 100644 --- a/examples/qtconcurrent/qtconcurrent.pro +++ b/examples/qtconcurrent/qtconcurrent.pro @@ -3,13 +3,11 @@ requires(qtHaveModule(concurrent)) TEMPLATE = subdirs SUBDIRS = imagescaling \ progressdialog \ - runfunction \ wordcount !qtHaveModule(widgets) { SUBDIRS -= \ imagescaling \ progressdialog \ - runfunction \ wordcount } diff --git a/examples/qtconcurrent/runfunction/CMakeLists.txt b/examples/qtconcurrent/runfunction/CMakeLists.txt deleted file mode 100644 index 2a05ab238b..0000000000 --- a/examples/qtconcurrent/runfunction/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.16) -project(runfunction LANGUAGES CXX) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qtconcurrent/runfunction") - -find_package(Qt6 REQUIRED COMPONENTS Concurrent Core Gui Widgets) - -qt_standard_project_setup() - -qt_add_executable(runfunction - main.cpp -) - -target_link_libraries(runfunction PRIVATE - Qt6::Concurrent - Qt6::Core - Qt6::Gui - Qt6::Widgets -) - -install(TARGETS runfunction - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/qtconcurrent/runfunction/doc/src/qtconcurrent-runfunction.qdoc b/examples/qtconcurrent/runfunction/doc/src/qtconcurrent-runfunction.qdoc deleted file mode 100644 index ae52be3c45..0000000000 --- a/examples/qtconcurrent/runfunction/doc/src/qtconcurrent-runfunction.qdoc +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only - -/*! - \example runfunction - \title Run Function Example - \brief Demonstrates how to run standard functions concurrently. - \ingroup qtconcurrentexamples - - The QtConcurrent Run Function example shows how to apply concurrency to - a standard function, using QFuture instances to retrieve return values - at a later time. - - This is a command-line application. -*/ diff --git a/examples/qtconcurrent/runfunction/main.cpp b/examples/qtconcurrent/runfunction/main.cpp deleted file mode 100644 index 4c00e11f1d..0000000000 --- a/examples/qtconcurrent/runfunction/main.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause - -#include <QDebug> -#include <QThread> -#include <QString> -#include <qtconcurrentrun.h> -#include <QApplication> - -using namespace QtConcurrent; - -void hello(QString name) -{ - qDebug() << "Hello" << name << "from" << QThread::currentThread(); -} - -int main(int argc, char **argv) -{ - QApplication app(argc, argv); - QFuture<void> f1 = run(hello, QString("Alice")); - QFuture<void> f2 = run(hello, QString("Bob")); - f1.waitForFinished(); - f2.waitForFinished(); -} diff --git a/examples/qtconcurrent/runfunction/runfunction.pro b/examples/qtconcurrent/runfunction/runfunction.pro deleted file mode 100644 index 42c05551ba..0000000000 --- a/examples/qtconcurrent/runfunction/runfunction.pro +++ /dev/null @@ -1,7 +0,0 @@ -QT += concurrent widgets -CONFIG += cmdline - -SOURCES += main.cpp - -target.path = $$[QT_INSTALL_EXAMPLES]/qtconcurrent/runfunction -INSTALLS += target |