use a new header key on qt5 to fix drawing bug

This commit is contained in:
Damien Elmes 2014-03-06 09:07:03 +09:00
parent 93414007b8
commit e063123218

View file

@ -373,6 +373,11 @@ class Browser(QMainWindow):
self.onSearch() self.onSearch()
self.show() self.show()
def _headerKey(self):
if qtmajor >= 5:
return "editor2"
return "editor"
def setupToolbar(self): def setupToolbar(self):
self.toolbarWeb = AnkiWebView() self.toolbarWeb = AnkiWebView()
self.toolbarWeb.setFixedHeight(32 + self.mw.fontHeightDelta) self.toolbarWeb.setFixedHeight(32 + self.mw.fontHeightDelta)
@ -458,7 +463,7 @@ class Browser(QMainWindow):
self.editor.setNote(None) self.editor.setNote(None)
saveGeom(self, "editor") saveGeom(self, "editor")
saveState(self, "editor") saveState(self, "editor")
saveHeader(self.form.tableView.horizontalHeader(), "editor") saveHeader(self.form.tableView.horizontalHeader(), self._headerKey())
self.col.conf['activeCols'] = self.model.activeCols self.col.conf['activeCols'] = self.model.activeCols
self.col.setMod() self.col.setMod()
self.hide() self.hide()
@ -623,7 +628,7 @@ class Browser(QMainWindow):
if not isWin: if not isWin:
vh.hide() vh.hide()
hh.show() hh.show()
restoreHeader(hh, "editor") restoreHeader(hh, self._headerKey())
hh.setHighlightSections(False) hh.setHighlightSections(False)
hh.setMinimumSectionSize(50) hh.setMinimumSectionSize(50)
hh.setMovable(True) hh.setMovable(True)