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

Don't return COW types by-pointer

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.6.0 Alpha, 6.0 (Next Major Release)
    • Fix Version/s: 5.15
    • Labels:
      None

      Description

      These functions should return by-value, not by-pointer:

      • QLabel::pixmap()
      • QLabel::picture()
      • QBrush::gradient() [*EDIT*: QGradient is not implicitly-shared]
      • QCursor::bitmap()
      • QCursor::mask()

      The old API design is from the days of Qt 1, where the return types were not implicitly-shared. However, this is no longer the case.

      Here's an abandoned initial attempt: https://codereview.qt-project.org/#/c/101233/10//ALL

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                qt.team.quick.subscriptions Qt Quick and Widgets Team
                Reporter:
                jksh Sze Howe Koh
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: