View Issue Details

IDProjectCategoryView StatusLast Update
0034880LazarusWidgetsetpublic2019-01-31 08:27
ReporterCyril LAMYAssigned ToZeljan Rikalo 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformx64OSMacOS XOS VersionHigh Sierra
Product Version2.1 (SVN)Product Build 
Target VersionFixed in Version 
Summary0034880: With QT5, Widgets are at wrong positions the second time the form is shown
DescriptionOpen a form from a menu with showmodal. The widget are at their places. Close the form and open it a second time. Widget are now at wrong positions. (See screen captures)
TagsNo tags attached.
Fixed in Revision60232,60249
LazTarget-
WidgetsetQT5
Attached Files
  • First Showmodal.png (24,489 bytes)
    First Showmodal.png (24,489 bytes)
  • second showmodal.png (22,690 bytes)
    second showmodal.png (22,690 bytes)
  • Bug Widgetpositions.zip (134,537 bytes)
  • issue34880_2.diff (546 bytes)
    Index: lcl/interfaces/qt5/qtwidgets.pas
    ===================================================================
    --- lcl/interfaces/qt5/qtwidgets.pas	(revision 60248)
    +++ lcl/interfaces/qt5/qtwidgets.pas	(working copy)
    @@ -9705,6 +9705,9 @@
         CachedSelectionLen := -1;
       end;
     
    +  if (ChildOfComplexWidget = ccwComboBox) and (QEvent_type(Event) = QEventMove) then
    +    exit;
    +
       if (ChildOfComplexWidget = ccwComboBox) and
         ((QEvent_type(Event) = QEventPaint) or (QEvent_type(Event) = QEventResize))
         and (LCLObject.HandleAllocated) then
    
    issue34880_2.diff (546 bytes)

Relationships

related to 0034698 closedZeljan Rikalo Wrong Form position if set to poMainFormCenter 

Activities

Cyril LAMY

2019-01-16 09:42

reporter  

First Showmodal.png (24,489 bytes)
First Showmodal.png (24,489 bytes)

Cyril LAMY

2019-01-16 09:42

reporter  

second showmodal.png (22,690 bytes)
second showmodal.png (22,690 bytes)

Cyril LAMY

2019-01-16 09:47

reporter   ~0113436

It seems that not all widgets are affected by this issue but at least stringgrid, drawgrid, valuelisteditor were tested and affected.

Cyril LAMY

2019-01-16 09:49

reporter  

Bug Widgetpositions.zip (134,537 bytes)

Alfred

2019-01-17 11:20

reporter   ~0113448

I can confirm this behavior.
This also affect the startup position of the form.
Anything else than poDesigned gives errors.
In my code (FormCreate) I have to use:

{$if defined(LCLQT) OR defined(LCLQT5)}
Self.Position:=poDesigned;
{$endif}

Cyril LAMY

2019-01-18 09:31

reporter   ~0113459

I reported few weeks ago a problem with the startup position of a form using QT5 (issue 0034698). Maybe there is a link between this issue and what you wrote ?

Zeljan Rikalo

2019-01-27 13:53

developer   ~0113663

Problem is reproducable only on macos, linux and win32 works fine (qt5lcl)

Zeljan Rikalo

2019-01-27 14:24

developer   ~0113666

Please test and close if ok.

Alfred

2019-01-28 13:07

reporter   ~0113694

For me, its working perfect now !
Thanks.

Cyril LAMY

2019-01-28 15:28

reporter   ~0113695

It's ok for me too !
Thanks

Cyril LAMY

2019-01-28 15:29

reporter   ~0113696

Resolved

Cyril LAMY

2019-01-30 16:42

reporter   ~0113733

Reopen :
the same behavior still continue with the Tcombobox widget

Zeljan Rikalo

2019-01-30 18:56

developer   ~0113739

Please attach example, but before that please test with r60248

Zeljan Rikalo

