Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Something in Qt broke and I can't compile anymore. QVBoxLayout doesn't name a type. [solved]
Forum Updated to NodeBB v4.3 + New Features

Something in Qt broke and I can't compile anymore. QVBoxLayout doesn't name a type. [solved]

Scheduled Pinned Locked Moved Installation and Deployment
12 Posts 2 Posters 4.1k Views 1 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.
  • F Offline
    F Offline
    flashmozzg
    wrote on last edited by
    #1

    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;
    ^@

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

      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

      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
      • F Offline
        F Offline
        flashmozzg
        wrote on last edited by
        #3

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

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

          Can you check that the header hasn't been modified accidentally ?

          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
          • F Offline
            F Offline
            flashmozzg
            wrote on last edited by
            #5

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

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

              Search/Replace on the wrong set of files, gremlins… There's a lot of possibilities

              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
              • F Offline
                F Offline
                flashmozzg
                wrote on last edited by
                #7

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

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

                  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

                  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
                  • F Offline
                    F Offline
                    flashmozzg
                    wrote on last edited by
                    #9

                    [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?

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

                      You can try downloading only the sources, and replace the headers with those from the sources

                      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
                      • F Offline
                        F Offline
                        flashmozzg
                        wrote on last edited by
                        #11

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

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

                          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 :)

                          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

                          • Login

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