mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-27 07:49:20 +02:00
Qt: fix TCheckListBox mouse clicks over checkbox.
git-svn-id: trunk@16304 -
This commit is contained in:
parent
4862e5d1bd
commit
9e2cb70abb
@ -6233,7 +6233,35 @@ end;
|
||||
Returns: Nothing
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TQtListWidget.SignalItemClicked(item: QListWidgetItemH); cdecl;
|
||||
var
|
||||
Msg: TLMMouse;
|
||||
MousePos: TQtPoint;
|
||||
Modifiers: QtKeyboardModifiers;
|
||||
begin
|
||||
if not (LCLObject is TCustomCheckListBox) then
|
||||
exit;
|
||||
QCursor_pos(@MousePos);
|
||||
QWidget_mapFromGlobal(Widget, @MousePos, @MousePos);
|
||||
OffsetMousePos(@MousePos);
|
||||
Msg.Keys := 0;
|
||||
Modifiers := QApplication_keyboardModifiers();
|
||||
Msg.Keys := QtKeyModifiersToKeyState(Modifiers) or MK_LBUTTON;
|
||||
|
||||
Msg.XPos := SmallInt(MousePos.X);
|
||||
Msg.YPos := SmallInt(MousePos.Y);
|
||||
|
||||
Msg.Msg := LM_LBUTTONDOWN;
|
||||
NotifyApplicationUserInput(Msg.Msg);
|
||||
DeliverMessage(Msg);
|
||||
Msg.Msg := LM_PRESSED;
|
||||
DeliverMessage(Msg);
|
||||
|
||||
Msg.Msg := LM_LBUTTONUP;
|
||||
NotifyApplicationUserInput(Msg.Msg);
|
||||
DeliverMessage(Msg);
|
||||
|
||||
Msg.Msg := LM_RELEASED;
|
||||
DeliverMessage(Msg);
|
||||
{does nothing at this time wait more featured LCL implementation
|
||||
eg. OnItemClick}
|
||||
end;
|
||||
@ -8391,7 +8419,6 @@ begin
|
||||
FAbstractItemViewportEventHook := QObject_hook_create(QAbstractScrollArea_viewport(QAbstractScrollAreaH(Widget)));
|
||||
TEventFilterMethod(Method) := @itemViewViewportEventFilter;
|
||||
QObject_hook_hook_events(FAbstractItemViewportEventHook, Method);
|
||||
|
||||
end;
|
||||
|
||||
procedure TQtAbstractItemView.DetachEvents;
|
||||
@ -8412,7 +8439,8 @@ begin
|
||||
{we install only mouse events on QAbstractItemView viewport}
|
||||
Result := False;
|
||||
QEvent_accept(Event);
|
||||
if LCLObject <> nil then
|
||||
if (LCLObject <> nil)
|
||||
and not (LCLObject is TCustomCheckListBox) then
|
||||
begin
|
||||
case QEvent_type(Event) of
|
||||
QEventMouseButtonPress,
|
||||
|
Loading…
Reference in New Issue
Block a user