Advice about deploying with extra files
I’m looking for a little advise as I seem to have confused myself a little.
I’m deploying a Windows application and I have put a picture as a background. I’ve done this using QPalette -> set Brush -> QImage then the file name of the picture. In the installer program I can specify where I want the picture to be so that the Qt program can find it.
My problem is where should I put it, I tried putting in the ‘pictures’ folder as I could use QDesktopservices:: folder location to find the file in the pictures folder… but then multiple users of the computer can use the program but then not have access to the picture.
I’m obviously doing this wrong, could someone give me a pointer as to the correct way to do this.
Are you using Qt for Desktop?
Then the resource editor is your friend. This link shows how you can add files like images to your project.
Thanks for the pointer, I think I’m close. I now have a resource file and I can set the style sheet to reference that so now, when I look in Qt Creator and select the form, I can see the image as the background. However, if I run the program I just get the normal grey background. I’ve tried rebuilding and cleaning etc but still just the grey background.
What step have I missed?
in Qt Creator, right clicked on project, add new, Qt Resource file, chose name, added to project. Then chose prefix and added file. Save.
Open the form – selected main window, on right menu, property -> style sheet.
In the edit style sheet, add resource, and then background-image: url(:/new/prefix1/IMAGE.jpg);
Now the form has the wonderful IMAGE as the background, until I hit build… then it doesnt.
i’m on Qt Creator 2.2 Based on Qt 4.7.4 (64 bit)
you could search bug tracker to see if there is ann issue. obviously it’s resolved in my later version.
“use this link :http://developer.qt.nokia.com/contribute
Unfortunately nothing, it seems the header file is overwriting any changes I make to the ui form. for example if I edit the ui header file and change the window title… then it changes. I’ve tried copying to a new file but I get a hundred odd error messages saying:
“invalid use of incomplete type ‘struct Ui::MYPROJECT’”
forward declaration of ‘struct Ui::MYPROJECT’
am just about getting ready to throw my computer out of the window