I am new in Qt. I am trying to add texture to the example project "basicshapes", which comes from Qt Creator demo. It is written in C++ that'w perfect, because it is my need. There are used classes such as:
Qt3D::QTransform
Qt3D::QSphereMesh
Qt3D::QPhongMaterial
and many others but I can not realize how to add texture to it. There is a fragment:
Qt3D::QPhongMaterial *sphereMaterial = new Qt3D::QPhongMaterial();
sphereMaterial->setDiffuse(QColor(QRgb(0xa69929)));
so I was trying to add:
MyTextureImage *t = new MyTextureImage();
MyTextureProvider *x = new MyTextureProvider();
x->addTextureImage(t);
sphereMaterial->setTextureParameter("SphereTexture", x);
before I have derived from abstract classes:
class MyTextureProvider : public Qt3D::QAbstractTextureProvider { };
class MyTextureImage : public Qt3D::QAbstractTextureImage { };
but I got error:
error: C2259: 'MyTextureImage' : cannot instantiate abstract class
due to following members:
'Qt3D::QNode *Qt3D::QNode::doClone(void) const' : is abstract