QPainterPath set operations deprecated in Qt 4.8
From this blog post about Qt 4.8
http://labs.qt.nokia.com/2011/05/12/qt-modules-maturity-level-the-list/
It says that QPainterPath set operations are deprecated from now on. So what does this say about set operations on QPolygonF and other similar classes. I read their code and found that they used to use QPainterPath for implementing these methods.
6 replies
Hrmm, I just noticed these were being deprecated. I’m going to really miss QPainterPath::setElementPositionAt. I use it to warp text to a curve. For example:
- QFont font;
- qreal textWidth = fontMetric.boundingRect(text).width();
- qreal circumfrance = 2*PI*textRadius;
- qreal textSweepAngle = (360.0 * textWidth) / circumfrance;
- QPainterPath path;
- //warp points around a circle
- for (int i=0; i<path.elementCount(); i++)
- {
- qreal theta = MathTools::correctAngle(-90 + textSweepAngle*e.x / textWidth;
- qreal r = textRadius - e.y;
- path.setElementPositionAt(i, r*cos(theta), r*sin(theta));
- }
If QPainterPath::setelementPositionAt is going to be removed, won’t it be impossible to warp text around a curve in Qt5?
[EDIT: code formatting, please wrap in @-tags, Volker]
You must log in to post a reply. Not a member yet? Register here!


