Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, April 2007
TreeView icon highlighting


Message 1 in thread

It's possible create treeview who don't highlight icon of item like on 
Left picture ?

JPEG image

JPEG image


Message 2 in thread

SABROG wrote:
> It's possible create treeview who don't highlight icon of item like on
> Left picture ?

this question is getting a frequently asked question, try:

myTreeView->setSelectionBehavior(QAbstractItemView::SelectItems);

if this doesn't do the trick for you, have a look at:
QStyle::SH_ItemView_ShowDecorationSelected
http://doc.trolltech.com/4.2/qstyle.html#StyleHint-enum

Cheers,
Peter

--
 [ signature omitted ] 

Message 3 in thread

How i can turn off this style QStyle::SH_ItemView_ShowDecorationSelected ?
> if this doesn't do the trick for you, have a look at:
> QStyle::SH_ItemView_ShowDecorationSelected
> http://doc.trolltech.com/4.2/qstyle.html#StyleHint-enum

--
 [ signature omitted ] 

Message 4 in thread

You subclass a style of your choice, e.g. QPlastiqueStyle and overload the 
styleHint() function, so that it returns false in the case of 
hint == QStyle::SH_ItemView_ShowDecorationSelected and QPlastiqueStyle::styleHint(...) for all the other unchanged cases.

Cheers,
Peter 

> -----Ursprüngliche Nachricht-----
> Von: SABROG [mailto:sabrog@xxxxxxxxx]
> Gesendet: Montag, 2. April 2007 17:12
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: Re: AW: TreeView icon highlighting
> 
> How i can turn off this style QStyle::SH_ItemView_ShowDecorationSelected ?
> > if this doesn't do the trick for you, have a look at:
> > QStyle::SH_ItemView_ShowDecorationSelected
> > http://doc.trolltech.com/4.2/qstyle.html#StyleHint-enum
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ] 

Message 5 in thread

Hmm, this not simple, "Qt - CODE LESS. CREATE MORE." ;)
What if i try delegate items and just return less size Hint ?

Peter Prade ÐÐÑÐÑ:
> You subclass a style of your choice, e.g. QPlastiqueStyle and overload the 
> styleHint() function, so that it returns false in the case of 
> hint == QStyle::SH_ItemView_ShowDecorationSelected and QPlastiqueStyle::styleHint(...) for all the other unchanged cases.
> 
> Cheers,
> Peter 
> 
>> -----UrsprÃngliche Nachricht-----
>> Von: SABROG [mailto:sabrog@xxxxxxxxx]

--
 [ signature omitted ] 

Message 6 in thread

SABROG schrieb:
> Hmm, this not simple, "Qt - CODE LESS. CREATE MORE." ;)

However, this true. You can code less by relying on the default 
behaviour. Or you can create more by tweaking the behaviour if you want 
bells and whistles. Try this with MFC or *gasp* Win32 (or Motif, if it 
comes to that)... ;-)
My 5 cent.

Martin

-- 
 [ signature omitted ] 

Message 7 in thread

---------- Forwarded message ----------
From: Yogesh M <yogeshm02@xxxxxxxxx>
Date: 03-Apr-2007 19:46
Subject: Re: AW: AW: TreeView icon highlighting
To: SABROG <sabrog@xxxxxxxxx>


On 03/04/07, SABROG <sabrog@xxxxxxxxx> wrote:
> Hmm, this not simple, "Qt - CODE LESS. CREATE MORE." ;)
> What if i try delegate items and just return less size Hint ?

This will not work, but you can use a custom item delegate and do the
painting yourself because decoration is drawn by the delegate.

--
 [ signature omitted ]