[Qt-interest] How to get the icon by default right side of listview
Ramesh
ramesh.bs at robosoftin.com
Tue Mar 16 08:29:22 CET 2010
Yup.. ill try
Thank u
-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Andre Somers
Sent: Tuesday, March 16, 2010 12:52 PM
To: Qt-interest
Subject: Re: [Qt-interest] How to get the icon by default right side of
listview
Ramesh wrote:
> Thanks Andre,
>
> no, I dont want to use table view..
> in paint event of listview I can draw icon at my own position...
>
> just I asked is there any inbuilt support in Qt listview to draw icon at
> right side..
> because by default the icon are coming at left side..
>
> I tried one thig at paint event of listview before calling the base class
> paint
>
> "option.QStyleOptionViewItem(QStyleOptionViewItem::Right);"
>
>
> Its not working,, it says illegal type..
>
> Thanks..
>
OK, fine. Don't use a table view and do it the hard way instead.
Whatever suits you. :-)
Qt can, AFAIK, put the icon on the right, but I think it will normally
only do that if you are in RightToLeft layout mode. You could try to put
just your list view in that layout mode, but I would not be suprised if
your texts appear inverted too or other similar weird things happen. I
did not try it myself, so YMMV.
You could also try the route you are at now. However, you have to do it
slightly different than you are doing now. You don't set the position in
the constructor. Use the copy constructor to create a new style option
object, and then just set the decorationPosition to Right. Then pass
that new styleoption to the base class implementation. That should work.
Again, I did not try this myself.
André
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Andre Somers
> Sent: Tuesday, March 16, 2010 12:20 PM
> To: Qt-interest
> Subject: Re: [Qt-interest] How to get the icon by default right side of
> listview
>
> Ramesh wrote:
>
>> Hi..
>>
>>
>>
>> I want listview to have an icon at right side and text at left side,
>> by default the icon is coming at left side and text will come after
>> the icon.
>>
>>
>>
>> How can I disply icon at right side of the listview and text at left
>> side..
>>
>>
>>
>> Any help on this?
>>
>>
>>
>>
> One option could be to use a table view instead, and just put your icon
> in a column of it's own on the right side of the text column.
>
> André
>
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
-----------------------------------------------
Robosoft Technologies - Come home to Technology
Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.
More information about the Qt-interest-old
mailing list