Re: [Interest] Customize QTableView selection color

2016-02-07 Thread Murphy, Sean
> > void customStyledItemDelegate::paint(QPainter *painter, const > QStyleOptionViewItem &option, const QModelIndex &index) const > > { > > QStyleOptionViewItem subop(option); > " Just make a copy of the style option," > > subop.state &= ~(QStyle::State_Selected); > " reset the selection

Re: [Interest] Customize QTableView selection color

2016-02-07 Thread André Somers
Op 05/02/2016 om 23:43 schreef Murphy, Sean: I’m still struggling with how to customize the selection color for items on a QTableView I use a QStyledItemDelegate. In the paint(painter,option,index) method I create my own QPalette based on selection etc and then call the base class paint functi

Re: [Interest] Customize QTableView selection color

2016-02-05 Thread Murphy, Sean
> > I’m still struggling with how to customize the selection color for items on > > a > > QTableView > > I use a QStyledItemDelegate. > In the paint(painter,option,index) method I create my own QPalette based > on > selection etc and then call the base class paint function. > > QStyleOption

Re: [Interest] Customize QTableView selection color

2016-02-05 Thread william.croc...@analog.com
Ok, so then in my case, I'd just inherit from QStyledItemDelegate and add a function that allows me to pass in my QMap so that I can adjust your calls of setColor() in paint() on the fly based on modelIndex. Do you happen to have any pointers for customizing the drag and drop indicator? N

Re: [Interest] Customize QTableView selection color

2016-02-05 Thread André Somers
Op 05/02/2016 om 17:39 schreef Murphy, Sean: If I understand you correctly, you basicaly want the color of the row to be whatever it was before it was selected, right? Can't you just use a QProxyStyle and reset the selected flag from the style option before you pass on the render command to

Re: [Interest] Customize QTableView selection color

2016-02-05 Thread Murphy, Sean
> > I’m still struggling with how to customize the selection color for items on > > a > > QTableView > > I use a QStyledItemDelegate. > In the paint(painter,option,index) method I create my own QPalette based > on > selection etc and then call the base class paint function. > > QStyleOption

Re: [Interest] Customize QTableView selection color

2016-02-05 Thread Murphy, Sean
> If I understand you correctly, you basicaly want the color of the row to be > whatever it was before it was selected, right? > > Can't you just use a QProxyStyle and reset the selected flag from the style > option before you pass on the render command to the underlying style?  Have > the sele

Re: [Interest] Customize QTableView selection color

2016-02-05 Thread Igor Mironchik
Hi, you can simple use QSS, for example: QTableView::item:selected { background: #6a6ea9; } On 05.02.2016 18:34, Murphy, Sean wrote: I’m still struggling with how to customize the selection color for items on a QTableView (previously posted as http://lists.qt-project.org/pipermail/interest/

Re: [Interest] Customize QTableView selection color

2016-02-05 Thread André Somers
Op 05/02/2016 om 16:34 schreef Murphy, Sean: I’m still struggling with how to customize the selection color for items on a QTableView (previously posted as http://lists.qt-project.org/pipermail/interest/2016-January/020760.html). I currently color the rows with custom colors based on the da

Re: [Interest] Customize QTableView selection color

2016-02-05 Thread william.croc...@analog.com
On 02/05/2016 10:34 AM, Murphy, Sean wrote: I’m still struggling with how to customize the selection color for items on a QTableView I use a QStyledItemDelegate. In the paint(painter,option,index) method I create my own QPalette based on selection etc and then call the base class paint function

[Interest] Customize QTableView selection color

2016-02-05 Thread Murphy, Sean
I’m still struggling with how to customize the selection color for items on a QTableView (previously posted as http://lists.qt-project.org/pipermail/interest/2016-January/020760.html). I currently color the rows with custom colors based on the data being shown in each row in my model’s data(con