Something in Qt broke and I can't compile anymore. QVBoxLayout doesn't name a type. [solved]
-
The problem is - everything was working fine, then I changed QVBoxLayout to QGridLayout after that if I include <QGridLayout> or any other Layout related stuff I get this kind of errors (they appear in projects that were builing just fine before)
@In file included from ....\Qt\5.2.1\mingw48_32\include/QtGui/qwindowdefs.h:45:0,
from ....\Qt\5.2.1\mingw48_32\include\QtWidgets/qwidget.h:45,
from ....\Qt\5.2.1\mingw48_32\include\QtWidgets/QWidget:1,
from ..\DZ\HW14_7\TicTacToe\tictactoe.h:4,
from ..\DZ\HW14_7\TicTacToe\tictactoe.cpp:1:
....\Qt\5.2.1\mingw48_32\include/QtWidgets/qboxlayout.h:137:20: error: 'QVBoxLayout' does not name a type
Q_DISABLE_COPY(QVBoxLayout)
^
....\Qt\5.2.1\mingw48_32\include/QtCore/qglobal.h:978:17: note: in definition of macro 'Q_DISABLE_COPY'
Class(const Class &) Q_DECL_EQ_DELETE;
^
....\Qt\5.2.1\mingw48_32\include/QtCore/qglobal.h:978:23: error: ISO C++ forbids declaration of 'parameter' with no type [-fpermissive]
Class(const Class &) Q_DECL_EQ_DELETE;
^
....\Qt\5.2.1\mingw48_32\include/QtWidgets/qboxlayout.h:137:5: note: in expansion of macro 'Q_DISABLE_COPY'
Q_DISABLE_COPY(QVBoxLayout)
^
In file included from ....\Qt\5.2.1\mingw48_32\include/QtCore/qglobal.h:71:0,
from ....\Qt\5.2.1\mingw48_32\include/QtGui/qwindowdefs.h:45,
from ....\Qt\5.2.1\mingw48_32\include\QtWidgets/qwidget.h:45,
from ....\Qt\5.2.1\mingw48_32\include\QtWidgets/QWidget:1,
from ..\DZ\HW14_7\TicTacToe\tictactoe.h:4,
from ..\DZ\HW14_7\TicTacToe\tictactoe.cpp:1:
....\Qt\5.2.1\mingw48_32\include/QtCore/qcompilerdetection.h:787:29: error: ISO C++ forbids declaration of 'QVBoxLayout' with no type [-fpermissive]define Q_DECL_EQ_DELETE = delete
^
....\Qt\5.2.1\mingw48_32\include/QtCore/qglobal.h:978:26: note: in expansion of macro 'Q_DECL_EQ_DELETE'
Class(const Class &) Q_DECL_EQ_DELETE;
^
....\Qt\5.2.1\mingw48_32\include/QtWidgets/qboxlayout.h:137:5: note: in expansion of macro 'Q_DISABLE_COPY'
Q_DISABLE_COPY(QVBoxLayout)
^
In file included from ....\Qt\5.2.1\mingw48_32\include/QtGui/qwindowdefs.h:45:0,
from ....\Qt\5.2.1\mingw48_32\include\QtWidgets/qwidget.h:45,
from ....\Qt\5.2.1\mingw48_32\include\QtWidgets/QWidget:1,
from ..\DZ\HW14_7\TicTacToe\tictactoe.h:4,
from ..\DZ\HW14_7\TicTacToe\tictactoe.cpp:1:
....\Qt\5.2.1\mingw48_32\include/QtWidgets/qboxlayout.h:137:20: error: 'QVBoxLayout' does not name a type
Q_DISABLE_COPY(QVBoxLayout)
^
....\Qt\5.2.1\mingw48_32\include/QtCore/qglobal.h:979:5: note: in definition of macro 'Q_DISABLE_COPY'
Class &operator=(const Class &) Q_DECL_EQ_DELETE;
^@ -
Hi and welcome to devnet,
You are probably just missing:
@QT += widgets@
in your pro file.
In Qt 5, the Qt widgets have been moved in their own module
-
Thanks for response.
[quote author="SGaist" date="1397848890"]
You are probably just missing:@QT += widgets@
in your pro file.
[/quote]
Nope, just checked to be sure. It's even appears on freshly created QtWidget program, as soon as you write #include <SomethingRelatedToLayout> somewhere. And it compiles on my notebook just fine. (and compiled before "something" happened to Qt/Creator). -
Can you check that the header hasn't been modified accidentally ?
-
[quote author="SGaist" date="1397861077"]Can you check that the header hasn't been modified accidentally ?[/quote]
In mingw48_32\include\QtWidgets all headers haven't been modified since installation. I guess I'll have to reinstall my Qt. I want to know what caused this sort of behavior, though. -
Search/Replace on the wrong set of files, gremlins… There's a lot of possibilities
-
[quote author="SGaist" date="1397938167"]Search/Replace on the wrong set of files, gremlins… There's a lot of possibilities[/quote]
Probably gremlins. Haven't touched any of qt files.
Was just playing around in simple test widget project. Decided to change VBox to Grid and that happened. -
You might have had one or more of Qt's header file opened and did a search/replace on all opened documents and bam, there's your gremlins playing hell on your setup
-
[quote author="SGaist" date="1397940269"]You might have had one or more of Qt's header file opened and did a search/replace on all opened documents and bam, there's your gremlins playing hell on your setup[/quote]
Is where a way to fix it without re-downloading all of the Qt?
-
You can try downloading only the sources, and replace the headers with those from the sources
-
[quote author="SGaist" date="1397944104"]You can try downloading only the sources, and replace the headers with those from the sources[/quote]
Thanks. That helped. -
You're welcome !
If you have everything working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)