本文整理匯總了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