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 should i use a custom layout..?
QtWS25 Last Chance

When should i use a custom layout..?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 491 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello,
    I want make use of splitters in my application by giving user the ability to resize any widget inside the splitters. Then i found this blog,
    http://kdemonkey.blogspot.ca/2013/11/understanding-qwidget-layout-flow.html
    Where the author explained how the layout flow works & he also suggested to use a custom layout instead of handling QEvent::layoutRequest(),

    The layout management documentation suggests that handling LayoutRequest events in QWidget::event() is an alternative to implementing a custom layout. A potential problem with this is that LayoutRequest events are delivered asynchronously on the next pass through the event loop. If your widget is likely to update its own geometry in response to the LayoutRequest event then this can trigger layout flicker where several passes through the event loop occur before the layout process is fully finished. Each of the intermediate stages will flicker on screen briefly, as the event loop may process a paint event on each pass as well as the layout update, which looks poor. So if you need a custom layout, subclassing QLayout/QLayoutItem is the recommended approach unless you're sure that your widget will always be used as a top-level widget

    As we know, Splitter is a container widget & it handles layout itself as it doesn't have a seperate layout. I've a prototype where i noticed that each sub splitter is getting several QEvent::layoutRequest events when it's layout is redone which is what is mentioned in the blog.

    So how do i write a custom layout to make my application performant.?
    My idea is to have a custom container widget on which i will install my custom layout. Now all my spliiters will be added to this layout but i don't know how efficient this prototype would be.

    Any ideas/inputs are greatly appreciated.
    Have you ever wrote a custom layout.? If so what was your purpose.?
    How can i handle QEvent::layoutRequest efficiently for QSplitter.?

    Thanks in advance,

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

      I'm looking for something similar,
      any inputs guys.?

      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