Style-sheet pseudo-state for selected item in QListView?
-
https://doc.qt.io/qt-6/stylesheet-reference.html#list-of-pseudo-states has a long list of pseudo-states, among them
:selectedfor the selected items in a QListView. Is there really no:currentpseudo-state for the current item in a QListView? Why? -
https://doc.qt.io/qt-6/stylesheet-reference.html#list-of-pseudo-states has a long list of pseudo-states, among them
:selectedfor the selected items in a QListView. Is there really no:currentpseudo-state for the current item in a QListView? Why?@Joachim-W said in Style-sheet pseudo-state for selected item in QListView?:
Is there really no :current pseudo-state for the current item in a QListView? Why?
What should
currentdo?
There are selected and non selected items, or hovered and non hovered items, or active and inactive items... Why do you need a stylesheet (i.e. extra state/selector) for a "current" item?! -
@Joachim-W said in Style-sheet pseudo-state for selected item in QListView?:
Is there really no :current pseudo-state for the current item in a QListView? Why?
What should
currentdo?
There are selected and non selected items, or hovered and non hovered items, or active and inactive items... Why do you need a stylesheet (i.e. extra state/selector) for a "current" item?!@Pl45m4 As I learned from https://forum.qt.io/topic/154635, and as confirmed by the API Docs (https://doc.qt.io/qt-6/qabstractitemview.html#currentIndex), there is also a "current" item in a QListView.
-
@Pl45m4 As I learned from https://forum.qt.io/topic/154635, and as confirmed by the API Docs (https://doc.qt.io/qt-6/qabstractitemview.html#currentIndex), there is also a "current" item in a QListView.
@Joachim-W
If you read the docs that is kind of like/used for selection in code. As you have found, there is no pseudo-state for it. Hopefullyselectedwould suffice for you. -
@Pl45m4 As I learned from https://forum.qt.io/topic/154635, and as confirmed by the API Docs (https://doc.qt.io/qt-6/qabstractitemview.html#currentIndex), there is also a "current" item in a QListView.
@Joachim-W said in Style-sheet pseudo-state for selected item in QListView?:
As I learned from https://forum.qt.io/topic/154635, and as confirmed by the API Docs (https://doc.qt.io/qt-6/qabstractitemview.html#currentIndex), there is also a "current" item in a QListView.
As @JonB said, you are mixing up code "logic" and stylesheet states... They have no direct relation to each other.
If I create my own item view and add a function calledblaa(), which returns a struct namedBlaa, it does not mean you have a property or style selector namedMyItemView:blaato apply any stylesheet to.