From a963094291800ccb10bbefa581fdee24b0b02742 Mon Sep 17 00:00:00 2001 From: zeljko Date: Fri, 20 Jul 2007 07:28:53 +0000 Subject: [PATCH] * Fixed TStatusBar regressions under linux (not visible) introduced by latest patches. git-svn-id: trunk@11583 - --- lcl/interfaces/qt/qtwscomctrls.pp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/lcl/interfaces/qt/qtwscomctrls.pp b/lcl/interfaces/qt/qtwscomctrls.pp index 40f1a1516c..4ef59e0b37 100644 --- a/lcl/interfaces/qt/qtwscomctrls.pp +++ b/lcl/interfaces/qt/qtwscomctrls.pp @@ -54,6 +54,7 @@ type class procedure Update(const AStatusBar: TStatusBar); override; class procedure GetPreferredSize(const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); override; + class procedure AddControl(const AControl: TControl); override; end; { TQtWSTabSheet } @@ -528,15 +529,6 @@ begin end; end; - {some systems doesn't show statusbar inside mainwindow - (linux tested on FC3,FC4,FC7 ).} - {$ifdef linux} - if Assigned(AWinControl.Parent) - and (AWinControl.Parent.Handle = Application.MainForm.Handle) - then - QMainWindow_setStatusBar(QMainWindowH(TQtMainWindow(AWinControl.Parent.Handle).Widget), QStatusBarH(QtStatusBar.Widget)); - {$endif} - // Return handle Result := THandle(QtStatusBar); @@ -707,6 +699,25 @@ begin end; +class procedure TQtWSStatusBar.AddControl(const AControl: TControl); +var + QtStatusBar: TQtStatusBar; +begin + inherited AddControl(AControl); + + {some systems doesn't show statusbar inside mainwindow + (linux tested on FC3,FC4,FC7,Ubuntu 7.04 ).} + {$ifdef linux} + if Assigned(AControl.Parent) + and (AControl.Parent.Handle = Application.MainForm.Handle) + then + begin + QtStatusBar := TQtStatusBar(TWinControl(AControl).Handle); + QMainWindow_setStatusBar(QMainWindowH(TQtMainWindow(AControl.Parent.Handle).Widget), QStatusBarH(QtStatusBar.Widget)); + end; + {$endif} +end; + { TQtWSCustomListView } {------------------------------------------------------------------------------