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
:selected
for the selected items in a QListView. Is there really no:current
pseudo-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
current
do?
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.
-
@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:blaa
to apply any stylesheet to.