Results 1 to 5 of 5

Thread: bool QTabWidget::hasHeightForWidth() const’ marked override, but does not override

  1. #1
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default bool QTabWidget::hasHeightForWidth() const’ marked override, but does not override

    Hi, I get this error during compilation:
    Qt Code:
    1. In file included from /usr/include/qt5/QtWidgets/qstyleoption.h:44:0,
    2. from /usr/include/qt5/QtWidgets/qabstractitemdelegate.h:38,
    3. from /usr/include/qt5/QtWidgets/qabstractitemview.h:40,
    4. from /usr/include/qt5/QtWidgets/qheaderview.h:37,
    5. from /usr/include/qt5/QtWidgets/QHeaderView:1,
    6. from obj/ui/ui_mydialog.h:19
    7. (...)
    8. /usr/include/qt5/QtWidgets/qtabwidget.h:120:10: error: ‘bool QTabWidget::hasHeightForWidth() const’ marked override, but does not override
    9. bool hasHeightForWidth() const Q_DECL_OVERRIDE;
    To copy to clipboard, switch view to plain text mode 
    qtabwidget.h is included by a file generated from an .ui file
    I'm using Qt 5.6.1 with g++ 4.8.5 on Linux (openSUSE 42.1)

    How can I get rid of this?

    Ginsengelf
    Last edited by Ginsengelf; 24th January 2017 at 16:47. Reason: Fixed tags

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: bool QTabWidget::hasHeightForWidth() const’ marked override, but does not overrid

    This is strange.
    Qt Code:
    1. bool QWidget::hasHeightForWidth() const
    To copy to clipboard, switch view to plain text mode 
    is virtual, that QTabWidget method does override.

    Do you enable C++11 in your .pro file?

    Cheers,
    _

  3. #3
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: bool QTabWidget::hasHeightForWidth() const’ marked override, but does not overrid

    Hi, I'm on Windows now, but I remember seeing something like "-std=c++0x" or similar, so that would mean "yes, C++11".

    I'll check if it is enabled in the .pro file, or if I can specifically disable it.

    Ginsengelf

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: bool QTabWidget::hasHeightForWidth() const’ marked override, but does not overrid

    Usually that needs to be enabled with "CONFIG += cpp11" or something similar.

    Maybe the compiler is too old to get the override right.

    Cheers,
    _

  5. #5
    Join Date
    Aug 2018
    Location
    South-Africa
    Posts
    3
    Qt products
    Qt5
    Platforms
    Unix/X11

    Cool Re: bool QTabWidget::hasHeightForWidth() const’ marked override, but does not overr

    Quote Originally Posted by anda_skoa View Post
    Usually that needs to be enabled with "CONFIG += cpp11" or something similar.

    Maybe the compiler is too old to get the override right.

    Cheers,
    _
    I had the same thing and after including :

    <QtCore>
    <QtGui>

    everything was working again.

    Regards
    Frik Brits.

Similar Threads

  1. Override locale with QSystemLocale
    By sedi in forum Qt Programming
    Replies: 2
    Last Post: 23rd April 2013, 11:04
  2. Can't override the closeEvent()
    By scot_hansen in forum Newbie
    Replies: 7
    Last Post: 5th October 2010, 23:47
  3. How to override ShowEvent() etc
    By marcvanriet in forum Newbie
    Replies: 1
    Last Post: 22nd September 2010, 11:13
  4. Shortcut override ?
    By fenerista in forum Qt Programming
    Replies: 6
    Last Post: 23rd May 2010, 13:02
  5. Override a signal
    By daviddoria in forum Newbie
    Replies: 4
    Last Post: 9th February 2010, 19:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.