QTreeWidget & QListWidget different selection
Hi,
When an Item is selected in QTreeWidget, the selection background extends till the width of the widget (single column QTreeWidget), whereas when an item is selected in QListWidget, the width of the selection background is relative to the width of the current Item.
Can I make QListWidget selection behave like QTreeWidget ?
Thanks a lot.
Re: QTreeWidget & QListWidget different selection
Make sure "movement" property is set to Static.
Re: QTreeWidget & QListWidget different selection
Setting the property did not make any difference. Please look at the images below for the difference in the selection. I want the selection in QListWidget look like selection in the QTreeWidget.
Please Help
Thakns a lot.
http://img90.imageshack.us/img90/458...tionxt0.th.png
http://img212.imageshack.us/img212/6...tionpd1.th.png
Re: QTreeWidget & QListWidget different selection
Please, post images as attachments.
Re: QTreeWidget & QListWidget different selection
I tried attachments but for some reason the images did not show and therefore I used the other way.
1 Attachment(s)
Re: QTreeWidget & QListWidget different selection
Quote:
Originally Posted by munna
I tried attachments but for some reason the images did not show and therefore I used the other way.
It worked for me:
Re: QTreeWidget & QListWidget different selection
What if you force the gridSize to be as wide as the width of the widget?
http://qtnode.net/pastebin/799
Re: QTreeWidget & QListWidget different selection
If I take a default, not changed in any way QListWidget, the selection is as you want it. You must have changed some property and my guess was it was the movement property because it does give an effect you described.
Re: QTreeWidget & QListWidget different selection
This seems to be a problem with the Windows and Motif styles of the version of Qt I am using (Qt 4.2 tp1). The MacOs and plastique styles display OK. Can you verify which platform you are running on?
Also, try running your app with 'app -style plastique' and see if the problem goes away.
If so, it may be worth reporting to Trolltech.
Re: QTreeWidget & QListWidget different selection
I am on win xp + Qt 4.1.3. I see that it works fine with Qt3 and all other styles.
I have not tired but will the method explain by jpn work?