[Solved] Qt5.2 Multi-Screen Support for QWidget on Macs coordinate problem

  • We're currently porting an application from Qt4.8 to 5.2 and ran into a major problem with Mac multi screen support. We use transparent overlay windows (QWidget based) that can be moved around by the user. With Qt4.8 moving from one screen to another was no problem. Qt5.2 however does not translate the change in coordinate system between the screens correctly and the window "suddenly" jumps up or down when moving to the other screen.

    On a Mac screens can be "adjusted" in relation to each other. Putting a larger and a smaller display next to each other you can tell to OS that the smaller displays top is somewhere in the middle of the larger display. When a window is now dragged from the larger to the smaller display it shows up at the same y-position on both screen, although in reality they are different. This is managed in Qt with QScreen and recognized correctly.

    However when positioning a QWidget with move or setGeometry this information is ignored in Qt5.2 - so the Window drops much further when moving from one screen to another. In Qt4.8 this was compensated by the Qt library.

    This wouldn't be so bad it there was any chance to find out which screen a QWidget is on and get a signal on screen change to compensate manually - however I did not find anything that could provide this information.

    Is there a possibility to get informed (SIGNAL) when a QWidget switches to a new screen? Is this change in behavior between Qt4.8 intended or a bug? Or does any of you see a different approach to move a transparent window around between screen?

  • Lifetime Qt Champion


    It sounds like it could be a regression. Did you look at the "bug report system":http://bugreports.qt-project.org to see if it's something known ? If not, you should open a new report providing a minimal compilable sample program that shows the behavior

  • Samuel, thanks for the hint! Checked with the current GIT repository. This is a regression that will be fixed with the 5.2.1 build. Thanks!!!

  • Lifetime Qt Champion

    You're welcome !

    Can you post the link to the related bug ?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.