Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QThread example in online Qt 4.8 docs
Forum Updated to NodeBB v4.3 + New Features

QThread example in online Qt 4.8 docs

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 1.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bart_Vandewoestyne
    wrote on last edited by
    #1

    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 a QThread member named workerThread, just like the Controller class has one:

    class Worker : public QObject
    {
        Q_OBJECT
        QThread workerThread;
    
    public slots:
        void doWork(const QString &parameter) {
            // ...
            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?

    jsulmJ 1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Correct, Worker::workerThread is just useless clutter

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      2
      • B Bart_Vandewoestyne

        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 a QThread member named workerThread, just like the Controller class has one:

        class Worker : public QObject
        {
            Q_OBJECT
            QThread workerThread;
        
        public slots:
            void doWork(const QString &parameter) {
                // ...
                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?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Bart_Vandewoestyne I would say the example is wrong

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • B Offline
          B Offline
          Bart_Vandewoestyne
          wrote on last edited by
          #4

          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?

          1 Reply Last reply
          0
          • VRoninV Offline
            VRoninV Offline
            VRonin
            wrote on last edited by VRonin
            #5

            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.cpp

            But I don't think it's worth spending time on it

            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
            ~Napoleon Bonaparte

            On a crusade to banish setIndexWidget() from the holy land of Qt

            1 Reply Last reply
            2
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              Might not, Qt 4 will not have any update anymore unless there's a security issue discovered..

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              2

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved