error: 'Q_DECL_OVERRIDE' does not name a type
-
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! -
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 -
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.
-
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-gnuThen from the IDE Tools > Options > Build & Run > Kits > Qt Version I have selected Qt5
Now all works fine, thanks. -
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 qtbase5any help?
-
Did you change the Kit used to build the example ?
-
Put Q_DECL_OVERRIDE after method declaration, not before it.
Sample from Qt Docvirtual void MyWidget::paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;