Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
What about Property animation with GraphicsItem
class myTextItem: public QObject, public QGraphicsTextItem
Q_PROPERTY(QPointF newPos READ pos WRITE setPos)
Q_PROPERTY(qreal textWidth READ textWidth WRITE setTextWidth)
4x 'QObject' is an ambiguous base of 'myTextItem'
P.S.1 i think it posible only 4.8
have any ideas?
The animation framework is still valid, and it works in exactly the same way in Qt 5, as it did in Qt 4.
In this case, instead of subclassing QObject, you can use QVariantAnimation class to animate your properties.
[quote author="sierdzio" date="1411976308"]The animation framework is still valid, and it works in exactly the same way in Qt 5, as it did in Qt 4.
In this case, instead of subclassing QObject, you can use QVariantAnimation class to animate your properties.[/quote]
you offer subclassing of QVariantAnimation?
only "public: QGraphicsTextItem"
and in main instead QPropertyAnimation use QVariantAnimation?
=D in first case i still get ‘QObject’ is an ambiguous base of ‘myTextItem’
but now 2x
I propose to go with the second option: only inherit from QGraphicsTextItem.
if only “public: QGraphicsTextItem”
and use macro Q_OBJECT
clean - rebuild
Do not use Q_OBJECT macro in there. Variant animation does not need it. Remove Q_PROPERTY macros, too.
wherefore QVariantAnimation better?
if add that macro i can use QPropertyAnimation (i think it simple for use
and more flexibly if use property)
but i newbie and i wait you answer =)
QPropertyAnimation class, Q_OBJECT and Q_PROPERTY macros are reserved for QObjects. If it works for you without a QObject, well, I am surprised - it shouldn't, but you can probably leave it as it is.