Unsolved QThread example in online Qt 4.8 docs
-
As we are still using Qt 4.8 here at work, I am regularly consulting its online documentation. Today, I was looking at the QThread example code at http://doc.qt.io/qt-4.8/qthread.html#details and I noticed that the
Worker
class has aQThread
member namedworkerThread
, just like theController
class has one:class Worker : public QObject { Q_OBJECT QThread workerThread; public slots: void doWork(const QString ¶meter) { // ... emit resultReady(result); } signals: void resultReady(const QString &result); };
I was wondering why... Looking at the Qt 5.9 documentation at http://doc.qt.io/qt-5/qthread.html#details I see no such member. I assume that is a small typo in the Qt 4.8 documentation, and that member actually shouldn't be there?
-
Correct,
Worker::workerThread
is just useless clutter -
@Bart_Vandewoestyne I would say the example is wrong
-
Is this still something I can report to the Qt developers so it can be fixed in the online docs (if 'yes', where and how do I report it)? Or are they no longer fixing errors in the online 4.8 documentation?
-
it has been reported, 4 years ago, https://bugreports.qt.io/browse/QTBUG-32292
BTW:
remove unused 'QThread workerThread' in 'Worker' class in:
doc/src/snippets/code/src_corelib_thread_qthread.cppBut I don't think it's worth spending time on it
-
Hi,
Might not, Qt 4 will not have any update anymore unless there's a security issue discovered..