PDA

View Full Version : Which widget?



Misenko
12th July 2008, 10:00
Hi,

I want to build something like QToolWidget but I want to expand more than one pages. And also make it nicer. I mean something else for expanding than big buttons which are in QToolBox. Something like this: http://img295.imageshack.us/img295/6115/panelsl5.jpg http://img301.imageshack.us/img301/3333/panel2st2.jpg

Which widget may I use?

caduel
12th July 2008, 10:20
several.
Combine several using QLayouts (or rather subclasses like QVBoxLayout)

Misenko
12th July 2008, 21:03
Hmm. But how can I make similar function like these one on the pictures? Which widgets may I combine?

caduel
13th July 2008, 12:42
I am not familiar with the program your dialog is from.
But the thigs look like:

* QToolBox (perhaps)
* each containing
QCheckBoxes
QSpinBoxes
QRadioButtons
QGroupBoxes
QPushButtons
QLabels

Take a look at the Qt widget gallery.
(http://doc.trolltech.com/4.4/gallery-plastique.html)

Misenko
13th July 2008, 15:34
Ehm, you didnt understand me. I dont want to make exactly what is in the picture. I want to create the system of tabbing the widgets. Something like is QToolBox but I want to expand more than one pages. I want only the expanding system like is on the pictures not the widgets which are exactly there.

fullmetalcoder
13th July 2008, 18:20
If I remember well the widget box of Qt designer is a tree view (or tree widget which does not make much difference as far as the look and feel is concerned). If you're interested in achieving the same llok for top level items have a look at the source code I'm sure it's not that complicated. Then, use setItemWidget() to display complex widgets instead of simple model items.

Misenko
13th July 2008, 20:50
Thank you. I have seen the designer source but you are right it is a tree view. But I want to cover every page by some other widgets like on the second picture. How can I do that?

fullmetalcoder
13th July 2008, 21:33
QAbstractItemView::setIndexWidget() or QTreeWidget::setItemWidget should do, depending on which approach (model/view or item) you prefer, the later being the most sensible if you want every items to be replaced by widgets.