Account for older versions of Qt
This commit is contained in:
@@ -38,8 +38,12 @@ class DefinitionsUI(QtWidgets.QDialog, definitions.Ui_Dialog):
|
||||
radius = 15
|
||||
path = QtGui.QPainterPath()
|
||||
path.addRoundedRect(QtCore.QRectF(self.rect()), radius, radius)
|
||||
mask = QtGui.QRegion(path.toFillPolygon().toPolygon())
|
||||
self.setMask(mask)
|
||||
|
||||
try:
|
||||
mask = QtGui.QRegion(path.toFillPolygon().toPolygon())
|
||||
self.setMask(mask)
|
||||
except TypeError: # Required for older versions of Qt
|
||||
pass
|
||||
|
||||
self.definitionView.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
|
||||
|
@@ -36,8 +36,12 @@ class MetadataUI(QtWidgets.QDialog, metadata.Ui_Dialog):
|
||||
radius = 15
|
||||
path = QtGui.QPainterPath()
|
||||
path.addRoundedRect(QtCore.QRectF(self.rect()), radius, radius)
|
||||
mask = QtGui.QRegion(path.toFillPolygon().toPolygon())
|
||||
self.setMask(mask)
|
||||
|
||||
try:
|
||||
mask = QtGui.QRegion(path.toFillPolygon().toPolygon())
|
||||
self.setMask(mask)
|
||||
except TypeError: # Required for older versions of Qt
|
||||
pass
|
||||
|
||||
self.parent = parent
|
||||
self.database_path = self.parent.database_path
|
||||
|
@@ -324,6 +324,8 @@ class SettingsUI(QtWidgets.QDialog, settingswindow.Ui_Dialog):
|
||||
self.gather_annotations()
|
||||
Settings(self.main_window).save_settings()
|
||||
Settings(self.main_window).read_settings()
|
||||
self.main_window.settings['last_open_tab'] = None # Needed to allow focus change
|
||||
# to newly opened book
|
||||
self.resizeEvent()
|
||||
|
||||
def resizeEvent(self, event=None):
|
||||
|
Reference in New Issue
Block a user