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
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
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
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
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)
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)
def desktopwidget(self): if self._desktopwidget is None: self._desktopwidget = QApplication.desktop() return self._desktopwidget
def desktopwidget(self): if self._desktopwidget is None: self._desktopwidget = QApplication.desktop() return self._desktopwidget