Qt: fixed proper restoring of forms in AppRestore (eg. maximized forms)

git-svn-id: trunk@25449 -
This commit is contained in:
zeljko 2010-05-15 21:27:29 +00:00
parent efdcd83830
commit 05f1f285ca
2 changed files with 13 additions and 10 deletions

View File

@ -65,8 +65,7 @@ type
// global hooks
FAppEvenFilterHook: QObject_hookH;
FAppFocusChangedHook: QApplication_hookH;
FOldFocusWidget: QWidgetH;
FDockImage: QRubberBandH;
FDragImageList: QWidgetH;
FDragHotSpot: TPoint;

View File

@ -121,8 +121,6 @@ var
begin
WakeMainThread := @OnWakeMainThread;
FOldFocusWidget := nil;
{
check whether this hook crashes on linux & darwin and why it is so
we need this hook to catch release messages
@ -220,6 +218,7 @@ procedure TQtWidgetSet.AppMinimize;
var
i: Integer;
AForm: TCustomForm;
States: QtWindowStates;
{$ENDIF}
begin
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
@ -236,9 +235,11 @@ begin
)
and
not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
not (AForm.BorderStyle in [bsNone])
then
TQtMainWindow(AForm.Handle).ShowMinimized;
not (AForm.BorderStyle in [bsNone]) then
begin
States := TQtMainWindow(AForm.Handle).getWindowState;
TQtMainWindow(AForm.Handle).setWindowState(States or QtWindowMinimized);
end;
end;
{$ELSE}
TQtMainWindow(Application.MainForm.Handle).ShowMinimized;
@ -251,6 +252,7 @@ procedure TQtWidgetSet.AppRestore;
var
i: Integer;
AForm: TCustomForm;
States: QtWindowStates;
{$ENDIF}
begin
if (Application.MainForm <> nil) and (Application.MainForm.HandleAllocated) then
@ -268,9 +270,11 @@ begin
)
and
not (AForm.FormStyle in [fsMDIChild, fsSplash]) and
not (AForm.BorderStyle in [bsNone])
then
TQtMainWindow(AForm.Handle).ShowNormal;
not (AForm.BorderStyle in [bsNone]) then
begin
States := TQtMainWindow(AForm.Handle).getWindowState;
TQtMainWindow(AForm.Handle).setWindowState(States and not QtWindowMinimized);
end;
end;
{$ELSE}
TQtMainWindow(Application.MainForm.Handle).ShowNormal;