Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2008-01

Compiling with 2.3.1

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Den Jean

Hi,

on OS X I need to compile with fpc 2.3.1. (bug in 2.2.0 OS X release)

But the fpc 2.3.1 is much more strict and the current lazarus qt code base does not compile with fpc 2.3.1

Can you fix the different small mistakes that prevent from compiling with 2.3.1?

And also commit V1.57 qt4.pas/qt43.pas please :-)

for example:
define a GUID for IQtEdit

Index: lcl/interfaces/qt/qtwidgets.pas
=================================================================== --- lcl/interfaces/qt/qtwidgets.pas (revision 13629) +++ lcl/interfaces/qt/qtwidgets.pas (working copy) @@ -59,6 +59,7 @@
{ IQtTextEdit }

   IQtEdit = interface
+    ['{9348d2c8-f5ac-455a-ac41-f4cace18102d}']
     function getMaxLength: Integer;
     function getSelectionStart: Integer;
     function getSelectionLength: Integer;

the function results in the interface and the implementation section sometimes differ:

Index: lcl/interfaces/qt/qtwinapih.inc
===================================================================
--- lcl/interfaces/qt/qtwinapih.inc	(revision 13629)
+++ lcl/interfaces/qt/qtwinapih.inc	(working copy)
@@ -59,7 +59,7 @@
 function CreateEllipticRgn(p1, p2, p3, p4: Integer): HRGN; override;
 function CreateFontIndirect(const LogFont: TLogFont): HFONT; override;
 function CreateFontIndirectEx(const LogFont: TLogFont; const LongFontName:
string): HFONT; override;
-function CreatePenIndirect(const LogPen: TLogPen): HBRUSH; override;
+function CreatePenIndirect(const LogPen: TLogPen): HPen; override;
 function CreatePolygonRgn(Points: PPoint; NumPts: Integer; FillMode:
integer): HRGN; override;
 function CreateRectRgn(X1, Y1, X2, Y2: Integer): HRGN; override;
Index: lcl/interfaces/qt/qtwscomctrls.pp
===================================================================
--- lcl/interfaces/qt/qtwscomctrls.pp	(revision 13629)
+++ lcl/interfaces/qt/qtwscomctrls.pp	(working copy)
@@ -80,7 +80,7 @@
   protected
   public
     class function  CreateHandle(const AWinControl: TWinControl;
-     const AParams: TCreateParams): TLCLIntfHandle; override;
+     const AParams: TCreateParams): HWnd; override;
   public
     class procedure ColumnDelete(const ALV: TCustomListView; const AIndex:
Integer); override;
     class procedure ColumnInsert(const ALV: TCustomListView; const AIndex:
Integer; const AColumn: TListColumn); override;
Index: lcl/interfaces/qt/qtwsstdctrls.pp
===================================================================
--- lcl/interfaces/qt/qtwsstdctrls.pp	(revision 13629)
+++ lcl/interfaces/qt/qtwsstdctrls.pp	(working copy)
@@ -52,7 +52,7 @@
   protected
   public
     class function  CreateHandle(const AWinControl: TWinControl;
-      const AParams: TCreateParams): TLCLIntfHandle; override;
+      const AParams: TCreateParams): HWnd; override;
     class procedure SetParams(const AScrollBar: TCustomScrollBar); override;
   end;
@@ -114,7 +114,7 @@
   protected
   public
     class function  CreateHandle(const AWinControl: TWinControl;
-     const AParams: TCreateParams): TLCLIntfHandle; override;
+     const AParams: TCreateParams): HWnd; override;
   public
     class function GetIndexAtY(const ACustomListBox: TCustomListBox; y:
integer): integer; override;
     class function GetItemIndex(const ACustomListBox: TCustomListBox):
integer; override;

Reply by email

Paul Ishenin
to Den Jean
Den Jean wrote
And also commit V1.57 qt4.pas/qt43.pas please :-

The problem with 1.57 is that I dont have windows binary and I cannot test it as result.

Best regards,
Paul Ishenin.

Reply by email

Den Jean
to Felipe Monteiro de Carvalho
am Felipe Monteiro de Carvalho wrote
Ummm, it would actually be better if you tested with fpc 2.2.1, because the next releases will be based on 2.2.2 and not on 2.4 (which may take years to come).

I have put the symlink back to 2.2.1, but the reported bugs about the different interface/implementation section should be fixed. The interface and implementation should be equal.

Reply by email

Paul Ishenin
to Den Jean
Den Jean wrote 7 lines
On Sunday 06 January 2008 10:29:00 am Felipe Monteiro de Carvalho wrote: > Ummm, it would actually be better if you tested with fpc 2.2.1, > because the next releases will be based on 2.2.2 and not on 2.4 (which > may take years to come). I have put the symlink back to 2.2.1, but the reported bugs about the different interface/implementation section should be fixed. The interface and implementation should be equal.

Sorry, I thought I fixed all issues with fpc 2.3.1

Best regards,
Paul Ishenin.

Reply by email

Den Jean
to Paul Ishenin
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;

Reply by email

Paul Ishenin
to Den Jean
Den Jean wrote 6 lines
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:

[skip]

Thanks, applied in r13707.

Best regards,
Paul Ishenin.

Reply by email

Den Jean
to Den Jean: Me sorry, I reacted on the mail without checking first. It is ok now. But the LCL/Qt does…
pm Den Jean wrote
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});

To be more clear

Index: lcl/interfaces/qt/qtobjects.pas
=================================================================== --- lcl/interfaces/qt/qtobjects.pas (revision 13716) +++ lcl/interfaces/qt/qtobjects.pas (working copy) @@ -615,7 +615,11 @@

   begin
     AEvent := QLCLMessageEvent_create(LCLQt_Destroy);
     QLCLMessageEvent_setWParam(AEvent, PtrUInt(Self));

- QCoreApplication_postEvent(QCoreApplication_instance(), AEvent, Ord(QtLowEventPriority));
+ QCoreApplication_postEvent(QCoreApplication_instance(), AEvent
+ {$IFDEF QT_USE_4_3}
+ ,Ord(QtLowEventPriority)
+ {$ENDIF}
+ );

     //WriteLn('Posted release event');
   end
   else

Reply by email