summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Oberst <dennis.oberst@qt.io>2023-03-01 13:58:51 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-10 05:20:15 +0000
commit0c2bd257123e3df0bf38906620b955bb5d9c1f1d (patch)
tree8d82fcb8f66e63a02eda5e2ae102a81361df68ee
parent9ef8020ddebe502c2c5de53eb10492b2aeed8a1d (diff)
downloadqtbase-0c2bd257123e3df0bf38906620b955bb5d9c1f1d.tar.gz
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 Change-Id: I42a718cdaabdaeeab39b933d12c67d11978c95da Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> (cherry picked from commit de5e0422ca14ad1bc042889fa68772bf6912a215) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--examples/qtconcurrent/CMakeLists.txt1
-rw-r--r--examples/qtconcurrent/qtconcurrent.pro2
-rw-r--r--examples/qtconcurrent/runfunction/CMakeLists.txt32
-rw-r--r--examples/qtconcurrent/runfunction/doc/src/qtconcurrent-runfunction.qdoc15
-rw-r--r--examples/qtconcurrent/runfunction/main.cpp24
-rw-r--r--examples/qtconcurrent/runfunction/runfunction.pro7
6 files changed, 0 insertions, 81 deletions
diff --git a/examples/qtconcurrent/CMakeLists.txt b/examples/qtconcurrent/CMakeLists.txt
index 89462b589c..0e8843b77a 100644
--- a/examples/qtconcurrent/CMakeLists.txt
+++ b/examples/qtconcurrent/CMakeLists.txt
@@ -7,7 +7,6 @@ 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()
if(TARGET Qt6::Gui)
diff --git a/examples/qtconcurrent/qtconcurrent.pro b/examples/qtconcurrent/qtconcurrent.pro
index bdf41b03ea..6afa0f95ed 100644
--- a/examples/qtconcurrent/qtconcurrent.pro
+++ b/examples/qtconcurrent/qtconcurrent.pro
@@ -4,7 +4,6 @@ TEMPLATE = subdirs
SUBDIRS = imagescaling \
map \
progressdialog \
- runfunction \
wordcount
@@ -17,6 +16,5 @@ SUBDIRS = imagescaling \
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