Nominate our 2022 Qt Champions!

Can't add resource files. Get an error.

  • I am trying to figure out how to add resources to my project. If I right click my project and choose Add New... > Qt > Qt Resource File, I can type out the name, but it says some error at the bottom:

    If I go ahead and press Finish, it comes up with an error box that says the same thing. I see in the directory on my actual computer that it has successfully created the folder even so, but I don't get the folder in my project.

    What do? :(

  • Hi, and welcome to DevNet,

    it's difficult to read but it seems, there's a problem in your filename.
    Try to use a filename without any special characters - if you don't succeed, post the filename here.

  • The file name I was trying to make was someResourceThing. It has no special characters in it. You can see where "someResourceThing" is in the error.

  • Lifetime Qt Champion


    Is that file in a subfolder of your application ?

  • It doesn't exist prior to me trying to create it from within Qt, but it does get created despite the error. The directory is the same one that has my .cpp and .h and .pro files in it.

    The same thing happens when I try to create a new .cpp file this way. In order to even get a new .cpp or .h file, I have to manually create it a .txt file in the directory, rename it to whatever.cpp, then from within Qt add it as an existing file. That's how I've been doing it for a while now.

    Would be nice to get the Add New... feature to work though.

  • Lifetime Qt Champion

    Can you retry that after moving your project in a path without spaces ?

  • Can you please show:

    • your .pro file
    • the input you gave in the "New Qt Resource file" dialog

Log in to reply