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. How to prevent QWidget resize if hidden, and process the same resize events after the widget is shown?
Qt 6.11 is out! See what's new in the release blog

How to prevent QWidget resize if hidden, and process the same resize events after the widget is shown?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.3k 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.
  • S Offline
    S Offline
    soma_yarram
    wrote on last edited by
    #1

    Hi,

    I want to prevent/disable all resize events of a QWidget when hidden (not visible), and process the same resize events after the widget is visible/shown again.

    Please help me to this.
    Thanks in advance.

    jsulmJ 1 Reply Last reply
    0
    • S soma_yarram

      Hi,

      I want to prevent/disable all resize events of a QWidget when hidden (not visible), and process the same resize events after the widget is visible/shown again.

      Please help me to this.
      Thanks in advance.

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

      @soma_yarram Override https://doc.qt.io/qt-5/qwidget.html#resizeEvent and ignore the events as long as https://doc.qt.io/qt-5/qwidget.html#isHidden returns true. You can also store the events for later processing.

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

      1 Reply Last reply
      2
      • S Offline
        S Offline
        soma_yarram
        wrote on last edited by
        #3

        @jsulm : Is there any general approach to do this? I mean: is there any Qt flag to achieve this? For example: Qt::WA_PendingResizeEvent. Problem is that I have only couple of widgets which cause crash because resize event is triggered before show.

        jsulmJ 1 Reply Last reply
        0
        • S soma_yarram

          @jsulm : Is there any general approach to do this? I mean: is there any Qt flag to achieve this? For example: Qt::WA_PendingResizeEvent. Problem is that I have only couple of widgets which cause crash because resize event is triggered before show.

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

          @soma_yarram I doubt there is something like this in Qt as your requirement is quite special.

          If you have crashes you should rather find and fix the reason instead of implementing workarounds.

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

          1 Reply Last reply
          2

          • Login

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