csteury
16th January 2015, 21:33
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.
10888
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
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???
}
10888
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
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???
}