mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 22:29:36 +02:00
Qt: do not crash in TQtPage if parent is TTabControl
git-svn-id: trunk@42628 -
This commit is contained in:
parent
2743011353
commit
7c723d7f81
@ -15699,6 +15699,9 @@ begin
|
|||||||
AParent := getTabWidget;
|
AParent := getTabWidget;
|
||||||
if CanReturnIndex or ATextChanging then
|
if CanReturnIndex or ATextChanging then
|
||||||
Result := QTabWidget_indexOf(AParent, Widget)
|
Result := QTabWidget_indexOf(AParent, Widget)
|
||||||
|
else
|
||||||
|
if not QObject_inherits(QWidget_parentWidget(Widget),'QStackedWidget') then
|
||||||
|
Result := 0
|
||||||
else
|
else
|
||||||
Result := -1;
|
Result := -1;
|
||||||
end;
|
end;
|
||||||
@ -15709,7 +15712,8 @@ var
|
|||||||
begin
|
begin
|
||||||
// it is placed to the stack widget and stack widget into tab widget
|
// it is placed to the stack widget and stack widget into tab widget
|
||||||
AParent := QWidget_parentWidget(Widget);
|
AParent := QWidget_parentWidget(Widget);
|
||||||
if AParent <> nil then
|
// do not localize !
|
||||||
|
if (AParent <> nil) and QObject_inherits(AParent,'QStackedWidget') then
|
||||||
Result := QTabWidgetH(QWidget_parentWidget(AParent))
|
Result := QTabWidgetH(QWidget_parentWidget(AParent))
|
||||||
else
|
else
|
||||||
Result := nil;
|
Result := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user