PDA

View Full Version : Not QToolBox - how to build then.



migel
1st August 2012, 12:53
http://radekp.github.com/qtmoko/api/images/designer-choosing-form.png

As image shows I need to build such a toolbox with ability to open all sections. I don't think its possible with QToolBox, so what is the best to build it ? Why there is not such a widget ?

Thanks.

sonulohani
1st August 2012, 13:39
Use QTreeWidget,QPushButton. It is very easy to create it in Qt. You have to look at the documentation.

migel
1st August 2012, 14:56
I don't see my buttons under items. What I do wrong ?


setColumnCount(1);
setRootIsDecorated(false);
setHeaderHidden(true);

QPushButton *oneButton = new QPushButton(tr("1"));
oneButton->setAutoFillBackground(true);

QPushButton *twoButton = new QPushButton(tr("2"));

QTreeWidgetItem *item1 = new QTreeWidgetItem;
setItemWidget(item1, 1, oneButton );

QTreeWidgetItem *item2 = new QTreeWidgetItem;
setItemWidget(item2, 1, twoButton );

QList<QTreeWidgetItem *> items;
items << item1;
items << item2;

insertTopLevelItems(1, items);