Account for older versions of Qt

This commit is contained in:
BasioMeusPuga
2018-05-03 08:37:22 -04:00
parent ebc3ef9f1b
commit 3e54340694
3 changed files with 14 additions and 4 deletions

View File

@@ -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