Vertical QLabel, or the equivalent?

前端 未结 5 2200
执念已碎
执念已碎 2021-01-04 03:53

I want axis labels for a plot I\'m making, and naturally the y-axis label should be oriented vertically. I\'m pretty sure QwtPlot does this, but I\'m trying to

5条回答
  •  生来不讨喜
    2021-01-04 04:57

    There is no handy function in QLabel to do what you want, no. So:

    1. Use QGraphicsView, which allows you to transform items however you want.

    2. Use QPainter. Probably the easiest approach would be to draw the text rotated into a QPixmap, then set it on your QLabel.

提交回复
热议问题