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. Need more Info on QSplitter & how it is replacing QLayouts.

Need more Info on QSplitter & how it is replacing QLayouts.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.1k 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

    I've seen that QSplitter can be an alternate for QLayouts but i din't find more information on how splitter deals with laying out widgets.
    I'm aware of it's advantages like being able to resize child widgets inside a splitter but i want to know more details about how it replaces layouts like,

    • Does it respect sizepolicies & sizehints as layouts
    • Does it have a default sizepolicy as a layout (in which case it won't respect child widget sizepolicies i think)

    Also, i'm interested in knowing how splitter handles child widgets which already have layouts. Does it recieve QEvent::LayoutRequest & passes it on to child widgets.?

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

      Hi and welcome to devnet,

      QSplitter doesn't replace a layout. You just have widgets side by side or on top of each other but thats all.

      What is your use case ?

      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
      1
      • Q Offline
        Q Offline
        qtProgrammer
        wrote on last edited by
        #3

        Thanks for responding @SGaist ,

        Can you elaborate on what you meant by "QSplitter doesn't replace a layout. You just have widgets side by side or on top of each other but thats all".
        I know that when i use a splitter inside a widget, i can use it as a layout. Do you mean i still need a layout (even though i have a splitter).?

        My use case is that i have some widgets with layouts installed on them. But i want to include splitters on top of that widget so that i can add more widgets to a single splitter & also have nested splitters inside a splitter.

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

          Layouts are used to setup how the elements of your complex widgets are positioned.

          A splitter is a "container", it won't do any special handling of what can be found inside the widgets you put in it.

          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