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. QSplitter disappears once child widget is hidden.
Forum Updated to NodeBB v4.3 + New Features

QSplitter disappears once child widget is hidden.

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

    I have a QSplitter that sepparates two child widgets (lets say "A" and "B").
    When I call "B->hide();" - my QSplitter disappears.

    Is there any way to make QSplitter (and it's QSplitterHandle) still visible while one of child widgets is hidden?

    Thanks.

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

      Hi,

      You can use QSplitter::setSizes for that

      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
      • G Offline
        G Offline
        GGodis
        wrote on last edited by
        #3

        Thanks SGaist,
        yes, this solution works, it's just that childs still think they are visible
        (i.e. "B->isVisible();" allways returns with "true")

        @QList<int> sizes;
        sizes.append(300); // Child A
        sizes.append(0); // Child B (hide it)

        mUI.splitter->setSizes(sizes);@

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

          You're welcome !

          Indeed, collapsed doesn't necessarily mean invisible however you should be able to deduct this from the widget size

          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