Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Migrating to qt5 QGraphicsItem problem
Anticross last edited by
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.
scarleton last edited by
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!
Ph0t0n last edited by
Also, rotate() was deprecated and changed to setRotation()
rohit1729 last edited by
@ph0t0n error C2660: 'QGraphicsItem::scale' : function does not take 2 arguments, about this error?
JonB last edited by JonB
qreal QGraphicsItem::scale() const
This function was introduced in Qt 4.6.
QGraphicsItem::scaleever accepted 2 arguments, unless maybe before 4.6. Which Qt version are you migrating from?