Convert from custom type to string

  • Hi. I'm register converter for my type, but in qml I get error: Error: Cannot assign QObject* to QString.

    QString convert( const IServer* srv )
    return srv->name();
    qmlRegisterUncreatableType<IServer>( "plugin", 1, 0, "IServer", "" );
    QMetaType::registerConverter<IServer*, QString>( convert );

    Is it possible convert my type to string in qml?

Log in to reply

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