mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:39:25 +02:00
Qt: Fixed crash on initialization of viewport.
git-svn-id: trunk@12314 -
This commit is contained in:
parent
e779284d35
commit
f6fe5420e0
@ -6405,12 +6405,11 @@ function TQtViewPort.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cde
|
||||
var
|
||||
R: TRect;
|
||||
begin
|
||||
|
||||
case QEvent_type(Event) of
|
||||
QEventResize: Result := False;
|
||||
QEventLayoutRequest:
|
||||
begin
|
||||
{TODO: do something here }
|
||||
{TODO: something here (maybe) }
|
||||
Result := False;
|
||||
end;
|
||||
else
|
||||
@ -6457,17 +6456,16 @@ end;
|
||||
function TQtAbstractScrollArea.EventFilter(Sender: QObjectH; Event: QEventH): Boolean; cdecl;
|
||||
begin
|
||||
case QEvent_type(Event) of
|
||||
QEventPaint: Result := False;
|
||||
QEventResize,
|
||||
QEventPaint,
|
||||
QEventLayoutRequest: Result := False;
|
||||
QEventMouseButtonPress,
|
||||
QEventMouseButtonRelease,
|
||||
QEventMouseButtonDblClick,
|
||||
QEventWheel,
|
||||
QEventLayoutRequest:
|
||||
QEventWheel:
|
||||
begin
|
||||
Result := False;
|
||||
if QEvent_spontaneous(Event) then
|
||||
ViewPortEventFilter(Event, @Result);
|
||||
ViewPortEventFilter(Event, @Result);
|
||||
end;
|
||||
else
|
||||
Result := inherited EventFilter(Sender, Event);
|
||||
|
@ -148,7 +148,6 @@ begin
|
||||
QtAbstractScrollArea := TQtAbstractScrollArea.Create(AWinControl, AParams);
|
||||
QtAbstractScrollArea.setFrameShape(TBorderStyleToQtFrameShapeMap[TCustomControl(AWinControl).BorderStyle]);
|
||||
QtAbstractScrollArea.AttachEvents;
|
||||
QtAbstractScrollArea.viewportNeeded;
|
||||
Result := THandle(QtAbstractScrollArea);
|
||||
|
||||
{$ifdef VerboseQt}
|
||||
@ -172,9 +171,12 @@ begin
|
||||
if not WSCheckHandleAllocated(AWinControl, 'ShowHide') then
|
||||
Exit;
|
||||
|
||||
|
||||
Widget := TQtWidget(AWinControl.Handle);
|
||||
|
||||
if Widget is TQtAbstractScrollArea then
|
||||
TQtAbstractScrollArea(Widget).viewportNeeded;
|
||||
|
||||
// if the widget is a form, this is a place to set the Tab order
|
||||
if AWinControl.HandleObjectShouldBeVisible and (Widget is TQtMainWindow) then
|
||||
begin
|
||||
if fsModal in TForm(AWinControl).FormState then
|
||||
|
Loading…
Reference in New Issue
Block a user