def styleQwtPlot(self,name,elem): font = QFont() font.setPixelSize(12) title = QwtText(name) title.setFont(font) elem.setTitle(title) canvas = elem.canvas() canvas.setLineWidth(0); elem.setCanvas(canvas)
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 styleQwtPlot(self, name, elem): font = QFont() font.setPixelSize(24) title = QwtText(name) title.setFont(font) elem.setTitle(title)