Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
 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
Esempio n. 4
0
 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
Esempio n. 5
0
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)
Esempio n. 6
0
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)
Esempio n. 7
0
 def desktopwidget(self):
     if self._desktopwidget is None:
         self._desktopwidget = QApplication.desktop()
     return self._desktopwidget
Esempio n. 8
0
 def desktopwidget(self):
     if self._desktopwidget is None:
         self._desktopwidget = QApplication.desktop()
     return self._desktopwidget