mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 16:31:40 +02:00
Qt5: set mouse capture automatically. Qt4 and Qt6 works correct without such patch. issue #41341
This commit is contained in:
parent
84d6f2e2e3
commit
eba745ba63
@ -875,6 +875,32 @@ begin
|
||||
FreeSysColorBrushes(True);
|
||||
end;
|
||||
end;
|
||||
|
||||
QEventMouseButtonPress:
|
||||
begin
|
||||
if QObject_isWidgetType(Sender) then
|
||||
begin
|
||||
W := TQtWidget(HwndFromWidgetH(QWidgetH(Sender)));
|
||||
|
||||
if (W <> nil) and QWidget_isVisible(QWidgetH(Sender)) and QWidget_isEnabled(QWidgetH(Sender)) then
|
||||
begin
|
||||
if QWidget_focusPolicy(QWidgetH(Sender)) <> QtNoFocus then
|
||||
begin
|
||||
QWidget_grabMouse(QWidgetH(Sender));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
QEventMouseButtonRelease:
|
||||
begin
|
||||
if QObject_isWidgetType(Sender) then
|
||||
begin
|
||||
W := TQtWidget(HwndFromWidgetH(QWidgetH(Sender)));
|
||||
if W <> nil then
|
||||
QWidget_releaseMouse(QWidgetH(Sender));
|
||||
end;
|
||||
end;
|
||||
|
||||
{$IFNDEF QTUSEFOCUSCHANGEDHOOK}
|
||||
QEventFocusIn:
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user