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. qt5 compile problem with QTabWidget::hasHeightForWidth()
Forum Updated to NodeBB v4.3 + New Features

qt5 compile problem with QTabWidget::hasHeightForWidth()

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 5 Posters 786 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.
  • J Offline
    J Offline
    jschwartzman
    wrote on last edited by
    #1

    g++ -c -pipe -O2 -Wall -std=c++11 -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -I. -isystem /usr/include/libdrm -I/usr/lib64/qt5/mkspecs/linux-g++ -o GitStatusDialog.o GitStatusDialog.cpp
    In file included from /usr/include/qt5/QtWidgets/qstyleoption.h:59,
    from /usr/include/qt5/QtWidgets/qabstractitemdelegate.h:45,
    from /usr/include/qt5/QtWidgets/qabstractitemview.h:47,
    from /usr/include/qt5/QtWidgets/qlistview.h:44,
    from /usr/include/qt5/QtWidgets/qlistwidget.h:44,
    from /usr/include/qt5/QtWidgets/QListWidget:1,
    from ui_GitStatusDialog.h:19,
    from GitStatusDialog.h:8,
    from GitStatusDialog.cpp:9:
    /usr/include/qt5/QtWidgets/qtabwidget.h:126:10: error: ‘bool QTabWidget::hasHeightForWidth() const’ marked ‘override’, but does not override
    126 | bool hasHeightForWidth() const override;
    | ^~~~~~~~~~~~~~~~~
    make: *** [Makefile:713: GitStatusDialog.o] Error 1

    I've defined -std=c++11 but it doesn't make a difference. If I include <QtGui/QListWidget> instead of <QtWidgets/QListWidget in ui_GitStatusDialog.h it compiles but gives me linker errors for everything in moc_GitStatusDialog.cpp.

    I've also tried including <QtCore> and <QtGui> in ui_GitStatusDialog.h but nothing helps.
    Thank you.

    jsulmJ 1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Are you customising the QTableWidget ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • J jschwartzman

        g++ -c -pipe -O2 -Wall -std=c++11 -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtCore -I. -isystem /usr/include/libdrm -I/usr/lib64/qt5/mkspecs/linux-g++ -o GitStatusDialog.o GitStatusDialog.cpp
        In file included from /usr/include/qt5/QtWidgets/qstyleoption.h:59,
        from /usr/include/qt5/QtWidgets/qabstractitemdelegate.h:45,
        from /usr/include/qt5/QtWidgets/qabstractitemview.h:47,
        from /usr/include/qt5/QtWidgets/qlistview.h:44,
        from /usr/include/qt5/QtWidgets/qlistwidget.h:44,
        from /usr/include/qt5/QtWidgets/QListWidget:1,
        from ui_GitStatusDialog.h:19,
        from GitStatusDialog.h:8,
        from GitStatusDialog.cpp:9:
        /usr/include/qt5/QtWidgets/qtabwidget.h:126:10: error: ‘bool QTabWidget::hasHeightForWidth() const’ marked ‘override’, but does not override
        126 | bool hasHeightForWidth() const override;
        | ^~~~~~~~~~~~~~~~~
        make: *** [Makefile:713: GitStatusDialog.o] Error 1

        I've defined -std=c++11 but it doesn't make a difference. If I include <QtGui/QListWidget> instead of <QtWidgets/QListWidget in ui_GitStatusDialog.h it compiles but gives me linker errors for everything in moc_GitStatusDialog.cpp.

        I've also tried including <QtCore> and <QtGui> in ui_GitStatusDialog.h but nothing helps.
        Thank you.

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

        @jschwartzman said in qt5 compile problem with QTabWidget::hasHeightForWidth():

        -std=c++11

        Add CONFIG += c++11 to your config file and do a complete rebuild.
        But it doesn't look like that's the issue.
        What is the version of the compiler and Qt you're using?

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

        1 Reply Last reply
        1
        • Christian EhrlicherC Online
          Christian EhrlicherC Online
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @jschwartzman said in qt5 compile problem with QTabWidget::hasHeightForWidth():

          QtGui/QListWidget

          This can't work since it's a Qt4 include. I would guess you're mixing Qt4 and Qt5 includes in your code.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          4
          • J Offline
            J Offline
            jschwartzman
            wrote on last edited by
            #5

            Got it.
            needed to change CONFIG += cpp11 to CONFIG += c++11 in .pro file
            needed to add -isystem /usr/include/qt5/QtWidgets to INCPATH in Makefile
            needed to add /usr/lib64/libQt5Widgets.so to LIBS in Makefile
            needed to add -DQT_NO_PRINTER to DEFINES in Makefile
            needed to add #include <QtCore/QObject to GitStatusDialog.h

            Am I missing some necessary changes to .pro file?

            Only remaining problems are the following messsages:
            QMetaObject::connectSlotsByName: No matching signal for on_listWidget_selectionChanged()
            QMetaObject::connectSlotsByName: No matching signal for on_closeButton_clicked()
            QMetaObject::connectSlotsByName: No matching signal for on_refreshButton_clicked()

            Thanks!

            mrjjM 1 Reply Last reply
            0
            • J jschwartzman

              Got it.
              needed to change CONFIG += cpp11 to CONFIG += c++11 in .pro file
              needed to add -isystem /usr/include/qt5/QtWidgets to INCPATH in Makefile
              needed to add /usr/lib64/libQt5Widgets.so to LIBS in Makefile
              needed to add -DQT_NO_PRINTER to DEFINES in Makefile
              needed to add #include <QtCore/QObject to GitStatusDialog.h

              Am I missing some necessary changes to .pro file?

              Only remaining problems are the following messsages:
              QMetaObject::connectSlotsByName: No matching signal for on_listWidget_selectionChanged()
              QMetaObject::connectSlotsByName: No matching signal for on_closeButton_clicked()
              QMetaObject::connectSlotsByName: No matching signal for on_refreshButton_clicked()

              Thanks!

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @jschwartzman said in qt5 compile problem with QTabWidget::hasHeightForWidth():

              QMetaObject::connectSlotsByName: No matching signal for

              Hi
              Those are warning that the auto connect feature did not find a match.
              The best solution is not to rely on the auto connect feature but use
              explicit connects instead.

              This warning happens if you rename any of the widgets in the UI file after you use
              the auto connect feature as the code is not automatically refactored.
              (auto connect feature is QMetaObject::connectSlotsByName )

              Rename the slots ( its triggers on the form on_widgetname_signalname) then connect explicitly

              https://stackoverflow.com/questions/24355023/qmetaobjectconnectslotsbyname-no-matching-signal

              1 Reply Last reply
              1
              • Christian EhrlicherC Online
                Christian EhrlicherC Online
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @jschwartzman said in qt5 compile problem with QTabWidget::hasHeightForWidth():

                needed to add -isystem /usr/include/qt5/QtWidgets to INCPATH in Makefile
                needed to add /usr/lib64/libQt5Widgets.so to LIBS in Makefile
                needed to add -DQT_NO_PRINTER to DEFINES in Makefile

                This is not needed when you properly add the needed modules (widgets, printsupport) in the pro file. See https://doc.qt.io/qt-5/qtwidgets-index.html

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                1

                • Login

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