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

acceptTouchEvents is misleading

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: Widgets: GraphicsView
    • Labels:
      None
    • Platform/s:
      All

      Description

      The name of QGraphicsItem::acceptTouchEvents is misleading, as in the following code:

      auto* pItem = new MyTouchButtonItem();
      pItem->acceptTouchEvent();
      pMyScene->addItem(pItem);
      

      I understand that changing the name would be a breaking change, so I suggest an alternative:

      Make the return value [[nodiscard]], so the code above would at least trigger a warning.

        Attachments

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

          Activity

            People

            Assignee:
            bibr Andreas Aardal Hanssen
            Reporter:
            asperamanca Robert Schimkowitsch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes