PDA

View Full Version : Vertical spliiter and collpasing buttons



MrGarbage
16th January 2008, 21:07
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

croland
17th January 2008, 03:36
Just a thought, maybe you can connect to the splitterMoved (http://doc.trolltech.com/latest/qsplitter.html#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.

spud
17th January 2008, 12:16
You want the behaviour of the "Outlook navigation bar". This issue has been discussed before. Check out Wysota's wwWidgets (http://www.qtcentre.org/forum/f-qt-software-16/t-wwwidgets-6675.html/?highlight=QwwNavigationBar), or search the forum for "outlook bar".

MrGarbage
17th January 2008, 14:20
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.

croland
17th January 2008, 21:56
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.

wysota
17th January 2008, 23:40
Check out Wysota's wwWidgets (http://www.qtcentre.org/forum/f-qt-software-16/t-wwwidgets-6675.html/?highlight=QwwNavigationBar), 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.