Recent

Author Topic: [Solved] Custom Control causes QTransform error  (Read 1676 times)

alanphys

  • Jr. Member
  • **
  • Posts: 56
Re: Custom Control causes QTransform error
« Reply #15 on: June 01, 2022, 09:45:56 am »
Hi Zeljko

I've found the commits that caused the problem. To answer my question above
Code: Bash  [Select][+][-]
  1. git tag -l
will list the release (and other) tags.

In:
commit 9786f792401ef583ef50f21b115c5d9e9b5cb35e
Author: zeljko
Date:   Wed Apr 8 08:22:39 2020 +0000

    Qt5: implemeted TQtWidget.grabWindow(), added check if FContext is 0 in Paint event.
   
    git-svn-id: trunk@62911 -

You created TWidget.grabWindow and in
commit a64938e07ca532c9650906ad1897488c8f34186e
Author: zeljko
Date:   Wed Apr 8 13:20:36 2020 +0000

    Qt5: simplified RawImage_fromDevice()
   
    git-svn-id: trunk@62915 -

you used it. Reverting these two commits solves the problem of the controls crashing on the second monitor.

In qtlclintf.inc prior to these two commits you have the comment in line 785 in function TQtWidgetSet.RawImage_FromDevice
     // if you have dual monitors then getDeviceSize return
      // more width than screen width, but grabWindow will only grab one
      // screen, so its width will be less
      // Solution: we can either pass prefered size to grabWindow or
      // correct Description size after. I see the first solution as more correct.

I suspect that TQtWidget.grabWindow() is getting an inconsistent screen size on some dual monitor systems. I'm confident now that there is not a bug in my control and that this is a QT5 issue so I will file an issue, but I am now so far beyond my pay grade that I'm afraid this is the point where I bail.

Regards
Alan
Alanphys
Fedora 34 + KDE/QT5, Tinycore 8, Windows XP-10
https://github.com/alanphys

zeljko

  • Hero Member
  • *****
  • Posts: 1279
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Custom Control causes QTransform error
« Reply #16 on: June 01, 2022, 09:50:18 am »
Thanks for investigation, please open an issue about it, I'll see what can be done to fix it.

zeljko

  • Hero Member
  • *****
  • Posts: 1279
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Custom Control causes QTransform error
« Reply #17 on: June 01, 2022, 10:03:47 am »
Note for me: Maybe X and Y coords in TQtWidget.grabWindow should be offsetted by screen X,Y if screen is not primary one.

alanphys

  • Jr. Member
  • **
  • Posts: 56
Alanphys
Fedora 34 + KDE/QT5, Tinycore 8, Windows XP-10
https://github.com/alanphys

 

TinyPortal © 2005-2018