本文整理汇总了Python中qwt.qt.QtGui.QApplication.desktop方法的典型用法代码示例。如果您正苦于以下问题:Python QApplication.desktop方法的具体用法?Python QApplication.desktop怎么用?Python QApplication.desktop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qwt.qt.QtGui.QApplication
的用法示例。
在下文中一共展示了QApplication.desktop方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: qwtScreenResolution
# 需要导入模块: from qwt.qt.QtGui import QApplication [as 别名]
# 或者: from qwt.qt.QtGui.QApplication import desktop [as 别名]
def qwtScreenResolution():
screenResolution = QSize()
if not screenResolution.isValid():
desktop = QApplication.desktop()
if desktop is not None:
screenResolution.setWidth(desktop.logicalDpiX())
screenResolution.setHeight(desktop.logicalDpiY())
return screenResolution
示例2: _desktopwidget
# 需要导入模块: from qwt.qt.QtGui import QApplication [as 别名]
# 或者: from qwt.qt.QtGui.QApplication import desktop [as 别名]
def _desktopwidget(self):
"""
Property used to store the Application Desktop Widget to avoid calling
the `QApplication.desktop()" function more than necessary as its
calling time is not negligible.
"""
if self.__desktopwidget is None:
self.__desktopwidget = QApplication.desktop()
return self.__desktopwidget
示例3: qwtUnscaleFont
# 需要导入模块: from qwt.qt.QtGui import QApplication [as 别名]
# 或者: from qwt.qt.QtGui.QApplication import desktop [as 别名]
def qwtUnscaleFont(painter):
if painter.font().pixelSize() >= 0:
return
screenResolution = qwtScreenResolution()
pd = painter.device()
if pd.logicalDpiX() != screenResolution.width() or\
pd.logicalDpiY() != screenResolution.height():
pixelFont = QFont(painter.font(), QApplication.desktop())
pixelFont.setPixelSize(QFontInfo(pixelFont).pixelSize())
painter.setFont(pixelFont)
示例4: desktopwidget
# 需要导入模块: from qwt.qt.QtGui import QApplication [as 别名]
# 或者: from qwt.qt.QtGui.QApplication import desktop [as 别名]
def desktopwidget(self):
if self._desktopwidget is None:
self._desktopwidget = QApplication.desktop()
return self._desktopwidget