16 #include "Base/Util/Assert.h"
18 #include <QResizeEvent>
19 #include <qcustomplot.h>
23 const QString tick_font =
"tick-font-key";
24 const int widget_size_to_switch_font = 500;
36 if (event->type() == QEvent::Resize) {
37 auto* resizeEvent =
dynamic_cast<QResizeEvent*
>(event);
40 if (!
m_fonts.contains(tick_font))
43 if (resizeEvent->size().width() < widget_size_to_switch_font)
50 return QObject::eventFilter(obj, event);
69 ff.setPointSizeF(ff.pointSizeF() * factor);
81 color_map->
colorScale()->axis()->setTickLabelFont(font);
Defines class FontScalingEvent.
The ColorMap class presents 2D intensity data from IntensityDataItem as color map.
QCPColorScale * colorScale()
bool eventFilter(QObject *obj, QEvent *event) override
void setTickLabelFont(const QFont &font)
void scaleFonts(double factor)
FontScalingEvent(ScientificPlot *plot, QWidget *parent)
QMap< QString, QFont > m_fonts
void backupFonts()
Backup all fonts.
Common interface for plot-descriptor interaction.
PLOT_TYPE plotType() const
Returns the type of current plot.
virtual QCustomPlot * customPlot()=0