Solved Migrating Qt 4.8 to Qt 5.8, QtDeclarative
-
I'm porting a Qt 4.8 project to Qt 5.8, I've been using:
https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5
I am not getting:
C1083: Cannot open include file: 'QDeclarativeItem': No such file or directory
C2678: binary '+': no operator found which takes a left-hand operand of type 'QUuid' (or there is no acceptable conversion)I don't believe the two are related, but any help is greatly appreciated.
-
@SPlatten I think it should be
inline QString id() const { return faultID().toString() + m_location; } inline QUuid faultID() const { return m_faultID; }
-
@SPlatten As explained here: https://doc.qt.io/qt-5/qtquick-porting-qt5.html
replace QDeclarativeItem with QQuickItem.Regarding second error: please post the code where it happens.
-
@jsulm , thank you.
The C2678 is in a file called activefaultitem.h on the line:
inline QString id() const { return faultID() + m_location; } // <- This is the highlighted error inline QUuid faultID() const { return m_faultID.toString(); } QUuid m_faultID; QString m_location;
-
@SPlatten said in Migrating Qt 4.8 to Qt 5.8, QtDeclarative:
faultID()
I guess this returns a QUuid?
Change it toinline QString id() const { return faultID() + QUuid(m_location); }
-
The same error is reported on the same line. Is it actually because the return type is a QString an the faultID() does not return a QString?
-
@SPlatten I think it should be
inline QString id() const { return faultID().toString() + m_location; } inline QUuid faultID() const { return m_faultID; }