> > 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
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
> > 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
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
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
> > 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
> 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
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/
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
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
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
11 matches
Mail list logo