Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED] onWidthChanged triggered few times
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] onWidthChanged triggered few times

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 1.1k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    literA2
    wrote on last edited by literA2
    #1

    Hi,

    I have a GridLayout and the onWidthChanged of the children triggered few times. Is there a way to determine if the trigger is the last call or if the layout is final?

    I encountered this issue when changing orientation from Landscape to portrait.

    Please advise. Thanks.

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

      Hi,

      Why do you need that information for ?

      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
      0
      • L Offline
        L Offline
        literA2
        wrote on last edited by literA2
        #3

        @SGaist because inside the children of the GridLayout is a one line text that needs to be scrolled if its width is greater than its container width. I set a function to check its width however it will only be called on the first trigger of onWidthChanged, by then the width isn't final or fully laid out yet. Any advise on this one? Thanks

        EDIT**
        Please consider this thread solved. I managed to resolved the issue by creating an Item holder of the text and call the function to check the width on the holder's onwidthchanged signal.

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

          Good !

          Since you have it working now, please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)

          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
          0

          • Login

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