Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    2
    2
    334
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      FrankE last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • Chris Kawa
        Chris Kawa Moderators last edited by Chris Kawa

        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.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post