error: ‘QVariant::QVariant(void*)’ is private inline QVariant(void *) Q_DECL_EQ_DELETE;
Solved
QML and Qt Quick
-
Hi all
I am trying to use C++ class in qml using setcontext property method, but when i try to build it it is giving the following error
/opt/Qt5.8.0/5.8/gcc_64/include/QtCore/qvariant.h:471: error: ‘QVariant::QVariant(void*)’ is private
inline QVariant(void *) Q_DECL_EQ_DELETE;what may be the issue for this? what changes i need to make ?
thanks
-
You are trying to convert a pointer to a
QVariant
. You'll have to useQVariant::fromValue()
to avoid implicit cast to bool and end up usingQVariant(bool)
.T *ptr = ...; QVariant v1 = ptr; // not ok QVariant v2 = QVariant::fromValue(ptr); // ok