View Issue Details

IDProjectCategoryView StatusLast Update
0036238LazarusWidgetsetpublic2019-12-29 11:46
ReporterAlfredAssigned ToZeljan Rikalo 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWindowsOSOS Version
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0036238: Range error in qt56.pas with FPC trunk
DescriptionCompiling qt56.pas errors out on range errors with FPC trunk.

The included patch solves.
TagsNo tags attached.
Fixed in Revision62453
LazTarget-
WidgetsetQT, QT5
Attached Files
  • cleanqt56.patch (1,296 bytes)
    Index: lcl/interfaces/qt5/qt56.pas
    ===================================================================
    --- lcl/interfaces/qt5/qt56.pas	(revision 62146)
    +++ lcl/interfaces/qt5/qt56.pas	(working copy)
    @@ -12513,7 +12513,7 @@
         QStyleCE_ColumnViewGrip,
         QStyleCE_ItemViewItem,
         QStyleCE_ShapedFrame,
    -    QStyleCE_CustomBase = $f0000000 );
    +    QStyleCE_CustomBase = $f000000 );
     
       QStyleComplexControl = (  //QStyle::ComplexControl (2)
         QStyleCC_SpinBox,
    @@ -12525,7 +12525,7 @@
         QStyleCC_Dial,
         QStyleCC_GroupBox,
         QStyleCC_MdiControls,
    -    QStyleCC_CustomBase = $f0000000 );
    +    QStyleCC_CustomBase = $f000000 );
     
     type
       QStyleSubControl = cardinal; // QStyle::SubControl
    @@ -12601,7 +12601,7 @@
         QStyleCT_GroupBox,
         QStyleCT_MdiControls,
         QStyleCT_ItemViewItem,
    -    QStyleCT_CustomBase = $f0000000 );
    +    QStyleCT_CustomBase = $f000000 );
     
       QStyleStandardPixmap = (  //QStyle::StandardPixmap (2)
         QStyleSP_TitleBarMenuButton,
    @@ -12674,7 +12674,7 @@
         QStyleSP_MediaSeekBackward,
         QStyleSP_MediaVolume,
         QStyleSP_MediaVolumeMuted,
    -    QStyleSP_CustomBase = $f0000000 );
    +    QStyleSP_CustomBase = $f000000 );
     
     type
       QStylePrimitiveElement = cardinal; //  QStyle::PrimitiveElement (4)
    
    cleanqt56.patch (1,296 bytes)
  • qt1.diff (4,475 bytes)
    Index: lcl/interfaces/qt/qt45.pas
    ===================================================================
    --- lcl/interfaces/qt/qt45.pas	(revision 62400)
    +++ lcl/interfaces/qt/qt45.pas	(working copy)
    @@ -10648,7 +10648,8 @@
     
     type
       QStyleControlElement = (  //QStyle::ControlElement (2)
    -    QStyleCE_PushButton,
    +    QStyleCE_CustomBase = LongInt($f0000000),
    +    QStyleCE_PushButton = 0,
         QStyleCE_PushButtonBevel,
         QStyleCE_PushButtonLabel,
         QStyleCE_CheckBox,
    @@ -10695,11 +10696,12 @@
         QStyleCE_HeaderEmptyArea,
         QStyleCE_ColumnViewGrip,
         QStyleCE_ItemViewItem,
    -    QStyleCE_ShapedFrame,
    -    QStyleCE_CustomBase = $f0000000 );
    +    QStyleCE_ShapedFrame
    +    );
     
       QStyleComplexControl = (  //QStyle::ComplexControl (2)
    -    QStyleCC_SpinBox,
    +    QStyleCC_CustomBase = LongInt($f0000000),
    +    QStyleCC_SpinBox = 0,
         QStyleCC_ComboBox,
         QStyleCC_ScrollBar,
         QStyleCC_Slider,
    @@ -10708,8 +10710,8 @@
         QStyleCC_Q3ListView,
         QStyleCC_Dial,
         QStyleCC_GroupBox,
    -    QStyleCC_MdiControls,
    -    QStyleCC_CustomBase = $f0000000 );
    +    QStyleCC_MdiControls
    +    );
     
     type
       QStyleSubControl = cardinal; // QStyle::SubControl
    @@ -10764,7 +10766,8 @@
     
     type
       QStyleContentsType = (  //QStyle::ContentsType (2)
    -    QStyleCT_PushButton,
    +    QStyleCT_CustomBase = LongInt($f0000000),
    +    QStyleCT_PushButton = 0,
         QStyleCT_CheckBox,
         QStyleCT_RadioButton,
         QStyleCT_ToolButton,
    @@ -10788,11 +10791,12 @@
         QStyleCT_HeaderSection,
         QStyleCT_GroupBox,
         QStyleCT_MdiControls,
    -    QStyleCT_ItemViewItem,
    -    QStyleCT_CustomBase = $f0000000 );
    +    QStyleCT_ItemViewItem
    +    );
     
       QStyleStandardPixmap = (  //QStyle::StandardPixmap (2)
    -    QStyleSP_TitleBarMenuButton,
    +    QStyleSP_CustomBase = LongInt($f0000000),
    +    QStyleSP_TitleBarMenuButton = 0,
         QStyleSP_TitleBarMinButton,
         QStyleSP_TitleBarMaxButton,
         QStyleSP_TitleBarCloseButton,
    @@ -10860,8 +10864,8 @@
         QStyleSP_MediaSeekForward,
         QStyleSP_MediaSeekBackward,
         QStyleSP_MediaVolume,
    -    QStyleSP_MediaVolumeMuted,
    -    QStyleSP_CustomBase = $f0000000 );
    +    QStyleSP_MediaVolumeMuted
    +    );
     
     type
       QStylePrimitiveElement = cardinal; //  QStyle::PrimitiveElement (4)
    Index: lcl/interfaces/qt5/qt56.pas
    ===================================================================
    --- lcl/interfaces/qt5/qt56.pas	(revision 62400)
    +++ lcl/interfaces/qt5/qt56.pas	(working copy)
    @@ -12467,7 +12467,8 @@
     
     type
       QStyleControlElement = (  //QStyle::ControlElement (2)
    -    QStyleCE_PushButton,
    +    QStyleCE_CustomBase = LongInt($f0000000),
    +    QStyleCE_PushButton = 0,
         QStyleCE_PushButtonBevel,
         QStyleCE_PushButtonLabel,
         QStyleCE_CheckBox,
    @@ -12513,11 +12514,12 @@
         QStyleCE_HeaderEmptyArea,
         QStyleCE_ColumnViewGrip,
         QStyleCE_ItemViewItem,
    -    QStyleCE_ShapedFrame,
    -    QStyleCE_CustomBase = $f0000000 );
    +    QStyleCE_ShapedFrame
    +    );
     
       QStyleComplexControl = (  //QStyle::ComplexControl (2)
    -    QStyleCC_SpinBox,
    +    QStyleCC_CustomBase = LongInt($f0000000),
    +    QStyleCC_SpinBox = 0,
         QStyleCC_ComboBox,
         QStyleCC_ScrollBar,
         QStyleCC_Slider,
    @@ -12525,8 +12527,8 @@
         QStyleCC_TitleBar,
         QStyleCC_Dial,
         QStyleCC_GroupBox,
    -    QStyleCC_MdiControls,
    -    QStyleCC_CustomBase = $f0000000 );
    +    QStyleCC_MdiControls
    +    );
     
     type
       QStyleSubControl = cardinal; // QStyle::SubControl
    @@ -12579,7 +12581,8 @@
     
     type
       QStyleContentsType = (  //QStyle::ContentsType (2)
    -    QStyleCT_PushButton,
    +    QStyleCT_CustomBase = LongInt($f0000000),
    +    QStyleCT_PushButton = 0,
         QStyleCT_CheckBox,
         QStyleCT_RadioButton,
         QStyleCT_ToolButton,
    @@ -12601,11 +12604,12 @@
         QStyleCT_HeaderSection,
         QStyleCT_GroupBox,
         QStyleCT_MdiControls,
    -    QStyleCT_ItemViewItem,
    -    QStyleCT_CustomBase = $f0000000 );
    +    QStyleCT_ItemViewItem
    +    );
     
       QStyleStandardPixmap = (  //QStyle::StandardPixmap (2)
    -    QStyleSP_TitleBarMenuButton,
    +    QStyleSP_CustomBase = LongInt($f0000000),
    +    QStyleSP_TitleBarMenuButton = 0,
         QStyleSP_TitleBarMinButton,
         QStyleSP_TitleBarMaxButton,
         QStyleSP_TitleBarCloseButton,
    @@ -12674,8 +12678,8 @@
         QStyleSP_MediaSeekForward,
         QStyleSP_MediaSeekBackward,
         QStyleSP_MediaVolume,
    -    QStyleSP_MediaVolumeMuted,
    -    QStyleSP_CustomBase = $f0000000 );
    +    QStyleSP_MediaVolumeMuted
    +    );
     
     type
       QStylePrimitiveElement = cardinal; //  QStyle::PrimitiveElement (4)
    
    qt1.diff (4,475 bytes)

