Important: Please read the Qt Code of Conduct -

Window dragging between two monitors with a different resolutions.

  • Here is the link to simple project:
    The main window with a system title bar which is contains the green label (in menu bar) which is allow drag the main window.
    The code for that implemented in QExtBodyMoveWidget.h file

    The problem is following:
    The exist a difference between how you dragging this window between two monitors (I tested in under Windows) using green label or system title bar.
    In first case:
    If you drag this window using green label, the window switch early to another resolution, and jump far from from the mouse cursor.
    In second case:
    But if you drag it using system title bar, the window switch to another resolution in time and do not shifted related to mouse cursor.

    Is it possible to "emulate" the same behavior for the first case?
    I suppose that I need to using some Win API for the window settings?

  • Lifetime Qt Champion


    An educated guess is that the second case is handled by the window manager (the decoration is not done by Qt).

    One possible thing to do would be to check the screen resolution in your method and try to adapt to that.