Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved How to keep physical window size constant when working with multiple monitors?

    General and Desktop
    2
    6
    539
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      Qt_User72653 last edited by

      I have a frameless window with a custom drop shadow applied to it, with a fixed sized widget in the window. The issue I'm having is that if I move the window between monitors with different DPIs the window resizes, which results in the drop shadow being drawn in the top left corner of the window, while the widget is drawn on the bottom right. The effect is that the drop shadow is 'split' from the widget when the window is resized.

      Is there any way to prevent a window from being resized in this case? I tried setting the size policy of it but that didn't work.

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        Do you intercept resizeEvent and recalculate the drop shadow ?
        also
        if you do this->setFixedSize(500,500);
        and qDebug () << this->width() << " - " << this->height();
        once moved. What does it say ?
        ( "this" is most likely mainwindow)

        Q 1 Reply Last reply Reply Quote 1
        • Q
          Qt_User72653 @mrjj last edited by Qt_User72653

          @mrjj said in How to keep physical window size constant when working with multiple monitors?:

          Do you intercept resizeEvent and recalculate the drop shadow ?

          No, I was hoping to just be able to 'cancel' the window resize.

          It looks like my mistake was in thinking that I wouldn't have to manually resize the drop shadow and the window.

          1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion last edited by

            what values did u get from the test ?

            Q 1 Reply Last reply Reply Quote 0
            • Q
              Qt_User72653 @mrjj last edited by

              @mrjj

              500 and 500. It wasn't a Qt problem, just my understanding of how to fix the issue.

              1 Reply Last reply Reply Quote 1
              • mrjj
                mrjj Lifetime Qt Champion last edited by

                Hi
                Ok super. just wanted to be sure. i assumed the mere movement would call for
                a recalc since its other monitor.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post