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. When is QEvent::LayoutRequest generated

When is QEvent::LayoutRequest generated

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 3.5k 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
    qtProgrammer
    wrote on last edited by
    #1

    Hello All, I'm new to this forum.

    I know that QEvent::LayoutRequest is used to recalculate the layout upon a new child addition/removal. But i just want to know if there are any other cases that might call this.

    Thanks in advance,

    raven-worxR 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Other case: change of widget visibility.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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

        Thanks for the reply @SGaist ,

        I know this case & I forgot to mention this in my question.
        I'm wondering if this is generated in any other cases.

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qtProgrammer
          wrote on last edited by
          #4

          Like when a widget gets a paint event, does it also get this?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Not necessarily, you can have a widget with custom painting an not any layout set on it.

            You can check Qt's sources for all the use of that event.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • Q qtProgrammer

              Hello All, I'm new to this forum.

              I know that QEvent::LayoutRequest is used to recalculate the layout upon a new child addition/removal. But i just want to know if there are any other cases that might call this.

              Thanks in advance,

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @qtProgrammer
              QEvent::LayoutRequest is triggered whenever the layout has to be redone. There are many many places where such event is generated.
              Basically it should be triggered whenever a child has been added to or removed from the layout. Or ones of the widgets layout properties has changed (margins, paddings, border, spacing, sizeHint etc.) (see QWidget::updateGeometry())

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              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