Qt: TQtWSCustomTabControl.SetPageIndex() simplified, added handleallocated check because LCL is setting visibleindex of page

git-svn-id: trunk@33957 -
This commit is contained in:
zeljko 2011-12-04 16:53:57 +00:00
parent 7554ee973e
commit 8719c7e475

View File

@ -233,11 +233,12 @@ begin
Exit;
TabWidget := TQtTabWidget(ATabControl.Handle);
if (AIndex < 0) or (AIndex > TabWidget.getCount - 1) then
if (AIndex < 0) or (AIndex > ATabControl.PageCount - 1) then
exit;
TabWidget.BeginUpdate;
TabWidget.setCurrentWidget(TQtWidget(ATabControl.Page[AIndex].Handle));
if ATabControl.Page[AIndex].HandleAllocated then
TabWidget.setCurrentWidget(TQtWidget(ATabControl.Page[AIndex].Handle));
TabWidget.EndUpdate;
end;