Hello, I have created a label for a QwtPlotMarker. The vertical line is near the right edge of the plot and is truncated by the right edge of the plot/canvas.
Attenuation-Dialog.JPG
How can I make the plot take into account the label and make the plot a bit bigger? Struggling along I tried this:
m_wa_marker->setItemAttribute(QwtPlotItem::Margins, true); // more space???
Thanks in advance for your suggestions (btw - great library!)
cs
void emat_attenuation_plot::set_wa_sample(double sample)
{
text.setColor(Qt::blue);
text.
setFont(QFont("Helvetica",
10,
QFont::Bold));
m_wa_marker->setLabel(text);
m_wa_marker->setValue(sample, 0.0);
m_wa_marker
->setItemAttribute
(QwtPlotItem::Margins,
true);
// more space???}
QwtPlotMarker *m_wa_marker;
void emat_attenuation_plot::set_wa_sample(double sample)
{
QString label = QString("WA: %1").arg(sample, 0, 'f', 1);
QwtText text(label);
text.setColor(Qt::blue);
text.setFont(QFont("Helvetica", 10, QFont::Bold));
m_wa_marker->setLabel(text);
m_wa_marker->setValue(sample, 0.0);
m_wa_marker->setItemAttribute(QwtPlotItem::Margins, true); // more space???
}
To copy to clipboard, switch view to plain text mode
Bookmarks