Important: Please read the Qt Code of Conduct -

Embed icon into UI

  • Hey everyone,

    I've created a couple of actions and added icons to them and added the actions to a toolbar. When I load the UI everything works fine. However, when I move the icon files to a different directory, they're no longer displayed in the UI. It seems as though Qt Designer requires that the icons always be in the same directory so it has a reference to them.

    How can I sort of embed icons into an UI so that I can move or delete them as I like after I've finished creating the UI?

    Any help is greatly appreciated!

    Kind regards,


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Take a look at the Qt Resources System

  • Thanks for your reply. I've just had a look at the link and now I see how relative file paths are handled in Qt.

    The situation is as follows: I'd like to create a .ui file with Qt Designer which I can later use as the UI of a Python program. Now, I'm struggling with the creation of the resources file. I've got Qt Designer open now and I can see the actions editor in the bottom right corner and the "resources" tab right next to it. However, if I click on "resources", I can only select an existing resource file but not create a new one.

    Any ideas?

    Kind regards,


  • Qt Champions 2019

    @logithack "File/New File or Project/Files and Classes/Qt/Qt Ressource File"

Log in to reply