DoTheEvo
7th May 2016, 22:09
so when table view gets focused on some DE with some themes its barely visible
like here on default theme KDE on opensuse, we dont even see it highlighting first row, only when I jump arrow down we see where we are
http://i.imgur.com/kkYzmHO.gif
So I wanned to improve that by selecting the row right away...
http://i.imgur.com/SE78gLe.gif
heres the relevant part from the example above, its custom focusInEvent defined in the tableview
def focusInEvent(self, event):
row = self.currentIndex().row()
if row == -1:
row = 0
self.selectRow(row)
QTableView.focusInEvent(self, event)
but should I also let it run to the default focusInEvent with that 6th line?
can I remove that last line without expecting some issues? I tested it without and it seemed fine but I am not really sure about all the stuff that could be going on.
is there a better way? like setting some preference to true to get this selection going on focus?
Is it OK solution?
heres (http://pastebin.com/69A6a1mL) the whole code of the example, pyqt5, python3
like here on default theme KDE on opensuse, we dont even see it highlighting first row, only when I jump arrow down we see where we are
http://i.imgur.com/kkYzmHO.gif
So I wanned to improve that by selecting the row right away...
http://i.imgur.com/SE78gLe.gif
heres the relevant part from the example above, its custom focusInEvent defined in the tableview
def focusInEvent(self, event):
row = self.currentIndex().row()
if row == -1:
row = 0
self.selectRow(row)
QTableView.focusInEvent(self, event)
but should I also let it run to the default focusInEvent with that 6th line?
can I remove that last line without expecting some issues? I tested it without and it seemed fine but I am not really sure about all the stuff that could be going on.
is there a better way? like setting some preference to true to get this selection going on focus?
Is it OK solution?
heres (http://pastebin.com/69A6a1mL) the whole code of the example, pyqt5, python3