Open seshonaar opened 7 years ago
and the c++ part '''
struct DicomContext;
extern "C" { void test_ffi(); DicomContext create_context(); //QmlEngine get_engine(DicomContext); void run(DicomContext); }
int main(int argc, char argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); DicomContext context = create_context(); // here I need the engine back from rust...but I don't have it //QQmlApplicationEngine* engine = get_engine(context); //engine->addImageProvider(QLatin1String("dicom"), new DicomImageProvider); run(context); return 0; }
'''
Hi!
I'm currently trying to start from a standard Qt Creator project and delegate the "backend" to rust directly via ffi. But I still want to use c++ where the rust library doesn't have support yet (for example I need an QQuickImageProvider). I must say that I'm very close in achieving what I want, but I'm blocked by not having access to the native pointer of the QmlEngine. Do you think it would be possible to expose it to the external world, so it can be directly passed to c++? Just as some code reference I have now: I'm creating the engine in rust, pass it back to c++ in order to do some extra stuff with it (ex: attaching the image provider) and then pass it back to rust and call exec()