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

Redundant declaration of QPageSize equality operator

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.7.2, 6.8.0 FF
    • 6.4.2
    • GUI: Printing
    • None
    • ubuntu 23.04
    • Linux/X11
    • f24a03a22 (dev), c4086d7b7 (dev), 1941c11b6 (dev), 2117fc2b1 (6.7), 98046f48f (6.7), 624fd64d1 (6.7), 8a5a0e1b9 (tqtc/lts-6.5)

    Description

      The equality operator of QPageSize is redundantly declared and results in a warning / error (with -Werror):

      In file included from /usr/include/x86_64-linux-gnu/qt6/QtGui/qpagelayout.h:12,
                       from /usr/include/x86_64-linux-gnu/qt6/QtGui/qpagedpaintdevice.h:9,
                       from /usr/include/x86_64-linux-gnu/qt6/QtPrintSupport/qprinter.h:10,
                       from /usr/include/x86_64-linux-gnu/qt6/QtPrintSupport/QPrinter:1,
      [...]
      /usr/include/x86_64-linux-gnu/qt6/QtGui/qpagesize.h:252:77: error: ‘bool operator==(const QPageSize&, const QPageSize&)’ is already a friend of class ‘QPageSize’ [-Werror=redundant-decls]
        252 |     friend inline bool operator==(const QPageSize &lhs, const QPageSize &rhs)
            |                                                                             ^

      In Qt 6.4.2 the operator is declared and then re-declared and defined in qpagesize.h line 206 and 252+253:

      friend Q_GUI_EXPORT bool operator==(const QPageSize &lhs, const QPageSize &rhs); 
      friend inline bool operator==(const QPageSize &lhs, const QPageSize &rhs)
      { return lhs.equals(rhs); }
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-115583
          # Subject Branch Project Status CR V

          Activity

            People

              vhilshei Volker Hilsheimer
              ablotz Alan Blotz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: