Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPainterPath set operations deprecated in Qt 4.8
Forum Updated to NodeBB v4.3 + New Features

QPainterPath set operations deprecated in Qt 4.8

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 4.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xolve
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      If there is no statement about deprecating those, they will likely be changed into not using the painter path anymore, but don't take my word for it.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sigrid
        wrote on last edited by
        #3

        The set operations for QPolygonF and other similar classes are all deprecated too.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          That's a clear answer :)

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • X Offline
            X Offline
            xolve
            wrote on last edited by
            #5

            Thanks @sigrid.

            1 Reply Last reply
            0
            • X Offline
              X Offline
              xolve
              wrote on last edited by
              #6

              @Franzk I was hoping the same.

              1 Reply Last reply
              0
              • W Offline
                W Offline
                wstokes
                wrote on last edited by
                #7

                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:

                @
                QString text = "Sample string";

                QFont font;
                QFontMetricsF fontMetric(font);

                qreal textWidth = fontMetric.boundingRect(text).width();

                qreal circumfrance = 2PItextRadius;
                qreal textSweepAngle = (360.0 * textWidth) / circumfrance;

                QPainterPath path;
                path.addText(QPoint(0,0), scaledFont, text );

                //warp points around a circle
                for (int i=0; i<path.elementCount(); i++)
                {
                const QPainterPath::Element &e = path.elementAt(i);
                qreal theta = MathTools::correctAngle(-90 + textSweepAnglee.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]

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved