diff --git a/lcl/interfaces/qt/qtwscomctrls.pp b/lcl/interfaces/qt/qtwscomctrls.pp index 22848fe7ee..c8b109dd5d 100644 --- a/lcl/interfaces/qt/qtwscomctrls.pp +++ b/lcl/interfaces/qt/qtwscomctrls.pp @@ -35,7 +35,7 @@ uses {$endif} qtwidgets, qtprivate, qtobjects, // LCL - Classes, ComCtrls, Controls, LCLType, Graphics, LCLProc, LCLIntf, + Classes, ComCtrls, Controls, LCLType, Graphics, LCLProc, LCLIntf, Forms, // Widgetset WSProc, WSComCtrls, WSLCLClasses; @@ -569,6 +569,15 @@ 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); diff --git a/lcl/interfaces/qt/qtwscontrols.pp b/lcl/interfaces/qt/qtwscontrols.pp index 7d1d7705f9..a352051fd5 100644 --- a/lcl/interfaces/qt/qtwscontrols.pp +++ b/lcl/interfaces/qt/qtwscontrols.pp @@ -190,7 +190,14 @@ begin Widget := TQtWidget(AWinControl.Handle); { if the widget is a form, this is a place to set the Tab order } if AWinControl.HandleObjectShouldBeVisible and (Widget is TQtMainWindow) then + begin + if fsModal in TForm(AWinControl).FormState then + begin + QWidget_setWindowFlags(Widget.Widget, QtDialog); + Widget.setWindowModality(QtApplicationModal); + end; TQtMainWindow(Widget).SetTabOrders; + end; if AWinControl.HandleObjectShouldBeVisible then QWidget_setVisible(Widget.Widget, True) diff --git a/lcl/interfaces/qt/qtwsforms.pp b/lcl/interfaces/qt/qtwsforms.pp index 24bb4de0f3..4ac93535fc 100644 --- a/lcl/interfaces/qt/qtwsforms.pp +++ b/lcl/interfaces/qt/qtwsforms.pp @@ -22,7 +22,7 @@ } unit QtWSForms; -{$mode delphi}{$H+} +{$mode objfpc}{$H+} interface @@ -286,27 +286,7 @@ end; ------------------------------------------------------------------------------} class procedure TQtWSCustomForm.ShowModal(const ACustomForm: TCustomForm); begin - {$ifdef VerboseQt} - WriteLn('Trace:> [TQtWSCustomForm.ShowModal]'); - {$endif} - - {if we use QDialog as modal class then everything looks fine} - TQtWidget(ACustomForm.Handle).Hide; - TQtWidget(ACustomForm.Handle).setWindowModality(QtApplicationModal); - TQtWidget(ACustomForm.Handle).Show; - - Application.ProcessMessages; - sleep(10); - Application.ProcessMessages; - - {BUG: if we assign OnCloseQuery(), Lazarus TCustomForm.Close() Fires ModalResult = mrCancel, - without counting on OnCloseQuery() result (CanClose), so if we set it up we'll jump over our - loop, and then comes into LCL loop with WidgetSet.AppProcessMessages - which burns CPU ...} - - {$ifdef VerboseQt} - WriteLn('Trace:< [TQtWSCustomForm.ShowModal]'); - {$endif} + {TODO: fix cpu burning , we need an sleep(0) in LCL modal loop} end; {------------------------------------------------------------------------------