[Qt] Compiling with 2.3.1

Den Jean Den.Jean at telenet.be
Wed Jan 9 20:03:01 CET 2008


On Wednesday 09 January 2008 02:38:56 am Paul Ishenin wrote:
> Sorry, I thought I fixed all issues with fpc 2.3.1
Me sorry, I reacted on the mail without checking first.

It is ok now.
But the LCL/Qt does not support Qt 4.2.3 anymore:

*) Define const this way:
const
  LCLQt_Destroy = QEventType(Ord(QEventUser) + $1000);
-> works when QEventUser is enum (Qt 4.2.3) and Int (Qt 4.3.1). 

*)
PostEvent does not have a priority in Qt 4.2.3. With the enum fixed you can 
use the readable enum now :-)  (QtLowEventPriority)
QCoreApplication_postEvent(QCoreApplication_instance(), AEvent{, -1});


And a lot of advanced use of enums of Qt 4.3. Perhaps fixable as below (I do 
not know what you do there). But you can also drop Qt 4.2 :-) It makes it 
simpler for people to start also. Now the default mostly does not compile :-)

Index: lcl/interfaces/qt/qtthemes.pas
===================================================================
--- lcl/interfaces/qt/qtthemes.pas	(revision 13690)
+++ lcl/interfaces/qt/qtthemes.pas	(working copy)
@@ -161,8 +161,11 @@
         Context.save;
         case Element.ComplexControl of
           QStyleCC_ToolButton: opt := QStyleOptionToolButton_create();
-          QStyleCC_TitleBar,
-          QStyleCC_MdiControls:
+          QStyleCC_TitleBar
+{$IFDEF USE_QT_4_3}
+          ,QStyleCC_MdiControls
+{$ENDIF}
+          :
           begin
             opt := QStyleOptionTitleBar_create();
             QStyleOptionTitleBar_setTitleBarFlags(QStyleOptionTitleBarH(opt), 
QtWindow or QtWindowSystemMenuHint);
@@ -370,21 +373,25 @@
         case Details.Part of
           WP_SYSBUTTON: Result.SubControls := QStyleSC_TitleBarSysMenu;
           WP_MINBUTTON: Result.SubControls := QStyleSC_TitleBarMinButton;
+{$IFDEF USE_QT_4_3}
           WP_MDIMINBUTTON: Result.SubControls := QStyleSC_MdiMinButton;
+          WP_MDICLOSEBUTTON: Result.SubControls := QStyleSC_MdiCloseButton;
+          WP_MDIRESTOREBUTTON: Result.SubControls := 
QStyleSC_MdiNormalButton;
+{$ENDIF}
           WP_MAXBUTTON: Result.SubControls := QStyleSC_TitleBarMaxButton;
           WP_CLOSEBUTTON: Result.SubControls := QStyleSC_TitleBarCloseButton;
           WP_SMALLCLOSEBUTTON: Result.SubControls := 
QStyleSC_TitleBarCloseButton;
-          WP_MDICLOSEBUTTON: Result.SubControls := QStyleSC_MdiCloseButton;
           WP_RESTOREBUTTON: Result.SubControls := 
QStyleSC_TitleBarNormalButton;
-          WP_MDIRESTOREBUTTON: Result.SubControls := 
QStyleSC_MdiNormalButton;
           WP_HELPBUTTON: Result.SubControls := 
QStyleSC_TitleBarContextHelpButton;
           WP_MDIHELPBUTTON: Result.SubControls := 
QStyleSC_TitleBarContextHelpButton;
         else
           Result.SubControls := QStyleSC_None;
         end;
+{$IFDEF USE_QT_4_3}
         if Result.SubControls >= QStyleSC_MdiMinButton then
           Result.ComplexControl := QStyleCC_MdiControls
         else
+{$ENDIF}
           Result.ComplexControl := QStyleCC_TitleBar;
         Result.DrawVariant := qdvComplexControl; 



More information about the Qt mailing list