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

Qt Code:
  1. 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:

Qt Code:
  1. class MyDateScaleDraw:public QwtDateScaleDraw
  2. {
  3. public:
  4. QwtText label(double value) const override
  5. {
  6. QwtText txt=QwtDateScaleDraw::label(value);
  7. txt.setRenderFlags(Qt::AlignHCenter);
  8. return txt;
  9. }
  10. };
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 ?