115: error: 'class Qt3DCore::QAspectEngine' 'setData'



  • Hi guys,

    I am a new comer with Qt 5.7,and I have a problem with an error,maybe you can give me some suggestion.

    My error code as blow:

    View3D* view3D = new View3D;
    Qt3DCore::Quick::QQmlAspectEngine engine;
     engine.aspectEngine()->registerAspect( new Qt3DRender::QRenderAspect());
    engine.aspectEngine()->registerAspect( new Qt3DInput::QInputAspect());
    engine.aspectEngine()->registerAspect(new Qt3DLogic::QLogicAspect());
    
    
    QVariantMap data;
    data.insert( QStringLiteral( "surface" ), QVariant::fromValue( static_cast<QSurface*>( view3D ) ) );
    data.insert( QStringLiteral( "eventSource" ), QVariant::fromValue( view3D ) );
    
    engine.qmlEngine( )->rootContext( )->setContextProperty( "_settings", &m_settings );
    
     ***engine.aspectEngine()->setData(data);***
    
    engine.setSource( QUrl( "qrc:/qml/main.qml" ) );
    

    When we compile the project,that show the "engine.aspectEngine()_>setData(data) has an error,"115:28: error: 'class Qt3DCore::QAspectEngine' has no member named 'setData'".

    Thank you.

    Jin


  • Qt Champions 2016

    @Jinsuo said in 115: error: 'class Qt3DCore::QAspectEngine' 'setData':

    When we compile the project,that show the "engine.aspectEngine()_>setData(data) has an error,"115:28: error: 'class Qt3DCore::QAspectEngine' has no member named 'setData'".

    Yes, it doesn't have such a member.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.