PDA

View Full Version : How should I implement hide-able UI elements ?



barnabyr
30th April 2006, 03:29
Hello

I have a user interface for a database search that contains various
combo boxes, line edit and check box widgets.

In this example, these widgets can be used to help users refine a search.
However these widgets are not necessary and ideally I would like
to hide them under an 'Advanced' section as my UI is looking a little
cluttered.

I like Apple's folder UI (which also appears in the program Picassa etc.)
where you have a little triangle on the left which you
can click to reveal the hidden UI contents .. another click will hide them
again.

What would it take to build this ?

I don't believe there is a QT widget to do all the work so what should I use ?
The only thing that is close is a tree widget as you have the little plus signs
to reveal children but I don't believe it would be customizable enough. (?)

A really nice bonus would be to have the contents animate down like hidden
comments do on digg.com.

Any ideas among you great programmers out there ?

Thanks

barnaby.

munna
30th April 2006, 06:25
If you look into the book c++ GUI Programming with Qt 3 there is an example in chapter 2 which talks about shape changing dialog. I think that example might be useful to you. The only difference between that example and your requirement is that you want the expansion to happen horizontally whereas in the example, the widget extends vertically.

barnabyr
30th April 2006, 09:09
thank you for the link ... I read the chapter ..
and it seems the simple case is embarassingly simple !

you just connect a button or some animating label widget to
the widget-you-want-to-appear's show() or setVisible() slot !

I wonder if there is an equally simple way to do the animated reveal
of the extra UI where it crawls down or across ?