Re: [Interest] Setting current item text color via stylesheet in QTableView for SelectRows

2018-08-12 Thread Patrick Stinson
Don’t forget to reply to all.

Your example is interesting, and it does solve the problem of making the 
selected and current item stand out. I suppose there isn’t a way to do this and 
also show the current item when it is not selected.

How strange that you can’t combine selectors as in CSS.


> On Aug 12, 2018, at 8:42 PM, Reinhardt Behm  wrote:
> 
> QTableView::item
> { color:black; background-color:white; }
> QTableView::item:selected
> { color:green; }
> QTableView::item:focus
> { color:blue;  }

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Setting current item text color via stylesheet in QTableView for SelectRows

2018-08-11 Thread Patrick Stinson
It’s like there needs to be an extra rule to honor the selected and focus 
states simultaneously, but ::item:selected:focus doesn’t work.

> On Aug 10, 2018, at 12:11 PM, Patrick Stinson  wrote:
> 
> Negative. “current” is not a valid pseudo state, as “focus” is the 
> appropriate pseudo state for the current item.
> 
>> On Aug 9, 2018, at 6:15 PM, Reinhardt Behm  wrote:
>> 
>> Hi Patrick,
>> 
>> how about:
>> QTableView::item:selected
>> { color:green; }
>> QTableView::item:current
>> { color:yellow; }
>> 
>> -- 
>> Best Regards
>> 
>> Reinhardt Behm
>> 
>>> On Thursday 09 August 2018 10:34:38 you wrote:
>>> Thanks again. Actually, what I am trying to do is differentiate between
>>> current and selected items so that I can tell which item is current within
>>> the selected row. For example, the following paints all selected items with
>>> the same text color so you don’t know which one is selected:
>>> 
>>> QTableView::item:focus {
>>>color: yellow;
>>> }
>>> 
 On Aug 7, 2018, at 11:31 PM, Reinhardt Behm  wrote:
 
 Hi Patrick,
 
 as I understood you, you want to style a row in a table view. When it is
 selected and and current.
 
 I would do it like
 TableView::item:selected, TableView::item:current
 { color:ugly-green; }
 
 This is untested.
 
> Thanks again, but I still don’t think you have answered the question.
> 
>> On Aug 7, 2018, at 10:22 PM, Reinhardt Behm  wrote:
>> 
>> You can combine attributes:
>> 
>> If needed, logical OR can be expressed using the comma operator:
>> QCheckBox:hover, QCheckBox:checked { color: white }
>> 
>>> On Tuesday 07 August 2018 20:54:58 you wrote:
>>> Thanks for your reply, Reinhardt. Your code acknowledges the selected
>>> item
>>> but I am looking for the current item whether it is selected or not.
>>> 
>>> -Patrick
>>> 
 On Aug 7, 2018, at 6:00 PM, Reinhardt Behm via Interest
  wrote:>
 
> On Tuesday 07 August 2018 16:31:42 Patrick Stinson wrote:
> Hello!
> 
> I have a vanilla QTableView with SingleSelection and SelectRows and
> am
> trying to figure out how to set the text color of the current item
> for
> both
> when the row is selected and when it isn’t. This is important so that
> the
> user knows which cell will be edited when they hit the enter key and
> so
> they can navigate to a new cell using the arrow keys.
> 
> It seems that the following will do it, but it doesn’t apply when the
> row
> is selected.
> 
> QTableView::item:focus {
> 
> color: yellow;
> 
> }
> 
> How can this be done?
> 
> Thanks!
> -Patrick
 
 Here something is used in a similar case
 
 TableViewBase {
 
  font-size: 18px; font-weight: bold;
  background-color: white;
 
 }
 TableViewBase::item {
 
  color: black;
  font-size: 18px; font-weight: bold;
  background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:
  0
 
 #f6f7fa, stop: 1 #dadbde);
 }
 TableViewBase::item:selected {
 
  color: white;
  background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:
  0
 
 #606060, stop: 1 #00);
 }
> 
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Setting current item text color via stylesheet in QTableView for SelectRows

2018-08-10 Thread Patrick Stinson
Negative. “current” is not a valid pseudo state, as “focus” is the appropriate 
pseudo state for the current item.

> On Aug 9, 2018, at 6:15 PM, Reinhardt Behm  wrote:
> 
> Hi Patrick,
> 
> how about:
> QTableView::item:selected
> { color:green; }
> QTableView::item:current
> { color:yellow; }
> 
> -- 
> Best Regards
> 
> Reinhardt Behm
> 
> On Thursday 09 August 2018 10:34:38 you wrote:
>> Thanks again. Actually, what I am trying to do is differentiate between
>> current and selected items so that I can tell which item is current within
>> the selected row. For example, the following paints all selected items with
>> the same text color so you don’t know which one is selected:
>> 
>> QTableView::item:focus {
>>color: yellow;
>> }
>> 
>>> On Aug 7, 2018, at 11:31 PM, Reinhardt Behm  wrote:
>>> 
>>> Hi Patrick,
>>> 
>>> as I understood you, you want to style a row in a table view. When it is
>>> selected and and current.
>>> 
>>> I would do it like
>>> TableView::item:selected, TableView::item:current
>>> { color:ugly-green; }
>>> 
>>> This is untested.
>>> 
 Thanks again, but I still don’t think you have answered the question.
 
> On Aug 7, 2018, at 10:22 PM, Reinhardt Behm  > wrote:
> 
> You can combine attributes:
> 
> If needed, logical OR can be expressed using the comma operator:
> QCheckBox:hover, QCheckBox:checked { color: white }
> 
>> On Tuesday 07 August 2018 20:54:58 you wrote:
>> Thanks for your reply, Reinhardt. Your code acknowledges the selected
>> item
>> but I am looking for the current item whether it is selected or not.
>> 
>> -Patrick
>> 
>>> On Aug 7, 2018, at 6:00 PM, Reinhardt Behm via Interest
>>> mailto:interest@qt-project.org>> wrote:>
>>> 
>>> On Tuesday 07 August 2018 16:31:42 Patrick Stinson wrote:
 Hello!
 
 I have a vanilla QTableView with SingleSelection and SelectRows and
 am
 trying to figure out how to set the text color of the current item
 for
 both
 when the row is selected and when it isn’t. This is important so that
 the
 user knows which cell will be edited when they hit the enter key and
 so
 they can navigate to a new cell using the arrow keys.
 
 It seems that the following will do it, but it doesn’t apply when the
 row
 is selected.
 
 QTableView::item:focus {
 
 color: yellow;
 
 }
 
 How can this be done?
 
 Thanks!
 -Patrick
>>> 
>>> Here something is used in a similar case
>>> 
>>> TableViewBase {
>>> 
>>>  font-size: 18px; font-weight: bold;
>>>  background-color: white;
>>> 
>>> }
>>> TableViewBase::item {
>>> 
>>>  color: black;
>>>  font-size: 18px; font-weight: bold;
>>>  background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:
>>>  0
>>> 
>>> #f6f7fa, stop: 1 #dadbde);
>>> }
>>> TableViewBase::item:selected {
>>> 
>>>  color: white;
>>>  background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:
>>>  0
>>> 
>>> #606060, stop: 1 #00);
>>> }

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Setting current item text color via stylesheet in QTableView for SelectRows

2018-08-07 Thread Reinhardt Behm via Interest
On Tuesday 07 August 2018 16:31:42 Patrick Stinson wrote:
> Hello!
> 
> I have a vanilla QTableView with SingleSelection and SelectRows and am
> trying to figure out how to set the text color of the current item for both
> when the row is selected and when it isn’t. This is important so that the
> user knows which cell will be edited when they hit the enter key and so
> they can navigate to a new cell using the arrow keys.
> 
> It seems that the following will do it, but it doesn’t apply when the row is
> selected.
> 
> QTableView::item:focus {
> color: yellow;
> }
> 
> How can this be done?
> 
> Thanks!
> -Patrick

Here something is used in a similar case

TableViewBase {
font-size: 18px; font-weight: bold;
background-color: white;
}
 TableViewBase::item {
color: black;
font-size: 18px; font-weight: bold;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 
#f6f7fa, stop: 1 #dadbde);
}
TableViewBase::item:selected {
color: white;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 
#606060, stop: 1 #00);
}
-- 
Best Regards

Reinhardt Behm


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Setting current item text color via stylesheet in QTableView for SelectRows

2018-08-07 Thread Patrick Stinson
Hello!

I have a vanilla QTableView with SingleSelection and SelectRows and am trying 
to figure out how to set the text color of the current item for both when the 
row is selected and when it isn’t. This is important so that the user knows 
which cell will be edited when they hit the enter key and so they can navigate 
to a new cell using the arrow keys.

It seems that the following will do it, but it doesn’t apply when the row is 
selected.

QTableView::item:focus {

  
color: yellow;  

  
}

How can this be done?

Thanks!
-Patrick___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest