mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Workaround for a bug in Qt 5 that caused a ghost of the ondevice column to become visible sometimes when switching libraries.
This commit is contained in:
parent
f4c0d0933e
commit
4937ecf44d
@ -456,9 +456,12 @@ class BooksView(QTableView): # {{{
|
|||||||
|
|
||||||
# Ondevice column {{{
|
# Ondevice column {{{
|
||||||
def set_ondevice_column_visibility(self):
|
def set_ondevice_column_visibility(self):
|
||||||
m = self._model
|
col, h = self._model.column_map.index('ondevice'), self.column_header
|
||||||
self.column_header.setSectionHidden(m.column_map.index('ondevice'),
|
# Because of a bug in Qt 5 we have to ensure that the header is actually
|
||||||
not m.device_connected)
|
# relaid out by changing this value, without this sometimes the ghost
|
||||||
|
# of the ondevice column remains visible when changing libraries
|
||||||
|
h.setSectionHidden(col, not h.isSectionHidden(col))
|
||||||
|
h.setSectionHidden(col, not self._model.device_connected)
|
||||||
|
|
||||||
def set_device_connected(self, is_connected):
|
def set_device_connected(self, is_connected):
|
||||||
self._model.set_device_connected(is_connected)
|
self._model.set_device_connected(is_connected)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user