December 1, 2010

phil_s_stein phil_s_stein
Lab Rat
1 posts

Resources from promoted widgets do not appear in main application (designer question)

 

Hello,

I’ve got two ui’s in my project, a main window, with a simple menu and a placeholder QWidget. I’ve promoted the QWidget placeholder to my derived QWidget class and load it correctly in the main. The custom widget is a collection of standard widgets (buttons, etc). (I do have to manually connect a few signals/slots, but that’s not a problem). When I run the application, the custom widget shows up correctly in the placeholder’s location and all the buttons, etc work correctly. The only issue I’m having is that the button icons on the derived QWidget do not show up. I’ve added the resources that contain the icons to both forms in designer. When I’m editing the derived widget’s UI, the icons show up correctly. But they do not show up when the main app is run.

Any thoughts? I don’t mind loading them by hand, I guess, but it seems like I should be able to load them directly into the binary like standard resources.

Thanks for any responses.

3 replies

December 1, 2010

Volker Volker
Ant Farmer
5428 posts

There should be a resource file (.qrc) created with Designer. Did you add this to your application (RESOURCES variable in your .pro file)?

December 1, 2010

phil_s_stein phil_s_stein
Lab Rat
1 posts

Ha! That was it – you’re a genius! Thanks. I can’t believe I missed that. :)

December 1, 2010

Volker Volker
Ant Farmer
5428 posts

uhm… too much glory for that little hint – but thanks, anyway :-)

 
  ‹‹ ActiveRecord in Qt      QTest - How to i using it on UI objects?? ››

You must log in to post a reply. Not a member yet? Register here!