Results 1 to 6 of 6

Thread: Vertical spliiter and collpasing buttons

  1. #1
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Vertical spliiter and collpasing buttons

    Hi,

    I have a QTreeWidget layed out in a vertical splitter with 4 pushbuttons.
    The behavior that I want is that when the splitter is grabbed and pulled
    down, one button disappears at a time. Pulling the splitter up brings the
    buttons up again. This could either be smooth scrolling or one button
    at a time.

    I've layed this out in QT Designer and setting the childrenCollapsible
    parameter will either not allow any of the buttons to be collapsed, or
    they all appear/disappear.

    How can I get these guys to operate as I've shown in the attached pics,
    one button at a time?

    Thanks!

    Mark
    Attached Images Attached Images

  2. #2
    Join Date
    Aug 2006
    Posts
    26
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Vertical spliiter and collpasing buttons

    Just a thought, maybe you can connect to the splitterMoved signal and based on the direction the splitter is moving, you can show or hide the buttons.

    I think you can determine the direction of the splitter by looking at pos and index from the signal.
    "And no one said 'don't use QPrinter to bake muffins'."

  3. #3
    Join Date
    Oct 2006
    Posts
    279
    Thanks
    6
    Thanked 40 Times in 39 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Vertical spliiter and collpasing buttons

    You want the behaviour of the "Outlook navigation bar". This issue has been discussed before. Check out Wysota's wwWidgets, or search the forum for "outlook bar".

  4. #4
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Vertical spliiter and collpasing buttons

    I like the idea of using the splitterMoved signal. That seems like it has potential.
    The question is how do I map the position provided by the signal to something that
    allows me to determine that the splitter now sits at the top of one of the buttons?

    I need some way to relate this splitterMoved position to the position of the buttons within
    the splitter.

  5. #5
    Join Date
    Aug 2006
    Posts
    26
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Vertical spliiter and collpasing buttons

    There are two ways I can think of off the top of my head.

    You can restrict the height of a button and when the index/pos diff equals the size of a button, then you show the next button in queue.

    You can set a minimum height for a button and when the index/pos diff equals the minimum size of a button, you show the next button in queue.

    Just a thought.
    "And no one said 'don't use QPrinter to bake muffins'."

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Vertical spliiter and collpasing buttons

    Quote Originally Posted by spud View Post
    Check out Wysota's wwWidgets, or search the forum for "outlook bar".
    Unfortunately currently my bar doesn't support fluent hiding and showing of buttons. But the rest of the functionality is there. Maybe apart that progress bar on the bottom, but it is easy to add it.
    Last edited by wysota; 17th January 2008 at 23:45.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.