It worked like a charm, thanks.

Maybe you can answer me two things about your stylesheet:


   - where can I find documentation about the QTreeView style specific to
   windows or mac?
   - I'm working on a windows machine, but the code that worked is the Mac
   one, do you have any idea why?


Thanks,
Ruan L. Nunes

Em ter, 29 de dez de 2015 às 13:58, Tony Rietwyk <[email protected]>
escreveu:

> Hi Ruan,
>
>
>
> In our global style sheet we use:
>
>
>
> QTreeView {
>
>                 background-color: transparent;
>
>                 selection-background-color: green; /* Used on Mac */
>
>                 selection-color: white; /* Used on Mac */
>
>                 show-decoration-selected: 1;
>
> }
>
> QTreeView::item {
>
>                 background-color: transparent;
>
> }
>
> QTreeView::item:selected {
>
>                 background-color: green; /* Used on Windows */
>
>                 color: white;
>
> }
>
> QTreeView::item:disabled:selected {
>
>                 background-color: #e0e0e0;
>
>                 color: black;
>
> }
>
>
>
> Hope that helps!
>
>
>
> Tony
>
>
>
>
>
> *From:* Interest [mailto:[email protected]] *On Behalf Of *Ruan
> leitão
> *Sent:* Wednesday, 30 December 2015 2:31 AM
> *To:* [email protected]
> *Subject:* [Interest] [qt-4.8 windows] Setting QTreeView selected item
> style in qss
>
>
>
> Hello,
>
> I already have post this question in Stack Overflow
> <http://stackoverflow.com/questions/34187874/setting-qtreeview-selected-item-style-in-qss>,
> but a have no answer. Now a friend tell me to talk on the mailing list.
>
>
>
> I need to change the background color of the *selected item* on a
> QTreeView. I already tried using the Qt examples and other SO questions.
>
> The style applied to the ::branch subcontrol works fine, but none of the
> commands in the ::item subcontrols works.
>
> Here my current result:
>
> <http://i.stack.imgur.com/kQyGk.png>
> [image: ~WRD000.jpg]
>
> But I want a result like this:
>
> <http://i.stack.imgur.com/TjucU.png>
> [image: ~WRD000.jpg]
>
> Can someone help me, thanks in advance.
>
> Ruan L. Nunes
>
> --
>
> Ruan L. Nunes
> _______________________________________________
> Interest mailing list
> [email protected]
> http://lists.qt-project.org/mailman/listinfo/interest
>
-- 
Ruan L. Nunes
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to