mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 01:42:17 +02:00
Qt: fixed bug when TQtAbstractScrollArea didn't propagate mouse move events after clicking on it's viewport because mousepropagation is disabled.
New behavior: never disable mouse propagation on scroll area viewport. git-svn-id: trunk@27748 -
This commit is contained in:
parent
72e07feaae
commit
e8d188bf55
@ -166,6 +166,7 @@ type
|
|||||||
function DeliverMessage(var Msg): LRESULT; virtual;
|
function DeliverMessage(var Msg): LRESULT; virtual;
|
||||||
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
|
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl; override;
|
||||||
function getAcceptDropFiles: Boolean; virtual;
|
function getAcceptDropFiles: Boolean; virtual;
|
||||||
|
procedure SetNoMousePropagation(Sender: QWidgetH; const ANoMousePropagation: Boolean); virtual;
|
||||||
procedure SlotShow(vShow: Boolean); cdecl;
|
procedure SlotShow(vShow: Boolean); cdecl;
|
||||||
function SlotClose: Boolean; cdecl; virtual;
|
function SlotClose: Boolean; cdecl; virtual;
|
||||||
procedure SlotDestroy; cdecl;
|
procedure SlotDestroy; cdecl;
|
||||||
@ -385,6 +386,7 @@ type
|
|||||||
procedure setHorizontalScrollBar(AScrollBar: TQtScrollBar);
|
procedure setHorizontalScrollBar(AScrollBar: TQtScrollBar);
|
||||||
procedure setVerticalScrollBar(AScrollBar: TQtScrollBar);
|
procedure setVerticalScrollBar(AScrollBar: TQtScrollBar);
|
||||||
procedure setScrollStyle(AScrollStyle: TScrollStyle);
|
procedure setScrollStyle(AScrollStyle: TScrollStyle);
|
||||||
|
procedure SetNoMousePropagation(Sender: QWidgetH; const ANoMousePropagation: Boolean); override;
|
||||||
procedure DestroyNotify(AWidget: TQtWidget); override;
|
procedure DestroyNotify(AWidget: TQtWidget); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Update(ARect: PRect = nil); override;
|
procedure Update(ARect: PRect = nil); override;
|
||||||
@ -2202,6 +2204,12 @@ begin
|
|||||||
Result := TQtMainWindow(Form.Handle).getAcceptDropFiles;
|
Result := TQtMainWindow(Form.Handle).getAcceptDropFiles;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TQtWidget.SetNoMousePropagation(Sender: QWidgetH;
|
||||||
|
const ANoMousePropagation: Boolean);
|
||||||
|
begin
|
||||||
|
QWidget_setAttribute(Sender, QtWA_NoMousePropagation, ANoMousePropagation);
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: TQtWidget.SlotShow
|
Function: TQtWidget.SlotShow
|
||||||
Params: None
|
Params: None
|
||||||
@ -2379,7 +2387,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
NotifyApplicationUserInput(Msg.Msg);
|
NotifyApplicationUserInput(Msg.Msg);
|
||||||
DeliverMessage(Msg);
|
DeliverMessage(Msg);
|
||||||
QWidget_setAttribute(QWidgetH(Sender), QtWA_NoMousePropagation, True);
|
SetNoMousePropagation(QWidgetH(Sender), True);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2712,7 +2720,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
NotifyApplicationUserInput(Msg.Msg);
|
NotifyApplicationUserInput(Msg.Msg);
|
||||||
DeliverMessage(Msg);
|
DeliverMessage(Msg);
|
||||||
QWidget_setAttribute(QWidgetH(Sender), QtWA_NoMousePropagation, True);
|
SetNoMousePropagation(QWidgetH(Sender), True);
|
||||||
end;
|
end;
|
||||||
QEventMouseButtonRelease:
|
QEventMouseButtonRelease:
|
||||||
begin
|
begin
|
||||||
@ -2727,7 +2735,7 @@ begin
|
|||||||
|
|
||||||
NotifyApplicationUserInput(Msg.Msg);
|
NotifyApplicationUserInput(Msg.Msg);
|
||||||
DeliverMessage(Msg);
|
DeliverMessage(Msg);
|
||||||
QWidget_setAttribute(QWidgetH(Sender), QtWA_NoMousePropagation, True);
|
SetNoMousePropagation(QWidgetH(Sender), True);
|
||||||
|
|
||||||
{ Clicking on buttons operates differently, because QEventMouseButtonRelease
|
{ Clicking on buttons operates differently, because QEventMouseButtonRelease
|
||||||
is sent if you click a control, drag the mouse out of it and release, but
|
is sent if you click a control, drag the mouse out of it and release, but
|
||||||
@ -2904,7 +2912,7 @@ begin
|
|||||||
|
|
||||||
NotifyApplicationUserInput(Msg.Msg);
|
NotifyApplicationUserInput(Msg.Msg);
|
||||||
DeliverMessage(Msg);
|
DeliverMessage(Msg);
|
||||||
QWidget_setAttribute(QWidgetH(Sender), QtWA_NoMousePropagation, True);
|
SetNoMousePropagation(QWidgetH(Sender), True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -3216,7 +3224,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
if Assigned(LCLObject.PopupMenu) then
|
if Assigned(LCLObject.PopupMenu) then
|
||||||
QEvent_ignore(Event);
|
QEvent_ignore(Event);
|
||||||
QWidget_setAttribute(QWidgetH(Sender), QtWA_NoMousePropagation, False);
|
SetNoMousePropagation(QWidgetH(Sender), False);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Result and (csDesigning in LCLObject.ComponentState) then
|
if Result and (csDesigning in LCLObject.ComponentState) then
|
||||||
@ -6861,7 +6869,7 @@ begin
|
|||||||
if QMouseEvent_button(QMouseEventH(Event)) = QtLeftButton then
|
if QMouseEvent_button(QMouseEventH(Event)) = QtLeftButton then
|
||||||
begin
|
begin
|
||||||
Result := SlotTabBarMouse(Sender, Event);
|
Result := SlotTabBarMouse(Sender, Event);
|
||||||
QWidget_setAttribute(QWidgetH(Sender), QtWA_NoMousePropagation, False);
|
SetNoMousePropagation(QWidgetH(Sender), False);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
@ -11401,6 +11409,15 @@ begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TQtAbstractScrollArea.SetNoMousePropagation(Sender: QWidgetH;
|
||||||
|
const ANoMousePropagation: Boolean);
|
||||||
|
begin
|
||||||
|
if Sender = viewportWidget then
|
||||||
|
inherited SetNoMousePropagation(Sender, False)
|
||||||
|
else
|
||||||
|
inherited SetNoMousePropagation(Sender, ANoMousePropagation);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TQtAbstractScrollArea.DestroyNotify(AWidget: TQtWidget);
|
procedure TQtAbstractScrollArea.DestroyNotify(AWidget: TQtWidget);
|
||||||
begin
|
begin
|
||||||
if AWidget = FHScrollbar then
|
if AWidget = FHScrollbar then
|
||||||
|
Loading…
Reference in New Issue
Block a user