2019-01-30 19:02

developer  

issue34880_2.diff (546 bytes)
Index: lcl/interfaces/qt5/qtwidgets.pas
===================================================================
--- lcl/interfaces/qt5/qtwidgets.pas	(revision 60248)
+++ lcl/interfaces/qt5/qtwidgets.pas	(working copy)
@@ -9705,6 +9705,9 @@
     CachedSelectionLen := -1;
   end;
 
+  if (ChildOfComplexWidget = ccwComboBox) and (QEvent_type(Event) = QEventMove) then
+    exit;
+
   if (ChildOfComplexWidget = ccwComboBox) and
     ((QEvent_type(Event) = QEventPaint) or (QEvent_type(Event) = QEventResize))
     and (LCLObject.HandleAllocated) then
issue34880_2.diff (546 bytes)

Zeljan Rikalo

2019-01-30 19:02

developer   ~0113740

Also, you can test with attached patch for qt5 and give some feedback.

Zeljan Rikalo

2019-01-30 19:27

developer   ~0113741

Please test and close if ok. I've just tested on Mac and it's ok now

Cyril LAMY

2019-01-31 08:27

reporter   ~0113752

It's Ok now
Thank you

Issue History

Date Modified Username Field Change
2019-01-16 09:42 Cyril LAMY New Issue
2019-01-16 09:42 Cyril LAMY File Added: First Showmodal.png
2019-01-16 09:42 Cyril LAMY File Added: second showmodal.png
2019-01-16 09:47 Cyril LAMY Note Added: 0113436
2019-01-16 09:49 Cyril LAMY File Added: Bug Widgetpositions.zip
2019-01-16 22:18 Zeljan Rikalo Assigned To => Zeljan Rikalo
2019-01-16 22:18 Zeljan Rikalo Status new => assigned
2019-01-17 11:20 Alfred Note Added: 0113448
2019-01-18 09:31 Cyril LAMY Note Added: 0113459
2019-01-18 16:52 Zeljan Rikalo Relationship added related to 0034698
2019-01-27 13:53 Zeljan Rikalo LazTarget => -
2019-01-27 13:53 Zeljan Rikalo Note Added: 0113663
2019-01-27 13:53 Zeljan Rikalo Status assigned => confirmed
2019-01-27 14:24 Zeljan Rikalo Fixed in Revision => 60232
2019-01-27 14:24 Zeljan Rikalo Note Added: 0113666
2019-01-27 14:24 Zeljan Rikalo Status confirmed => resolved
2019-01-27 14:24 Zeljan Rikalo Resolution open => fixed
2019-01-28 13:07 Alfred Note Added: 0113694
2019-01-28 15:28 Cyril LAMY Note Added: 0113695
2019-01-28 15:29 Cyril LAMY Note Added: 0113696
2019-01-28 15:29 Cyril LAMY Status resolved => closed
2019-01-30 16:42 Cyril LAMY Note Added: 0113733
2019-01-30 16:42 Cyril LAMY Status closed => assigned
2019-01-30 16:42 Cyril LAMY Resolution fixed => reopened
2019-01-30 18:56 Zeljan Rikalo Note Added: 0113739
2019-01-30 18:56 Zeljan Rikalo Status assigned => feedback
2019-01-30 19:02 Zeljan Rikalo File Added: issue34880_2.diff
2019-01-30 19:02 Zeljan Rikalo Note Added: 0113740
2019-01-30 19:27 Zeljan Rikalo Fixed in Revision 60232 => 60232,60249
2019-01-30 19:27 Zeljan Rikalo Note Added: 0113741
2019-01-30 19:27 Zeljan Rikalo Status feedback => resolved
2019-01-30 19:27 Zeljan Rikalo Resolution reopened => fixed
2019-01-31 08:27 Cyril LAMY Note Added: 0113752
2019-01-31 08:27 Cyril LAMY Status resolved => closed