Qt 6.11 is out! See what's new in the release
blog
Can I add padding to a QwtText object?
-
I am adding a
QwtPlotMarkerto aQwtPlotusing 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
thispoints to aQwtPlotobject.With the code above I'm getting the following result:
Note that in the image the letter
Vfrom 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.2andQwt 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.