Relationships

related to 0036315 resolvedZeljan Rikalo Cannot compile Qt5 widgetset on last FPC trunk 

Activities

Alfred

2019-10-31 12:55

reporter  

cleanqt56.patch (1,296 bytes)
Index: lcl/interfaces/qt5/qt56.pas
===================================================================
--- lcl/interfaces/qt5/qt56.pas	(revision 62146)
+++ lcl/interfaces/qt5/qt56.pas	(working copy)
@@ -12513,7 +12513,7 @@
     QStyleCE_ColumnViewGrip,
     QStyleCE_ItemViewItem,
     QStyleCE_ShapedFrame,
-    QStyleCE_CustomBase = $f0000000 );
+    QStyleCE_CustomBase = $f000000 );
 
   QStyleComplexControl = (  //QStyle::ComplexControl (2)
     QStyleCC_SpinBox,
@@ -12525,7 +12525,7 @@
     QStyleCC_Dial,
     QStyleCC_GroupBox,
     QStyleCC_MdiControls,
-    QStyleCC_CustomBase = $f0000000 );
+    QStyleCC_CustomBase = $f000000 );
 
 type
   QStyleSubControl = cardinal; // QStyle::SubControl
@@ -12601,7 +12601,7 @@
     QStyleCT_GroupBox,
     QStyleCT_MdiControls,
     QStyleCT_ItemViewItem,
