[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Background color for cells in QTableView
From: Marc Rossi <mrossi19 () gmail ! com>
Date: 2011-06-25 2:54:48
Message-ID: BANLkTik=sUSGV03_u+pmgOm-u29wB1Z9aQ () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Yes, tried without stylesheet with no luck (just tried it again to see if I
missed something). Thought about that as it feels like that Role is
disabled somehow.
On Fri, Jun 24, 2011 at 7:26 PM, David Boddie <david@boddie.org.uk> wrote:
> On Fri Jun 24 20:30:32 BST 2011, Marc Rossi wrote:
>
> > I have a model/view app with a QTableView that I would like to have
> columns
> > 2, 3 & 4 shaded a different color than the rest. My model sub-classes
> > QAbstractTableModel and I also use a QSortFilterProxyModel. I assumed I
> > could just override the data() method in my QAbstractTableModel derived
> > class, returning the correct QBrush when called with role =
> > Qt.BackgroundRole, but my data method NEVER gets called with this role.
> > I currently use a stylesheet to set the entire background of the
> > QTableView.
>
> Just a thought: have you tried it without the stylesheet?
>
> David
> _______________________________________________
> PyQt mailing list PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
[Attachment #5 (text/html)]
Yes, tried without stylesheet with no luck (just tried it again to see if I missed \
something). Thought about that as it feels like that Role is disabled \
somehow.<br><br><div class="gmail_quote">On Fri, Jun 24, 2011 at 7:26 PM, David \
Boddie <span dir="ltr"><<a \
href="mailto:david@boddie.org.uk">david@boddie.org.uk</a>></span> wrote:<br> \
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex;"><div class="im">On Fri Jun 24 20:30:32 BST 2011, Marc Rossi \
wrote:<br> <br>
> I have a model/view app with a QTableView that I would like to have columns<br>
> 2, 3 & 4 shaded a different color than the rest. My model sub-classes<br>
> QAbstractTableModel and I also use a QSortFilterProxyModel. I assumed I<br>
> could just override the data() method in my QAbstractTableModel derived<br>
> class, returning the correct QBrush when called with role =<br>
> Qt.BackgroundRole, but my data method NEVER gets called with this role.<br>
> I currently use a stylesheet to set the entire background of the<br>
> QTableView.<br>
<br>
</div>Just a thought: have you tried it without the stylesheet?<br>
<br>
David<br>
_______________________________________________<br>
PyQt mailing list <a \
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br> <a \
href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" \
target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br> \
</blockquote></div><br>
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic