Important: Please read the Qt Code of Conduct -

ProgressBar appearance change after deploying application

  • Hi,
    my QProgressBar changes appearance after I deploy my application (By deploying I mean copying all necessary dlls and .exe file to some other PC).

    In Qt Creator:

    After Deploy:

    I have an empty qt.conf file next to my .exe file and copy some DLLs ( /platforms/qwindows.dll ) to the folder of my executable.
    I assume that I am missing some theme or DLL to achieve what I want.
    What do I need to deploy with my .exe to get the "green progressbar" ?

  • Lifetime Qt Champion


    Did you already use windeployqt ?

  • Hi,
    no I did not use windeployqt ( I didn't know what this is tbh). A quick google search showed me the documentation which raises a question: Can I use this with CMake?

  • Moderators

    @amazonasmann as it is a standalone console application and you pass the finished executable as a parameter, I see no reason why the original build system should matter

  • Thank you @SGaist I found my solution. I used windeployqt to copy all necessary DLLs and as it turns out I was missing the "styles/qwindowsvistastyle.dll" (This is just a guess but most probably this is the case).

    In CMake I added the following:

    # Retrieve the absolute path to qmake and then use that path to find
    # the binaries
    get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
    get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
    find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
    add_custom_command(TARGET MyApp POST_BUILD
            env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
        COMMENT "Running windeployqt..."

    Which adds all necessary dependencies to the folder.

  • @amazonasmann said in ProgressBar appearance change after deploying application:

    I found my solution

    Great. If your issue is really solved, please don't forget to mark your post as such! Thanks

Log in to reply