-    QStyleCT_CustomBase = $f0000000 );
+    QStyleCT_CustomBase = $f000000 );
 
   QStyleStandardPixmap = (  //QStyle::StandardPixmap (2)
     QStyleSP_TitleBarMenuButton,
@@ -12674,7 +12674,7 @@
     QStyleSP_MediaSeekBackward,
     QStyleSP_MediaVolume,
     QStyleSP_MediaVolumeMuted,
-    QStyleSP_CustomBase = $f0000000 );
+    QStyleSP_CustomBase = $f000000 );
 
 type
   QStylePrimitiveElement = cardinal; //  QStyle::PrimitiveElement (4)
cleanqt56.patch (1,296 bytes)

Martok

2019-10-31 13:32

reporter   ~0118940

Solves, but is a bad fix nonetheless - these values aren't made up, these specific constants are part of the interface.

One's not/no longer supposed to translate C++ enums as pascal enums.

Cyrax

2019-10-31 14:01

reporter   ~0118941

You should change
QStyleSP_CustomBase = $f0000000

to
QStyleSP_CustomBase = longint($f0000000)

in your patch.

Alfred

2019-10-31 15:16

reporter   ~0118942

If I follow your suggestion, I get this:

qt56.pas(12516,46) Note: Values in enumeration types have to be ascending

Would that be a problem ?

Zeljan Rikalo

2019-11-15 14:56

developer   ~0119316

@Alfred, please test with DWORD($f0000000) instead of longint($f0000000) and send feedback here

Sven Barth

2019-11-17 14:11

manager   ~0119364

DWord is wrong, because only signed values are allowed. They need to be reordered as well.

CudaText man

2019-12-15 14:57

reporter   ~0119854

Fix added for qt4/ qt5, tested on CudaText qt5 build.

qt1.diff (4,475 bytes)
Index: lcl/interfaces/qt/qt45.pas
===================================================================
--- lcl/interfaces/qt/qt45.pas	(revision 62400)
+++ lcl/interfaces/qt/qt45.pas	(working copy)
@@ -10648,7 +10648,8 @@
 
 type
   QStyleControlElement = (  //QStyle::ControlElement (2)
-    QStyleCE_PushButton,
+    QStyleCE_CustomBase = LongInt($f0000000),
+    QStyleCE_PushButton = 0,
     QStyleCE_PushButtonBevel,
     QStyleCE_PushButtonLabel,
     QStyleCE_CheckBox,
@@ -10695,11 +10696,12 @@
     QStyleCE_HeaderEmptyArea,
     QStyleCE_ColumnViewGrip,
     QStyleCE_ItemViewItem,
-    QStyleCE_ShapedFrame,
-    QStyleCE_CustomBase = $f0000000 );
+    QStyleCE_ShapedFrame
+    );
 
   QStyleComplexControl = (  //QStyle::ComplexControl (2)
-    QStyleCC_SpinBox,
+    QStyleCC_CustomBase = LongInt($f0000000),
+    QStyleCC_SpinBox = 0,
     QStyleCC_ComboBox,
     QStyleCC_ScrollBar,
     QStyleCC_Slider,
@@ -10708,8 +10710,8 @@
     QStyleCC_Q3ListView,
     QStyleCC_Dial,
     QStyleCC_GroupBox,
-    QStyleCC_MdiControls,
-    QStyleCC_CustomBase = $f0000000 );
+    QStyleCC_MdiControls
+    );
 
 type
   QStyleSubControl = cardinal; // QStyle::SubControl
@@ -10764,7 +10766,8 @@
 
 type
   QStyleContentsType = (  //QStyle::ContentsType (2)
-    QStyleCT_PushButton,
+    QStyleCT_CustomBase = LongInt($f0000000),
+    QStyleCT_PushButton = 0,
     QStyleCT_CheckBox,
     QStyleCT_RadioButton,
     QStyleCT_ToolButton,
@@ -10788,11 +10791,12 @@
     QStyleCT_HeaderSection,
     QStyleCT_GroupBox,
     QStyleCT_MdiControls,
-    QStyleCT_ItemViewItem,
-    QStyleCT_CustomBase = $f0000000 );
+    QStyleCT_ItemViewItem
+    );
 
   QStyleStandardPixmap = (  //QStyle::StandardPixmap (2)
-    QStyleSP_TitleBarMenuButton,
+    QStyleSP_CustomBase = LongInt($f0000000),
+    QStyleSP_TitleBarMenuButton = 0,
     QStyleSP_TitleBarMinButton,
     QStyleSP_TitleBarMaxButton,
     QStyleSP_TitleBarCloseButton,
@@ -10860,8 +10864,8 @@
     QStyleSP_MediaSeekForward,
     QStyleSP_MediaSeekBackward,
     QStyleSP_MediaVolume,
-    QStyleSP_MediaVolumeMuted,
-    QStyleSP_CustomBase = $f0000000 );
+    QStyleSP_MediaVolumeMuted
+    );
 
 type
   QStylePrimitiveElement = cardinal; //  QStyle::PrimitiveElement (4)
Index: lcl/interfaces/qt5/qt56.pas
===================================================================
--- lcl/interfaces/qt5/qt56.pas	(revision 62400)
+++ lcl/interfaces/qt5/qt56.pas	(working copy)
@@ -12467,7 +12467,8 @@
 
 type
   QStyleControlElement = (  //QStyle::ControlElement (2)
-    QStyleCE_PushButton,
+    QStyleCE_CustomBase = LongInt($f0000000),
+    QStyleCE_PushButton = 0,
     QStyleCE_PushButtonBevel,
     QStyleCE_PushButtonLabel,
     QStyleCE_CheckBox,
@@ -12513,11 +12514,12 @@
     QStyleCE_HeaderEmptyArea,
     QStyleCE_ColumnViewGrip,
     QStyleCE_ItemViewItem,
-    QStyleCE_ShapedFrame,
-    QStyleCE_CustomBase = $f0000000 );
+    QStyleCE_ShapedFrame
+    );
 
   QStyleComplexControl = (  //QStyle::ComplexControl (2)
-    QStyleCC_SpinBox,
+    QStyleCC_CustomBase = LongInt($f0000000),
+    QStyleCC_SpinBox = 0,
     QStyleCC_ComboBox,
     QStyleCC_ScrollBar,
     QStyleCC_Slider,
@@ -12525,8 +12527,8 @@
     QStyleCC_TitleBar,
     QStyleCC_Dial,
     QStyleCC_GroupBox,
-    QStyleCC_MdiControls,
-    QStyleCC_CustomBase = $f0000000 );
+    QStyleCC_MdiControls
+    );
 
 type
   QStyleSubControl = cardinal; // QStyle::SubControl
@@ -12579,7 +12581,8 @@
 
 type
   QStyleContentsType = (  //QStyle::ContentsType (2)
-    QStyleCT_PushButton,
+    QStyleCT_CustomBase = LongInt($f0000000),
+    QStyleCT_PushButton = 0,
     QStyleCT_CheckBox,
     QStyleCT_RadioButton,
     QStyleCT_ToolButton,
@@ -12601,11 +12604,12 @@
     QStyleCT_HeaderSection,
     QStyleCT_GroupBox,
     QStyleCT_MdiControls,
-    QStyleCT_ItemViewItem,
-    QStyleCT_CustomBase = $f0000000 );
+    QStyleCT_ItemViewItem
+    );
 
   QStyleStandardPixmap = (  //QStyle::StandardPixmap (2)
-    QStyleSP_TitleBarMenuButton,
+    QStyleSP_CustomBase = LongInt($f0000000),
+    QStyleSP_TitleBarMenuButton = 0,
     QStyleSP_TitleBarMinButton,
     QStyleSP_TitleBarMaxButton,
     QStyleSP_TitleBarCloseButton,
@@ -12674,8 +12678,8 @@
     QStyleSP_MediaSeekForward,
     QStyleSP_MediaSeekBackward,
     QStyleSP_MediaVolume,
-    QStyleSP_MediaVolumeMuted,
-    QStyleSP_CustomBase = $f0000000 );
+    QStyleSP_MediaVolumeMuted
+    );
 
 type
   QStylePrimitiveElement = cardinal; //  QStyle::PrimitiveElement (4)
qt1.diff (4,475 bytes)

Alfred

2019-12-27 09:01

reporter   ~0120081

The last patch provided by CudaText man works very well for me !

Zeljan Rikalo

2019-12-29 11:46

developer   ~0120125

Please test and close if ok.

Issue History

Date Modified Username Field Change
2019-10-31 12:55 Alfred New Issue
2019-10-31 12:55 Alfred File Added: cleanqt56.patch
2019-10-31 13:32 Martok Note Added: 0118940
2019-10-31 14:01 Cyrax Note Added: 0118941
2019-10-31 15:16 Alfred Note Added: 0118942
2019-11-03 09:24 Zeljan Rikalo Assigned To => Zeljan Rikalo
2019-11-03 09:24 Zeljan Rikalo Status new => assigned
2019-11-15 14:53 Zeljan Rikalo Relationship added related to 0036315
2019-11-15 14:56 Zeljan Rikalo Status assigned => feedback
2019-11-15 14:56 Zeljan Rikalo LazTarget => -
2019-11-15 14:56 Zeljan Rikalo Note Added: 0119316
2019-11-17 14:11 Sven Barth Note Added: 0119364
2019-12-15 14:57 CudaText man File Added: qt1.diff
2019-12-15 14:57 CudaText man Note Added: 0119854
2019-12-27 09:01 Alfred Note Added: 0120081
2019-12-27 09:01 Alfred Status feedback => assigned
2019-12-29 11:46 Zeljan Rikalo Status assigned => resolved
2019-12-29 11:46 Zeljan Rikalo Resolution open => fixed
2019-12-29 11:46 Zeljan Rikalo Fixed in Revision => 62453
2019-12-29 11:46 Zeljan Rikalo Widgetset QT5 => QT, QT5
2019-12-29 11:46 Zeljan Rikalo Note Added: 0120125