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

gcc 10.1 will cast to QCursor if you try to call operator== on two QPixmap

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.x
    • GUI: Painting
    • None
    • 64bit ArchLinux, gcc (GCC) 10.1.0, updated today (2020-08-11)
    • All
    • b39685d4c26009d6f85cbbee287d5647a7bd6fe4 (qt/qtbase/dev)

    Description

      QPixmap has no operator== (historic reasons?), my compiler thinks it's a valid way forward to cast both with QCursor(const QPixmap &pixmap, int hotX=-1, int hotY=-1) and then compare those.

      Which clearly isn't a good thing (to do implicitly). There a multiple issues with this (can't probably compare null pixmaps, performance, expected behavior, ...).

      I personally see 3 possible solutions:

      • make a operator== for qpixmap that is private - this will cause the compiler to complain that you're calling a private function
      • make the ctor of QCursor explicit - this will make the compiler complain that there isn't any operator== suitable (I think?)
      • make a proper and public operator== for qpixmap - this will make comparing them just work (for that you could rely on QPixmap::cacheKey() ? Maybe?)

      Attachments

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              nicolauz Thomas Senyk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes