How to add icon without a text into QListWidget?
-
@elveatles
Hi,
Yes I do using style-sheets, and I am not familiar with a way that style-sheets can resolve this issue.
Icon mode set the text beneath the icon while list-mode set the text beside the icon.
In both cases I have the same problem.
I am using QtCreator, creating ListWidget and add items, my code is very basic.
I can provide code from the ui_mainwindow.h if you point me to something specific.Thanks,
IL -
@elveatles
Hi and thanks,
I have removed the style-sheet and create the item with icon only but it still save place for the text.
I am a bit confused, I don't find any solution for that, something that looks trivial seems to be an issue.
I will be very happy to know that someone has a solution for that.Thanks again,
IL -
@IL
you can add a widget to an item. So just create a for example frame that contains your icon and add it to the list item.QListWidget *list = new QListWidget(this); //... QFrame *custom = new QFrame; //add whatever you need to the frame QListWidgetItem *i = new QListWidgetItem; list->addItem(i); list->setWidgetItem(i,custom);
I used this for a list where each item needed several buttons to get for example detailed information about the item or delete the item from the list with one click