Skip to main content
BParh.1
Senior III
July 17, 2021
Solved

How can we make a Box widget able to detect drag event and differentiate it from single click?

  • July 17, 2021
  • 1 reply
  • 610 views

I create a widget Box, with intention:

  1. For single click , do action 1
  2. For dragging, prevent doing action 1

This mean I need the Box container need to :

  1. Detect drag event. I know how to detect single click but not drag.
  2. Differentiate between drag event and single click.

I tried to tick mixins option for both 'Draggable' and 'ClickListener' then setup in class definition

virtual void handleDragEvent(const DragEvent& event) override {

    // break point here

  }

But when I drag the box, it never hit the breakpoint inside handleDragEvent().

Did I miss anything?

This topic has been closed for replies.
Best answer by BParh.1

Ok I realize we cannot detect drag event from custom container level, it has to be propagated from Screen View level

1 reply

BParh.1
BParh.1AuthorBest answer
Senior III
July 29, 2021

Ok I realize we cannot detect drag event from custom container level, it has to be propagated from Screen View level