本文整理汇总了Python中PyQt4.QtGui.QDesktopWidget.physicalDpiX方法的典型用法代码示例。如果您正苦于以下问题:Python QDesktopWidget.physicalDpiX方法的具体用法?Python QDesktopWidget.physicalDpiX怎么用?Python QDesktopWidget.physicalDpiX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QDesktopWidget
的用法示例。
在下文中一共展示了QDesktopWidget.physicalDpiX方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtGui import QDesktopWidget [as 别名]
# 或者: from PyQt4.QtGui.QDesktopWidget import physicalDpiX [as 别名]
def __init__(self, alg):
super(AlgorithmDialogBase, self).__init__(iface.mainWindow())
self.setupUi(self)
self.settings = QSettings()
self.restoreGeometry(self.settings.value("/Processing/dialogBase", QByteArray()))
self.executed = False
self.mainWidget = None
self.alg = alg
# Rename OK button to Run
self.btnRun = self.buttonBox.button(QDialogButtonBox.Ok)
self.btnRun.setText(self.tr('Run'))
self.btnClose = self.buttonBox.button(QDialogButtonBox.Close)
self.setWindowTitle(AlgorithmClassification.getDisplayName(self.alg))
desktop = QDesktopWidget()
if desktop.physicalDpiX() > 96:
self.textHelp.setZoomFactor(desktop.physicalDpiX() / 96)
algHelp = self.alg.shortHelp()
if algHelp is None:
self.textShortHelp.setVisible(False)
else:
self.textShortHelp.document().setDefaultStyleSheet('''.summary { margin-left: 10px; margin-right: 10px; }
h2 { color: #555555; padding-bottom: 15px; }
a { text-decoration: none; color: #3498db; font-weight: bold; }
p { color: #666666; }
b { color: #333333; }
dl dd { margin-bottom: 5px; }''')
self.textShortHelp.setHtml(algHelp)
self.textShortHelp.setOpenLinks(False)
def linkClicked(url):
webbrowser.open(url.toString())
self.textShortHelp.anchorClicked.connect(linkClicked)
self.textHelp.page().setNetworkAccessManager(QgsNetworkAccessManager.instance())
isText, algHelp = self.alg.help()
if algHelp is not None:
algHelp = algHelp if isText else QUrl(algHelp)
try:
if isText:
self.textHelp.setHtml(algHelp)
else:
self.textHelp.settings().clearMemoryCaches()
self.textHelp.load(algHelp)
except:
self.tabWidget.removeTab(2)
else:
self.tabWidget.removeTab(2)
self.showDebug = ProcessingConfig.getSetting(
ProcessingConfig.SHOW_DEBUG_IN_DIALOG)