Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76852

QLayout base class destructor not virtual

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 3.x, 4.8.7, 5.6.3, 5.9.8, 5.12.4
    • Widgets: Layout
    • None
    • All

    Description

      The destructor definition in QLayout in qtbase src/widgets/kernel/qlayout.h does not have a virtual specifier. It seems most all compilers in use building Qt and Qt applications assume this will be virtual and mark it so, however this is non-standards-conforming behavior.

      According to the standard, it should be marked virtual.
      This is pretty clear (though this isn't a direct copy of the standard - that is behind a paywall):
      https://en.cppreference.com/w/cpp/language/destructor#Virtual_destructors
       

      class Q_WIDGETS_EXPORT QLayout : public QObject, public QLayoutItem
      {
          Q_OBJECT
      [...]
      public:
      [...]
          QLayout(QWidget *parent);
          QLayout();
          ~QLayout();
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            kkyzivat Keith Kyzivat
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes