Project

General

Profile

Actions

Bug #4037

closed

[wt-3.3.4] WInteractWidget::clicked() isn't emitted on right-click.

Added by Стойчо Стефанов Stoycho Stefanov over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
05/04/2015
Due date:
% Done:

0%

Estimated time:

Description

Hey,

WInteractWidget::clicked() is only emitted on a left button mouse click when I'm using a WTableCell. I could work around it using MouseWentUp and MouseWentDown, because they seems to do it correctly and are emitting on right mouse click as well.

Regards,

Stoycho


Files

EmptyHeaderHeight.png (57.4 KB) EmptyHeaderHeight.png header height Стойчо Стефанов Stoycho Stefanov, 05/05/2015 12:24 PM
Actions #1

Updated by Стойчо Стефанов Stoycho Stefanov over 9 years ago

[WAbstractItemView]

Hi,

the same issue refers to a WAbstractItemView as well. Unfortunately, there is no way to react on right mouse click on a header item. There are only headerClicked and headerDoubleClicked and headerMouseWentUp/headerMouseWentDown are missing.

Moreover, when the header data is not explicitly set (there is not item in the model) the corresponding DOM element has zero height and you cannot click the header item (see attached screen shot).

regards,

Stoycho

Actions #2

Updated by Koen Deforche over 9 years ago

  • Status changed from New to InProgress
Actions #3

Updated by Koen Deforche over 9 years ago

Hey, a right button click is a special thing in a browser and can not reliably be caught (there are workarounds by catching 'contextmenu' but as the name says, that's suspiciously hacky).

But the mouseUp/mouseDown signals for headers in WAbstractItemView are indeed lacking and should be added.

Actions #4

Updated by Стойчо Стефанов Stoycho Stefanov over 9 years ago

Hey,

adding mouseUp/mouseDown will be enough, but the behaviour when connecting to this to signals has to be better explained in the reference.

For example if you have a simple WTable with two cell, let say cell_1 and cell_2 and connect their signals as following:

WTableCell *cell_1;
cell_1.maouseWentDown.connect(&setTempCellIndex);
cell_2.mouseWentUp.connect(&useTempCell_2);

So if you click on cell_1 and drag the mouse pointer and release it on the cell_2 than the useTempCell_2 is called as expected.

On the other hand when you connect the mouseWentUp of cell_1 as well, you never get the useTempCell_2 called under the same scenario:

WTableCell *cell_1;
cell_1.maouseWentDown.connect(&setTempCellIndex);
cell_1.mouseWentUp.connect(&useTempCell_1);
cell_2.mouseWentUp.connect(&useTempCell_2);

I cannot judge whether it is a bug or a feature but it has to be better documented at least.

Regards

Stoycho

Actions #5

Updated by Стойчо Стефанов Stoycho Stefanov over 9 years ago

On the other hand when you connect the mouseWentUp of cell_1 as well, you never get the useTempCell_2 called under the same scenario

For clarity, despite you release the mouse button over cell_2 the useTempCell_1 is called because the mouseWentDown and mouseWentWp of cell_1 are both connected, i.e., the gesture begins over cell_1 and despite it ends over cell_2 the slot connected to cell_1's mouseWentUp is called, but the cell_2's mouseWentUp is not.

Actions #6

Updated by Koen Deforche over 9 years ago

  • Status changed from InProgress to Feedback

Hey, this is indeed not well documented, but is the intended behavior as in many cases you may want to unset a (drag-)state in mouseWentUp() that you started in mouseWentDown(). I'm updating the documentation to reflect this.

Actions #7

Updated by Benoit Daccache over 9 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF