QListWidget currentRow prints -1 after setting a stylesheet
Solved
General and Desktop
-
Hi, so I set a stylesheet to QListWidget, but when I try to get the current row I selected, it prints -1.
I don't know why this is happening.
Also, when I scroll down, and I try to click something, it doesn't click where I want it to.
The stylesheet:QListWidget::item {color: rgb(211, 213, 201); background-color: rgb(36, 36, 44);} QListWidget::item:selected {color: rgb(211, 213, 201); background-color: rgb(66, 66, 74); border: 0.5px solid black;}
-
@Sucharek
Setting or not setting a stylesheet can have no effect at all on anything like "get the current row I selected" or "what you click" on aQListWidget
. Nor affecting its click behaviour. So whatever you are doing/not doing it is in your code for the list widget.