I'm having some success in using allChildItems() of the plot widget,
combined with isinstance:
def resizeEvent(self, event):
# figure out scale factor
sfh = float(self.centralWidget().height())/float(self.centralWidget
().minimumHeight())
sfw = float(self.centralWidget().width())/float(self.centralWidget
().minimumWidth())
sf = min(sfh,sfw)
font = QFont("Tahoma", 10.) # Tahoma seems to work well on old XP
boxes
font.setPointSizeF(sf*10.)
for item in self.plotMain.allChildItems():
if isinstance(item, pyqtgraph.graphicsItems.TextItem.TextItem):
item.setFont(font)
for widget in self.findChildren((QtWidgets.QLineEdit, QtWidgets.
QTextEdit
QtWidgets.QLabel )):
widget.setFont(font)
for widget in self.findChildren((PlotWidget)):
fs = int(10.*sf)
labelStyle = {'font-size': str(fs) + 'pt'}
widget.setLabel('left', **labelStyle)
widget.setLabel('bottom', **labelStyle)
widget.getAxis("left").tickFont = font
widget.getAxis("left").setStyle(tickTextOffset = fs)
widget.getAxis("bottom").tickFont = font
widget.getAxis("bottom").setStyle(tickTextOffset = fs)
widget.getAxis("left").setWidth(fs*10)
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/e0943287-6df9-41b9-ae3e-5b91566bdfbc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.