With Qwt, I want that the time and the date are both center under the stick under a bottom axis, but the time is still on the left side like in this picture :
Capture.jpg
I have tried to use
QwtDateScaleDraw::setLabelAlignment(Qt::AlignHCenter|Qt::AlignBottom);
QwtDateScaleDraw::setLabelAlignment(Qt::AlignHCenter|Qt::AlignBottom);
To copy to clipboard, switch view to plain text mode
But the time is still on the left.
I have tried to subclass the QwtScaleDraw like this:
class MyDateScaleDraw:public QwtDateScaleDraw
{
public:
QwtText label
(double value
) const override
{
QwtText txt
=QwtDateScaleDraw
::label(value
);
txt.setRenderFlags(Qt::AlignHCenter);
return txt;
}
};
class MyDateScaleDraw:public QwtDateScaleDraw
{
public:
QwtText label(double value) const override
{
QwtText txt=QwtDateScaleDraw::label(value);
txt.setRenderFlags(Qt::AlignHCenter);
return txt;
}
};
To copy to clipboard, switch view to plain text mode
But the time is still on the left side.
Somebody know how to center the time ?
Bookmarks