Qt: do not crash in TQtPage if parent is TTabControl

git-svn-id: trunk@42628 -
This commit is contained in:
zeljko 2013-09-06 06:14:52 +00:00
parent 2743011353
commit 7c723d7f81

View File

@ -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;