PDA

View Full Version : Icon in QToolBox



giusepped
25th September 2009, 10:40
I tried simply


toolBox->setItemIcon(0,QIcon(":/images/test.png"));

but nothing appear in the tab of the QToolBox.
I have correctly update the resource file and save the image in images folder
Something missing?

yogeshgokul
25th September 2009, 10:48
Your code is fine, means it will set the icon for sure. But the problem is its not finding the image file. There is some problem with your resource. You can prove it by giving absolute path of the image in QIcon for try only.

giusepped
25th September 2009, 11:12
The file is there, and the same syntax I used also for other icons.
I discovered that if I add the item with


toolBox->addItem(widhte,icon,text);

all works.

:confused: