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. error: 'Q_DECL_OVERRIDE' does not name a type
QtWS25 Last Chance

error: 'Q_DECL_OVERRIDE' does not name a type

Scheduled Pinned Locked Moved General and Desktop
10 Posts 6 Posters 6.7k Views
  • 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.
  • deglansD Offline
    deglansD Offline
    deglans
    wrote on last edited by
    #1

    Hi!
    I'm new of QT world, so I'm trying this example Mandelbrot Example.
    I have copy accurately the example but i get this error:

    error: 'Q_DECL_OVERRIDE' does not name a type

    I use Kubuntu 16.04 with Qt Creator 3.5.1 installed by repo.
    Thanks for any hints!

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      That is odd. Your compiler should be pretty new.
      This is the exact sample?

      You can remove it. It "just" informs you if u dont really override anything.

      Hmm what version of Qt did u install?
      Qt 5?
      Check with qmake -v

      1 Reply Last reply
      0
      • deglansD Offline
        deglansD Offline
        deglans
        wrote on last edited by
        #3

        $ qmake -v
        QMake version 2.01a
        Using Qt version 4.8.7 in /usr/lib/x86_64-linux-gnu

        1 Reply Last reply
        0
        • yuvaramY Offline
          yuvaramY Offline
          yuvaram
          wrote on last edited by
          #4

          Hi @deglans
          I guess there is a issue with copying, So you can try like this,
          In Qt Creator Examples(welcome > Examples) search for "Mandelbrot". Open it and compile it. This may help to find the issue.

          Yuvaram Aligeti
          Embedded Qt Developer
          : )

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

            Hi,

            That's because you are trying to build an example that's been update for Qt 5 with Qt 4.

            Q_DECL_OVERRIDE has been introduced in Qt 5.

            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
            • deglansD Offline
              deglansD Offline
              deglans
              wrote on last edited by
              #6

              I have solved by installing some package (qt5-default, qtbase5, qttools5) so now i get:

              $ qmake -v
              QMake version 3.0
              Using Qt version 5.5.1 in /usr/lib/x86_64-linux-gnu

              Then from the IDE Tools > Options > Build & Run > Kits > Qt Version I have selected Qt5
              Now all works fine, thanks.

              1 Reply Last reply
              1
              • rsalR Offline
                rsalR Offline
                rsal
                wrote on last edited by
                #7

                Hi tried doing the things given in the last reply.
                qt5-default was installed.
                but got following error for qt5base:-
                sudo apt-get install qtbase5
                [sudo] password for rohit:
                Reading package lists... Done
                Building dependency tree
                Reading state information... Done
                E: Unable to locate package qtbase5

                any help?

                1 Reply Last reply
                0
                • rsalR Offline
                  rsalR Offline
                  rsal
                  wrote on last edited by
                  #8

                  I added "-dev" in package name and it got installed. But still I am getting the error - error: 'Q_DECL_OVERRIDE' does not name a type. Please help.

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

                    Did you change the Kit used to build the example ?

                    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
                    0
                    • Hamed.MasafiH Offline
                      Hamed.MasafiH Offline
                      Hamed.Masafi
                      wrote on last edited by Hamed.Masafi
                      #10

                      Put Q_DECL_OVERRIDE after method declaration, not before it.
                      Sample from Qt Doc

                      virtual void MyWidget::paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
                      

                      Remote object sharing (OO RPC)
                      http://forum.qt.io/topic/60680/remote-object-sharing-oo-rpc-solved

                      Advanced, Powerful and easy to use ORM for Qt5
                      https://forum.qt.io/topic/67417/advanced-powerful-and-easy-to-use-orm-for-qt5

                      1 Reply Last reply
                      0

                      • Login

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