Proper check for Qt version

This commit is contained in:
John Yani
2020-09-30 23:29:06 +03:00
committed by wwmayer
parent 893fd13b99
commit 2cf6d093d6

View File

@@ -1122,7 +1122,7 @@ class Snapper:
mw = Gui.getMainWindow()
for w in mw.findChild(QtGui.QMdiArea).findChildren(QtGui.QWidget):
if w.metaObject().className() == "SIM::Coin3D::Quarter::QuarterWidget":
if int(QtCore.qVersion()) > 4:
if int(QtCore.qVersion().split('.')[0]) > 4:
device_pixel_ratio = w.devicePixelRatio()
return device_pixel_ratio
@@ -1147,7 +1147,7 @@ class Snapper:
qp.end()
cur_hot_x = 0.25 * full_icon_size * device_pixel_ratio
cur_hot_y = 0.25 * full_icon_size * device_pixel_ratio
if int(QtCore.qVersion()) > 4:
if int(QtCore.qVersion().split('.')[0]) > 4:
new_icon.setDevicePixelRatio(device_pixel_ratio)
cur = QtGui.QCursor(new_icon, cur_hot_x, cur_hot_y)
return cur