18 #include <QResizeEvent>
19 #include <qcustomplot.h>
22 const QString tick_font =
"tick-font-key";
23 const int widget_size_to_switch_font = 500;
27 : QObject(parent), m_plot(plot)
33 if (event->type() == QEvent::Resize) {
34 QResizeEvent* resizeEvent =
static_cast<QResizeEvent*
>(event);
37 if (!
m_fonts.contains(tick_font)) {
41 if (resizeEvent->size().width() < widget_size_to_switch_font) {
49 return QObject::eventFilter(obj, event);
68 ff.setPointSizeF(ff.pointSizeF() * factor);
80 color_map->
colorScale()->axis()->setTickLabelFont(font);
Defines the macro ASSERT.
#define ASSERT(condition)
Defines class FontScalingEvent.
The ColorMap class presents 2D intensity data from IntensityDataItem as color map.
QCPColorScale * colorScale()
void setTickLabelFont(const QFont &font)
void scaleFonts(double factor)
FontScalingEvent(ScientificPlot *plot, QWidget *parent)
QMap< QString, QFont > m_fonts
void backupFonts()
Backup all fonts.
bool eventFilter(QObject *obj, QEvent *event)
Common interface for plot-descriptor interaction.
PLOT_TYPE plotType() const
Returns the type of current plot.
virtual QCustomPlot * customPlot()=0