Can I add padding to a QwtText object?
Unsolved
General and Desktop
-
I am adding a
QwtPlotMarker
to aQwtPlot
using the following code:QwtPlotMarker *tooltip = new QwtPlotMarker(tr("Tooltip")); QwtText label("02/01/17\n06:00:00\nVoltage: 4.02"); QColor blue(QColor(30, 140, 220)); label.setColor(blue); label.setBorderPen(QPen(blue, 1)); label.setBorderRadius(5); label.setBackgroundBrush(QColor(65, 177, 225, 50)); QFont font("MS Shell Dlg 2", 8); label.setFont(font); tooltip->setLabel(label); tooltip->setLabelAlignment(Qt::AlignCenter | Qt::AlignTop); tooltip->attach(this); this->replot();
where
this
points to aQwtPlot
object.With the code above I'm getting the following result:
Note that in the image the letter
V
from the Voltage is overlapped by the border.Is it possible to add padding to the
QwtText
(or maybe to theQwtPlotMarker
!?), so I can get a result like the following one?I'm using
Qt 5.3.2
andQwt 6.1.0
. -
@KelvinSP said in Can I add padding to a QwtText object?:
Qwt has its own forum. and mailing list.
I would rather seek for advice there.