Platform windows fail but ONLY if I associate a file format.



  • I've made a simply app that works ok, can be deployed to other computers since the folder structure is ok I mean /platforms/
    /plugins/
    etc

    What's the problem then? that I need to associate a file format to this app, and as soon as I double click on that file the app tries to be open but the wellknown error appears:

    • This application failed to start because it could not find or load the Qt platform plugin "windows".
      Reinstalling the application may fix this problem.

    I've tried to pre-load everything but without any luck:

        CoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());
        QDir::setCurrent(QCoreApplication::applicationDirPath());
        QCoreApplication::addLibraryPath("./");
        QString sDir = QCoreApplication::applicationDirPath();
        QCoreApplication::addLibraryPath(sDir);
        QCoreApplication::addLibraryPath(sDir+"/plugins/");
        QCoreApplication::addLibraryPath(sDir+"/platforms/");
    

    Thank you in advance any tip is welcome!


  • Moderators

    How do you associate the app with the format? What's the resulting structure in the registry for it?
    Put in your deployment directory file named qt.conf with following content and see if it works:

    [Paths]
    Plugins = .
    

    This will make the app looking for plugins (including "platforms" folder) in the app directory instead of working directory.


Log in to reply
 

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