ListWidgetItem and Icon
-
I have a list widget to which i add listWidgetItems to it.The list widget item has text on the left and an icon on the right.When there is no icon the text has some spacing between the margin of list widget but when i add icon to it this spacing is gone.I set the text alignment as Qt::AlignLeft | Qt::AlignVCenter | Qt::AlignAbsolute .
Any suggestions? -
Hi DivyaPrakash.
Welcome on Qt Dev forumFirst of all you should clear your question ..What you want to achieve?
Second thing is as you mentioned that text on left and icon on right is wrong it happens to be in reverse order(by default).
if you want spacing b/w icon and text then you can add some space character(s)
before text.Hope this would help.
[Edit by IamSumit ] -
@IamSummit ...I want a consistent behavior meaning even when there is a icon, still there should be some spacing between the list widget and list widget item.
http://postimg.org/image/rffa27j1z/See the screen shot the text starting with B does not have a icon to it.
But the text starting with A has a icon to it,but for some reason after adding the icon the text gets shifted towards left.I made it reverse intentionally.
-
@IamSummit ...I want a consistent behavior meaning even when there is a icon, still there should be some spacing between the list widget and list widget item.
I made it reverse intentionally.Also this strange behavior is also present on Mac