mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 04:39:24 +02:00
Qt: TQtCheckListBox: pass itemclicked after mouse down ,not before
git-svn-id: trunk@35837 -
This commit is contained in:
parent
7ebe5af938
commit
f9662e38fa
@ -11397,11 +11397,7 @@ begin
|
|||||||
if (Item = nil) and (Sender = QWidget_mouseGrabber) then
|
if (Item = nil) and (Sender = QWidget_mouseGrabber) then
|
||||||
QWidget_releaseMouse(QWidgetH(Sender));
|
QWidget_releaseMouse(QWidgetH(Sender));
|
||||||
end else
|
end else
|
||||||
begin
|
Result := SlotMouse(Sender, Event);
|
||||||
MousePos := QMouseEvent_pos(QMouseEventH(Event))^;
|
|
||||||
if Item = nil then
|
|
||||||
Result := inherited itemViewViewportEventFilter(Sender, Event);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -11430,29 +11426,15 @@ begin
|
|||||||
|
|
||||||
if InUpdate or not GetVisible then
|
if InUpdate or not GetVisible then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// fires only when checkBox clicked.
|
|
||||||
QCursor_pos(@AGlobalPos);
|
|
||||||
QWidget_mapFromGlobal(Widget, @APos, @AGlobalPos);
|
|
||||||
AMouseEvent := QMouseEvent_create(QEventMouseButtonPress, @APos,
|
|
||||||
@AGlobalPos, QtLeftButton, QtLeftButton,
|
|
||||||
QApplication_keyboardModifiers());
|
|
||||||
SlotMouse(Widget, AMouseEvent);
|
|
||||||
QMouseEvent_destroy(AMouseEvent);
|
|
||||||
{$note seem that we have qtbug with tristate listwidget items, so
|
{$note seem that we have qtbug with tristate listwidget items, so
|
||||||
we must handle statemap somehow}
|
we must handle statemap somehow}
|
||||||
|
|
||||||
//TODO try to fix nextstatemap
|
//TODO try to fix nextstatemap
|
||||||
if FCheckBoxClicked then
|
if FCheckBoxClicked then
|
||||||
begin
|
begin
|
||||||
FCheckBoxClicked := False;
|
FCheckBoxClicked := False;
|
||||||
SetNextStateMap(item);
|
SetNextStateMap(item);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
AMouseEvent := QMouseEvent_create(QEventMouseButtonRelease, @APos,
|
|
||||||
@AGlobalPos, QtLeftButton, QtLeftButton,
|
|
||||||
QApplication_keyboardModifiers());
|
|
||||||
SlotMouse(Widget, AMouseEvent);
|
|
||||||
QMouseEvent_destroy(AMouseEvent);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TQtCheckListBox.signalSelectionChanged(); cdecl;
|
procedure TQtCheckListBox.signalSelectionChanged(); cdecl;
|
||||||
|
Loading…
Reference in New Issue
Block a user