Hi all,
I have a 2D plot and I want to change the font size used by the tracker pen.
My code is:
if (zoomer != NULL)
delete zoomer;
zoomer
->setMousePattern
(QwtEventPattern::MouseSelect2,Qt
::RightButton, Qt
::ControlButton);
zoomer->setRubberBandPen(c);
zoomer->setTrackerPen(c);
QFont qf
=zoomer
->trackerFont
();
zoomer
->setTrackerFont
(QFont(qf.
family(),
18,qf.
weight(), qf.
italic()));
if (zoomer != NULL)
delete zoomer;
zoomer = new QwtPlotZoomer(qwtPlot->canvas());
zoomer->setMousePattern(QwtEventPattern::MouseSelect2,Qt::RightButton, Qt::ControlButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect3,Qt::RightButton);
const QColor c(Qt::white);
zoomer->setTrackerMode(QwtPicker::AlwaysOn);
zoomer->setRubberBandPen(c);
zoomer->setTrackerPen(c);
QFont qf=zoomer->trackerFont();
zoomer->setTrackerFont(QFont(qf.family(),18,qf.weight(), qf.italic()));
To copy to clipboard, switch view to plain text mode
Even if the code is compiled without errors or warnings the font size of tracker pen is not changed at all in the plot (the default size is 10)! The color instead is set properly.
Thank you in advance for your help!
Bye
Bookmarks