From 6b8e866391cf933f077756c8ad154683885ea07f Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 2 Nov 2013 10:13:45 +0800 Subject: [PATCH] Doc: Clean up threading examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Example 3 (Clock) is a collection of anti-patterns. - It implements a slot in a QThread subclass and then forces the new thread to use Qt::DirectConnection to invoke the slot in the "wrong" thread. - It talks about getting away with non-thread-safe usage - It uses a thread as a timer and then admits that it's an over- complicated approach. - Example 4 (Permanent Thread) is over-complicated yet incomplete. A better one exists in the QThread class ref. - Example 1 (Thread Pool) is covered by the QThreadPool class ref. - Example 2 (QtConcurrent::run()) is covered in the "Threading and Concurrent Programming Examples" page and the "QtConcurrentRun" page. - The undocumented "Hello Thread" example is covered in the QThread class ref. - These examples cannot be accessed from Qt Creator's Examples tool. - These examples are neither widget-related nor tutorials, contrary to their source paths. Task-number: QTBUG-33360 Change-Id: Ic79cb764ee925ddbcbeafee8e1d01db7fe0f6cfe Reviewed-by: Topi Reiniƶ Reviewed-by: Jerome Pasion --- .../widgets/tutorials/threads/clock/clock.pro | 10 -- .../tutorials/threads/clock/clockthread.cpp | 66 --------- .../tutorials/threads/clock/clockthread.h | 64 --------- .../widgets/tutorials/threads/clock/main.cpp | 67 --------- .../helloconcurrent/helloconcurrent.cpp | 63 --------- .../helloconcurrent/helloconcurrent.pro | 14 -- .../threads/hellothread/hellothread.cpp | 50 ------- .../threads/hellothread/hellothread.h | 53 -------- .../threads/hellothread/hellothread.pro | 14 -- .../tutorials/threads/hellothread/main.cpp | 52 ------- .../hellothreadpool/hellothreadpool.cpp | 65 --------- .../hellothreadpool/hellothreadpool.pro | 14 -- .../tutorials/threads/movedobject/main.cpp | 69 ---------- .../threads/movedobject/movedobject.pro | 15 --- .../tutorials/threads/movedobject/thread.cpp | 100 -------------- .../tutorials/threads/movedobject/thread.h | 67 --------- .../threads/movedobject/workerobject.cpp | 87 ------------ .../threads/movedobject/workerobject.h | 64 --------- .../widgets/tutorials/threads/threads.pro | 8 -- examples/widgets/tutorials/tutorials.pro | 2 +- src/corelib/doc/images/thread_clock.png | Bin 5964 -> 0 bytes src/corelib/doc/src/threads-basics.qdoc | 127 +----------------- 22 files changed, 4 insertions(+), 1067 deletions(-) delete mode 100644 examples/widgets/tutorials/threads/clock/clock.pro delete mode 100644 examples/widgets/tutorials/threads/clock/clockthread.cpp delete mode 100644 examples/widgets/tutorials/threads/clock/clockthread.h delete mode 100644 examples/widgets/tutorials/threads/clock/main.cpp delete mode 100644 examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp delete mode 100644 examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.pro delete mode 100644 examples/widgets/tutorials/threads/hellothread/hellothread.cpp delete mode 100644 examples/widgets/tutorials/threads/hellothread/hellothread.h delete mode 100644 examples/widgets/tutorials/threads/hellothread/hellothread.pro delete mode 100644 examples/widgets/tutorials/threads/hellothread/main.cpp delete mode 100644 examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp delete mode 100644 examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.pro delete mode 100644 examples/widgets/tutorials/threads/movedobject/main.cpp delete mode 100644 examples/widgets/tutorials/threads/movedobject/movedobject.pro delete mode 100644 examples/widgets/tutorials/threads/movedobject/thread.cpp delete mode 100644 examples/widgets/tutorials/threads/movedobject/thread.h delete mode 100644 examples/widgets/tutorials/threads/movedobject/workerobject.cpp delete mode 100644 examples/widgets/tutorials/threads/movedobject/workerobject.h delete mode 100644 examples/widgets/tutorials/threads/threads.pro delete mode 100644 src/corelib/doc/images/thread_clock.png diff --git a/examples/widgets/tutorials/threads/clock/clock.pro b/examples/widgets/tutorials/threads/clock/clock.pro deleted file mode 100644 index 041c02bea8..0000000000 --- a/examples/widgets/tutorials/threads/clock/clock.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT += widgets -CONFIG += console -TEMPLATE = app -SOURCES += main.cpp \ - clockthread.cpp -HEADERS += clockthread.h - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/clock -INSTALLS += target diff --git a/examples/widgets/tutorials/threads/clock/clockthread.cpp b/examples/widgets/tutorials/threads/clock/clockthread.cpp deleted file mode 100644 index 5068a9b14a..0000000000 --- a/examples/widgets/tutorials/threads/clock/clockthread.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#include -#include "clockthread.h" - - //This class starts another thread where it emits a signal for every new second. - -//! [1] -// clock/clockthread.cpp -void ClockThread::run() -{ - QTimer timer; - connect(&timer, SIGNAL(timeout()), this, SLOT(timerHit()), Qt::DirectConnection); - timer.setInterval(10); - timer.start(); // puts one event in the threads event queue - exec(); - timer.stop(); -} - -void ClockThread::timerHit() -{ - QString newTime= QDateTime::currentDateTime().toString("ddd MMMM d yy, hh:mm:ss"); - if(m_lastTime != newTime ){ - m_lastTime = newTime; - emit sendTime(newTime) ; - } -} -//! [1] diff --git a/examples/widgets/tutorials/threads/clock/clockthread.h b/examples/widgets/tutorials/threads/clock/clockthread.h deleted file mode 100644 index 9d3b06ddd8..0000000000 --- a/examples/widgets/tutorials/threads/clock/clockthread.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#ifndef CLOCKTHREAD_H -#define CLOCKTHREAD_H - -#include -#include - - - -//! [1] -// clock/clockthread.h -class ClockThread : public QThread -{ - Q_OBJECT -signals: - void sendTime(QString time); -private: - void run(); - QString m_lastTime; -private slots: - void timerHit(); - -}; -//! [1] -#endif // CLOCKTHREAD_H \ No newline at end of file diff --git a/examples/widgets/tutorials/threads/clock/main.cpp b/examples/widgets/tutorials/threads/clock/main.cpp deleted file mode 100644 index f90318027c..0000000000 --- a/examples/widgets/tutorials/threads/clock/main.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#include -#include "clockthread.h" - -//A clock that does time formatting in another thread - -//! [1] -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - // build gui - QWidget widget; - QLabel *label = new QLabel; - QHBoxLayout *layout = new QHBoxLayout(&widget); - layout->addWidget(label); - widget.setWindowTitle("clock"); - - //instantiate thread object - ClockThread clockThread; - QObject::connect(&clockThread, SIGNAL(sendTime(QString)), label, SLOT(setText(QString)), Qt::QueuedConnection); - clockThread.start(); - widget.show(); - app.exec(); - clockThread.quit(); - clockThread.wait(); - return 0; -} -//! [1] diff --git a/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp b/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp deleted file mode 100644 index 773c685ba0..0000000000 --- a/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#include -#include - -/* - says hello from main thread and secondary thread using QtConcurrent -*/ - -//! [1] -// helloconcurrent/main.cpp -void hello() -{ - qDebug() << "Hello from thread " << QThread::currentThread(); -} - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - QFuture future = QtConcurrent::run(hello); - qDebug() << "hello from GUI thread " << QThread::currentThread(); - future.waitForFinished(); - return 0; -} -//! [1] diff --git a/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.pro b/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.pro deleted file mode 100644 index 7e6da1133c..0000000000 --- a/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.pro +++ /dev/null @@ -1,14 +0,0 @@ -QT -= gui -QT += concurrent - -CONFIG += console -CONFIG -= app_bundle -TEMPLATE = app -SOURCES += helloconcurrent.cpp - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/helloconcurrent -INSTALLS += target - - - diff --git a/examples/widgets/tutorials/threads/hellothread/hellothread.cpp b/examples/widgets/tutorials/threads/hellothread/hellothread.cpp deleted file mode 100644 index 1b5088e0db..0000000000 --- a/examples/widgets/tutorials/threads/hellothread/hellothread.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#include -#include "hellothread.h" -/* - * demonstrates use of QThread, says hello in another thread and terminates - */ - -void HelloThread::run() -{ - qDebug() << "hello from worker thread " << thread()->currentThreadId(); -} diff --git a/examples/widgets/tutorials/threads/hellothread/hellothread.h b/examples/widgets/tutorials/threads/hellothread/hellothread.h deleted file mode 100644 index 281f2c6cb5..0000000000 --- a/examples/widgets/tutorials/threads/hellothread/hellothread.h +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#ifndef HELLOTHREAD_H -#define HELLOTHREAD_H - -#include - -class HelloThread : public QThread -{ - Q_OBJECT -private: - void run(); -}; - -#endif // HELLOTHREAD_H diff --git a/examples/widgets/tutorials/threads/hellothread/hellothread.pro b/examples/widgets/tutorials/threads/hellothread/hellothread.pro deleted file mode 100644 index 40fd33b146..0000000000 --- a/examples/widgets/tutorials/threads/hellothread/hellothread.pro +++ /dev/null @@ -1,14 +0,0 @@ -QT -= gui - -CONFIG += console -CONFIG -= app_bundle -TEMPLATE = app -SOURCES += main.cpp \ - hellothread.cpp -HEADERS += hellothread.h - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/hellothread -INSTALLS += target - - diff --git a/examples/widgets/tutorials/threads/hellothread/main.cpp b/examples/widgets/tutorials/threads/hellothread/main.cpp deleted file mode 100644 index 8b4b00874f..0000000000 --- a/examples/widgets/tutorials/threads/hellothread/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#include -#include "hellothread.h" - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - HelloThread thread; - thread.start(); - qDebug() << "hello from GUI thread " << app.thread()->currentThreadId(); - thread.wait(); // do not exit before the thread is completed! - return 0; -} diff --git a/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp b/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp deleted file mode 100644 index f904159fe4..0000000000 --- a/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ -#include -// A hello world program to demonstrate the use of the global thread pool - -//! [1] -// hellothreadpool/main.cpp -class Work : public QRunnable -{ -public: - void run() - { - qDebug() << "Hello from thread " << QThread::currentThread(); - } -}; - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - Work work; - work.setAutoDelete(false); - QThreadPool *threadPool = QThreadPool::globalInstance(); - threadPool->start(&work); - qDebug() << "hello from GUI thread " << QThread::currentThread(); - threadPool->waitForDone(); - return 0; -} -//! [1] diff --git a/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.pro b/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.pro deleted file mode 100644 index d5404a5134..0000000000 --- a/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.pro +++ /dev/null @@ -1,14 +0,0 @@ -QT -= gui - -CONFIG += console -CONFIG -= app_bundle -TEMPLATE = app -SOURCES += hellothreadpool.cpp - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/hellothreadpool -INSTALLS += target - - - - diff --git a/examples/widgets/tutorials/threads/movedobject/main.cpp b/examples/widgets/tutorials/threads/movedobject/main.cpp deleted file mode 100644 index 2894707fda..0000000000 --- a/examples/widgets/tutorials/threads/movedobject/main.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#include -#include "workerobject.h" -#include "thread.h" - -/* - * moves a class derived from QObject (WorkerObject) to another thread - * and calls methods over thread boundaries. - */ - -//![1] -// movedobject/main.cpp -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - Thread thread; - qDebug() << "main thread ID: " << app.thread()->currentThreadId(); - WorkerObject *worker = new WorkerObject; - thread.launchWorker(worker); - QMetaObject::invokeMethod(worker, "doWork", Qt::QueuedConnection); - QMetaObject::invokeMethod(worker, "startPolling", Qt::QueuedConnection, Q_ARG(int, 500)); - //let application produce output for 3 seconds and quit - QTimer::singleShot(3000, &app, SLOT(quit())); - app.exec(); - thread.stop(); - thread.wait(); - delete worker; - return 0; -} -//![1] diff --git a/examples/widgets/tutorials/threads/movedobject/movedobject.pro b/examples/widgets/tutorials/threads/movedobject/movedobject.pro deleted file mode 100644 index b2ea7e5366..0000000000 --- a/examples/widgets/tutorials/threads/movedobject/movedobject.pro +++ /dev/null @@ -1,15 +0,0 @@ -QT += widgets -CONFIG += console -CONFIG -= app_bundle -TEMPLATE = app -SOURCES += main.cpp \ - workerobject.cpp \ - thread.cpp - -HEADERS += \ - workerobject.h \ - thread.h - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/movedobject -INSTALLS += target diff --git a/examples/widgets/tutorials/threads/movedobject/thread.cpp b/examples/widgets/tutorials/threads/movedobject/thread.cpp deleted file mode 100644 index 2b6c2ffbd6..0000000000 --- a/examples/widgets/tutorials/threads/movedobject/thread.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - -#include "thread.h" - -/* - * QThread derived class with additional capability to move a QObject to the - * new thread, to stop the thread and move the QObject back to the thread where - *it came from. - */ - -Thread::Thread( QObject *parent) - : QThread (parent) -{ - //we need a class that receives signals from other threads and emits a signal in response - shutDownHelper=new QSignalMapper; - shutDownHelper->setMapping(this,0); - connect(this, SIGNAL(started()), this, SLOT(setReadyStatus() ), Qt::DirectConnection); - connect(this, SIGNAL(aboutToStop()), shutDownHelper, SLOT(map()) ); -} - -//------------------------------------------------------ -Thread::~Thread() -{ - delete shutDownHelper; -} - -//------------------------------------------------------ -// starts thread, moves worker to this thread and blocks -void Thread::launchWorker(QObject *worker) -{ - this->worker = worker; - start(); - worker->moveToThread(this); - shutDownHelper->moveToThread(this); - connect(shutDownHelper, SIGNAL(mapped(int) ), this, SLOT(stopExecutor()), Qt::DirectConnection ); - mutex.lock(); - waitCondition.wait(&mutex); -} - -//------------------------------------------------------ -// puts a command to stop processing in the event queue of worker thread -void Thread::stop() -{ - emit aboutToStop(); -} - -//------------------------------------------------------ - -// methods above this line should be called in gui thread context -// methods below this line are private and will be run in secondary thread context - -//------------------------------------------------------ -void Thread::stopExecutor() //secondary thread context -{ - exit(); -} - -//------------------------------------------------------ -void Thread::setReadyStatus() -{ - waitCondition.wakeAll(); -} diff --git a/examples/widgets/tutorials/threads/movedobject/thread.h b/examples/widgets/tutorials/threads/movedobject/thread.h deleted file mode 100644 index e95d480ca8..0000000000 --- a/examples/widgets/tutorials/threads/movedobject/thread.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - - -#ifndef THREAD_H -#define THREAD_H - -#include - -class Thread :public QThread -{ - Q_OBJECT -public: - Thread( QObject *parent=0); - ~Thread(); - void stop(); - void launchWorker(QObject *worker); -private: - QObject *worker; - QSignalMapper *shutDownHelper; - QWaitCondition waitCondition; - QMutex mutex; -private slots: - void stopExecutor(); - void setReadyStatus(); -signals: - void aboutToStop(); -}; - -#endif // THREAD_H diff --git a/examples/widgets/tutorials/threads/movedobject/workerobject.cpp b/examples/widgets/tutorials/threads/movedobject/workerobject.cpp deleted file mode 100644 index a630042f9a..0000000000 --- a/examples/widgets/tutorials/threads/movedobject/workerobject.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ -#include -#include "workerobject.h" - -/* - * represents an object that lives in another thread where it polls a resource - * and communicates with the gui thread - */ - -WorkerObject::WorkerObject(QObject *parent) - : QObject(parent) -{ - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(poll())); -} - -//--------------------------------------------------------------- -void WorkerObject::doWork() -{ - - qDebug() << "doing work in thread " << thread()->currentThreadId() ; -} - -//--------------------------------------------------------------- -WorkerObject::~WorkerObject() -{ - qDebug() << "destruction WorkerObject in thread " << thread()->currentThreadId(); -} - -//--------------------------------------------------------------- -void WorkerObject::startPolling(int milliseconds) -{ - count=0; - timer->start(milliseconds); -} - -//--------------------------------------------------------------- -void WorkerObject::stopPolling() -{ - timer->stop(); -} - -//--------------------------------------------------------------- -void WorkerObject::poll() -{ - qDebug() << QString("timer hit %1").arg(count); - count++; -} - diff --git a/examples/widgets/tutorials/threads/movedobject/workerobject.h b/examples/widgets/tutorials/threads/movedobject/workerobject.h deleted file mode 100644 index 251a935282..0000000000 --- a/examples/widgets/tutorials/threads/movedobject/workerobject.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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 Digia Plc and its Subsidiary(-ies) 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$ -** -****************************************************************************/ - - -#ifndef WORKEROBJECT_H -#define WORKEROBJECT_H - -#include - -class WorkerObject : public QObject -{ - Q_OBJECT -public: - explicit WorkerObject(QObject *parent = 0); - ~WorkerObject(); -public slots: - void doWork(); - void startPolling(int milliseconds); - void stopPolling(); -private slots: - void poll(); -private: - QTimer *timer; - int count; -}; - -#endif // WORKEROBJECT_H diff --git a/examples/widgets/tutorials/threads/threads.pro b/examples/widgets/tutorials/threads/threads.pro deleted file mode 100644 index 19718d760c..0000000000 --- a/examples/widgets/tutorials/threads/threads.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS = hellothread \ - hellothreadpool \ - clock \ - movedobject - -qtHaveModule(concurrent): SUBDIRS += helloconcurrent diff --git a/examples/widgets/tutorials/tutorials.pro b/examples/widgets/tutorials/tutorials.pro index cf94830551..2eb87cdbd5 100644 --- a/examples/widgets/tutorials/tutorials.pro +++ b/examples/widgets/tutorials/tutorials.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS += threads addressbook widgets modelview gettingStarted +SUBDIRS += addressbook widgets modelview gettingStarted diff --git a/src/corelib/doc/images/thread_clock.png b/src/corelib/doc/images/thread_clock.png deleted file mode 100644 index b8a8aa0a39eb92249671b7efb07768630a1516bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5964 zcmV-S7qjSzP)V=-S7~l!Z+9R= zY+-YAIv`_gZ)0l)@!p33000YgMObuHX>@F50Ap-#V{3$E_ul{j7OhD{K~#90?Oc0Y zRmJvS`|vnm0)}a!0x6=vBtbUdKdTN@_ZZ|St zm8h8hEUh%{CMJ~PBYY%cs3;O3aDc-(vwnZfW6z$w&*2;b^>$ls&t9`;?b);EyVjaD zv$p~w!k_e?M~E1xY1+zyKjCkfW;{Lp*e7pZ>|QhtO_@AN)3iWZct5B3;`Zj>f)3{G zx!7H3N@Cc9De|`rvZclbB)1KU3JV5+)0NI2&(^OmbXV1r3*5y^ioV>u#dqb$pPWAX zEk8oV<4;ca*S!4gkKDdB_IJl%%2kd%dHc_vv6t9v6%`d>En8mYa=w?;?ek)L<_XQO z{#{6#aDBV?e>l|~jG&{x{Nh)a{MGlD8r?p_9#Qw^aaR<#K3kM?8V3y;WVhSD{PN5A z`1rPM+lGXMeD(ELaiR9~*6lw$cU2Sgx*2H6uA-9NU$p6Sdy_NrUFI)biS-+EJq z#9w`Xsd4RdzX#^`cSKfRR(dq7U58t*zux6?)zs8PMMc%u*Sp=d>(6 zdPii7O}~Yi@3D163;^7`>VzUxBxcG?Yj=0nD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