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. Migrating to qt5 QGraphicsItem problem
Qt 6.11 is out! See what's new in the release blog

Migrating to qt5 QGraphicsItem problem

Scheduled Pinned Locked Moved General and Desktop
5 Posts 5 Posters 5.2k 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.
  • A Offline
    A Offline
    Anticross
    wrote on last edited by
    #1

    I've got existing code with class based on abstract class which inhreits QGraphicsObject. In that class I call scale method with two parameters and setAcceptsHoverEvents method. When i change my qt 4.8.4 to qt 5.0.1 i've got following errors in debugger:

    @
    1>src\GraphArc.cpp(14): error C3861: 'setAcceptsHoverEvents': identifier not found
    1>src\GraphArc.cpp(16): error C3861: 'rotate': identifier not found
    1>src\GraphArc.cpp(17): error C2660: 'QGraphicsItem::scale' : function does not take 2 arguments
    @
    I also instaled qt5vs addin and convert project from qmake to qtaddin project and hit widgets chebox in Qt Modules.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      scarleton
      wrote on last edited by
      #2

      I am sure you found it, but in case someone else (like myself) runs into the problem of not finding setAcceptsHoverEvents(), the function has been deprecated, the new function is: setAcceptHoverEvents(). The simply dropped the s on Accept!

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Ph0t0n
        wrote on last edited by
        #3

        Also, rotate() was deprecated and changed to setRotation()

        R 1 Reply Last reply
        0
        • P Ph0t0n

          Also, rotate() was deprecated and changed to setRotation()

          R Offline
          R Offline
          rohit1729
          wrote on last edited by
          #4

          @ph0t0n error C2660: 'QGraphicsItem::scale' : function does not take 2 arguments, about this error?

          JonBJ 1 Reply Last reply
          0
          • R rohit1729

            @ph0t0n error C2660: 'QGraphicsItem::scale' : function does not take 2 arguments, about this error?

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @rohit1729
            https://doc.qt.io/archives/qt-4.8/qgraphicsitem.html#scale
            https://doc.qt.io/qt-5/qgraphicsitem.html#scale-1
            qreal QGraphicsItem::scale() const

            This function was introduced in Qt 4.6.

            No sign QGraphicsItem::scale ever accepted 2 arguments, unless maybe before 4.6. Which Qt version are you migrating from?

            1 Reply Last reply
            1

            • Login

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