Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Modifying QResizeEvent

Modifying QResizeEvent

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 628 Views
  • 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 Offline
    Q Offline
    Qt_User72653
    wrote on last edited by
    #1

    Is it possible to modify a resize event so that whenever a widget is resized I can add/remove a fixed amount from it?

    jsulmJ 1 Reply Last reply
    0
    • Q Qt_User72653

      Is it possible to modify a resize event so that whenever a widget is resized I can add/remove a fixed amount from it?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @Qt_User72653 Subclass the widget class you need and override https://doc.qt.io/qt-5/qwidget.html#resizeEvent
      But I'm not sure what will happen if you change the size inside this event filter.
      Can you explain why you need this?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • Q Offline
        Q Offline
        Qt_User72653
        wrote on last edited by
        #3

        I can't modify the event itself because it's read only, and calling resize() in the resizeEvent() results in infinite recursion.

        I wanted to be able to resize a frameless window, and have that window automatically add the height of the title bar when the window's body is resized. I just ended up overwriting the resize() function to add it.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved