drop usage of QDesktopWidget
this drops support for Qt4
This commit is contained in:
parent
283e9eb563
commit
cc2b811ed1
@ -45,11 +45,7 @@ class PrintExporter(Exporter):
|
||||
#res = printer.resolution()
|
||||
sr = self.getSourceRect()
|
||||
#res = sr.width() * .4 / (self.params['width'] * 100 / 2.54)
|
||||
try:
|
||||
res = QtGui.QDesktopWidget().physicalDpiX()
|
||||
except AttributeError:
|
||||
# This is available since Qt 5
|
||||
res = QtGui.QGuiApplication.primaryScreen().physicalDotsPerInchX()
|
||||
res = QtGui.QGuiApplication.primaryScreen().physicalDotsPerInchX()
|
||||
printer.setResolution(res)
|
||||
rect = printer.pageRect()
|
||||
center = rect.center()
|
||||
|
@ -195,11 +195,7 @@ def _generateItemSvg(item, nodes=None, root=None, options={}):
|
||||
buf = QtCore.QBuffer(arr)
|
||||
svg = QtSvg.QSvgGenerator()
|
||||
svg.setOutputDevice(buf)
|
||||
try:
|
||||
dpi = QtGui.QDesktopWidget().logicalDpiX()
|
||||
except AttributeError:
|
||||
# This is available since Qt 5
|
||||
dpi = QtGui.QGuiApplication.primaryScreen().logicalDotsPerInchX()
|
||||
dpi = QtGui.QGuiApplication.primaryScreen().logicalDotsPerInchX()
|
||||
svg.setResolution(dpi)
|
||||
|
||||
p = QtGui.QPainter()
|
||||
|
Loading…
Reference in New Issue
Block a user