I've migrated (not copied and pasted) an app to C++Builder 11.2. It uses an embedded .wav file that's referenced from an .rc resource file.
Here's the problem: The app's icon becomes a default Windows image (not a default C++Buider image) when the .rc file is part of the project. But the icon is normal when the .rc file is removed from the project. This happens with both a 32-bit and 64-bit compile.
So, I can have either the correct icon or the sound, but not both. Is there a fix or workaround for this problem?
Related
I have a Xamarin.Forms class library project that I refer to in a Xamarin.Forms application project. In the iOS project of the class library, I have included a png image in the Resources folder and set its "Build Action" to BundleResource.
When I try to load this image file in the library project using the below code, I get null value.
string imagePath = NSBundle.MainBundle.PathForResource("ImageFileName", "png");
I had also tried setting the "Copy To Output" property of the image file to all available values (Do not copy, Copy always, Copy if newer). No matter which value is set, the path is returned as null.
I am using the iOS 15.0 simulator. I navigated to the bundle location of the application in the simulator's location in the Mac. I could not see the image file in the application bundle.
Is there any solution to this problem?
I am using external css to theme my GTK3 application (on windows 7, 64bits)
also I am using xml file that describes all the widgets in the application
both of these two files (.css & .xml) are used during runtime of my application (.exe)
my question: how to compile my application so that it will no longer depend on the css and xml files ?
Put the files inside a GResource and compile them directly into your program.
The documentation explains it well enough, but basically you generate a resource.c and resource.h file during your build process, that encode the external files. Then you compile those files into your program, and they will be available through a URI such as resource:///com/example/yourprogram/yourwidgets.xml.
So, I made a Qt application on Qt Creator that displays jpg files and mp3 files(using phonon).
On deploying the application with dynamic linked libraries I had to copy to the same folder QtCore4.dll, QtGui4.dll, phonon4.dll, mingwm10.dll and libgcc_s_dw2-1.dll as required by Windows.
The problem is that the jpg files and mp3 files are only shown on pcs with the QtSDK installed. In other pcs the exe file runs, opens the user interface and does everything right except showing jpg and mp3 files. The directory path is not the problem because it opens a pdfviewer that I put in the same folder. Do I need to provide other files?
Qt relies on plugins for most of the file formats. For Jpeg you will need to include the qjpeg4.dll found in the plugins/imageformats directory. For Phonon, you will also need to include the appropriate backend DLL found in the plugins/phonon_backend directory.
All the information you need is contained within the Qt documentation on Deploying an Application on Windows and especially the section on Qt Plugins.
So, we have an embedded Linux system running Qt and we compile all of our icons (.png format) into our executable using the resource file. The problem is that I want to be able to use the Qt Creator QML Designer to visually see our screens as we are laying them out, but it only allows me to select a relative file system path (i.e. not a path to the resource). If I go to edit mode and put the qrc:/image.png it works in run time but the image doesn't show up in the QML Design mode. Has anyone ever done this or know if it is possible?
There is at least a workaround:
Put everything in the resource file (the qml files and the icons), and when you'll edit the file in Qt Quick Designer, all paths will be relative so the icons will be visible.
Everything is described there: Managing resource files with the Qt resource system
And to avoid deploying the qml files, you'll have to remove/comment the following line from your .pro:
DEPLOYMENTFOLDERS = folder_01
and replace it with:
OTHER_FILES = <list of qml files>
Weird problem I'm struggling with. On the same folder as my "*.pro" QT project file I have a Resources/myIcon.png.
I am trying to set that as the Icon for my built application, running on OSX. I read the documentation and it suggests to put a "ICON = " in the .pro file. I did that, but for some reason, the icon IS copied over the the resources folder inside my app's content, but the .pfile's icon field remains empty. Even when I change it manually to "resources/myIcon.png" it will not work.
What am I doing wrong?
Manually delete the generated app bundle. Run QMake followed by Rebuild All is not sufficient!
Don't set the full pathname within the application bundle for the icon file in the Info.plist. Just set the filename. Mac OS knows to look in AppName.app/Contents/Resources for it.
And yes, it must be an ICNS file as far as I'm aware. You can use the 'Icon Composer' utility that is part of the Mac OS development tools to create an .icns from a .png.
Are you referring to the icon which appears in the dock? I added a .ico to my application's resource file, then set it as my icon with the following call
QApplication::qApp()->setWindowIcon(QIcon(<resource path>));