WindowIcon not showing up despite being valid in resource (and used elsewhere) - qt

In my last question (Qt/C++: Icons not showing up when program is run) I asked how to get an icon to show up on a toolbar and was told I needed a Qt Resource, which I added and that fixed my problem, the icon did show up on the toolbar.
Now I'm trying to set the title icon of a window, using the same resource file, and it shows up fine in the Qt preview viewer but blank in the actual program. I am using a MainWindow which has an MDIArea and the children are MainWindows as well; neither the parent MDI nor child MDI windows icons will show properly. On the parent, I see the regular "Windows Application icon" and on the child, the icon is completely blank.
How can I solve this?

You will have to go through a standard resource file for windows. (That is, a .rc)
The process (as described in the documentation) is:
Store the ICO file in your application's source code directory, for
example, with the name myappico.ico. Then, create a text file called,
say, myapp.rc in which you put a single line of text:
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
Finally, assuming you are using qmake to generate your makefiles, add this line to your myapp.pro
file: RC_FILE = myapp.rc
Regenerate your makefile and your application. The .exe file will now be represented with your icon in Explorer.
In the Visual Studio case you're simply able to add a resource to your project.

Related

Unable to add an image in the storyboard editor in Visual Studio to create a splash screen for Xamarin.iOS

I'm trying to add a splash screen to an iOS app built using Xamarin.Forms. I'm able to get the splash screen itself to display, but I'm unable to add an image to an ImageView in the storyboard editor.
I can replicate this behavior in a brand-new "Cross Platform" solution, and I'm following the instructions here. Specifically, at step 10 in the instructions, you're supposed to be able to select the image from a dropdown.
If you actually click on the arrow of what only appears to be a dropdown, however, nothing actually "drops down"; instead VS opens an OpenFileDialog entitled "Add Existing Item".
No matter what file I choose, VS only adds it to the project's Resource folder (as a BundleResource), but doesn't change the image in the storyboard at all.
I've tried adding the images to the Asset Catalog as both a Launch Image and a regular Image Set. I've tried typing either a filename or an asset set name into the editable part of the "dropdown"; no luck. I've also tried editing the storyboard XML to add an image= attribute (to the ImageView tag), again using either a filename or an asset set name, but it doesn't work, and subsequent saves from the storyboard editor actually remove the attribute. I also tried explicitly adding the entire "Assets.xcassets" folder to the project, as suggested by one of the answers here.
FWIW, the property labeled "Highlighted", directly under "Image", also has the same behavior. I'm assuming this is a VS bug of some sort; the behavior of the property is different not only from what's described in the docs, but conflicts with the appearance of the control.
Has anyone come across a workaround?
Windows 10 Pro
VS 2017 15.8.3
Xamarin 4.11.0.756
Xamarin Designer 4.14.221
Xamarin.iOS and Xamarin.Mac SDK 11.14.0.13
It is bug, you can voite to this problem https://developercommunity.visualstudio.com/content/problem/319294/xamarinios-cant-select-image-asset-for-image-view.html

How to quickly open a resource file by hovering on the file name in the code

Suppose a Qt qmake project has a source with a following line of code:
loadTxt(":/libraryNotes.txt");
If I want to open the "libraryNotes.txt" files in the target's resources, I need to go the "Projects" tab, open the "Resources", and look for the file, then click and open it.
Is there any shortcut to do it directly from the code editor pane, when the mouse cursor or text cursor is over the filename? I'm thinking of a way similar to pressing F2 to follow the symbol to its declaration/definition.
Unfortunately, this doesn't seem to be supported in Qt Creator 3.2.2 at least. But it shouldn't be too hard to add, most of the support code is already there.

Windows form application - Icon image location?

I think this should be a relatively easy one to answer, I hope, but is proving to be a bit of a stress!
I have used an Icon on an old application developed some years ago and I would now like to use the icon for a current project.. however..
I added the icon using the upload/import icon-image in the properties window, and did not add it in the project resources file, nor specify its location anywhere in my code, using only the icon tool in the properties window.
Now wanting to find the icon image file to use again, I cannot find it anywhere! I have trawled through all the project files looking for the image file or a ref to its location, but have found nothing; except for:
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
When running the application the icon is still clearly visible in the applications taskbar tile.
Does anyone know where the icon file is stored / how I can retrieve it?
Thank you in advance.
It is stored in "{Your_project_name}.{Form_name}.resources" file. Search inside the "obj" folder which is in your project folder.
Now open the command prompt of Visual Studio. We will convert this ".resources" file into a ".resx" file. We use "resgen" command here.
resgen foo.resources bar.resx
The .resx can then be added to a C# project. You can find your icon file there.

Custom desktop icon with inno setup

I have the following in my inno setup file which creates a desktop icon no problem:
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
However, the main file that launches the program is a VBS file rather than an EXE. I'd like to have a nice icon on the shortcut rather than the VBScript one, but can't find an option to change the icon.
Is there such an option available to set a custom icon??
The Inno-Setup help about the [Icons] section says:
IconFilename
The filename of a custom icon (located on the user's
system) to be displayed. This can be an executable image (.exe, .dll)
containing icons or a .ico file. If this parameter is not specified or
is blank, Windows will use the file's default icon. This parameter can
include constants.
Example: IconFilename: "{app}\myicon.ico"
(source)
Hope that helps.
You pasted the [Task] entry whereas the [Icons] entry is what creates the actual icon.
For that, you want to install a custom icon file, and set the IconFilename (and optionally IconIndex) parameter.
Before you use Inno setup, change the .exe icon with windows platform. After you change it then use Inno, and your .exe file becomes the icon that you have changed before using Inno.
In other words: Inno setup uses default icon to launch as a .exe icon, so you can change the icon before use Inno. It works for me.

Is it possible to add custom icon to hta

Is it possible to add custom icon to hta? What I mean is change the default hta file icon, which is "System Application Icon". Can it be done without assigning new icon to the extension, and not using shortcuts to the file ?
Like this
WinRAR can help you do that.
Package your hta & icon file to exe;
In options,
a. select "silent" extract;
b. set extract path;
c. create extract path and then put that icon file there, select icon in this path.
d. set run your hta(c:\your_path\your.hta) after exe file extracted.
(i could not provide more detail because i don't have WinRAR installed right now, it's a common way to add icon for hta.)
Every time user run the exe you created, it will just extract hta, icon to the path you specified, and then run your hta. the exe file will have the icon display, even copy to another computer.
If you get all work done correctly, you will get a exe file with the icon you defined.
BTW, you can also try google: hta exe icon
Good luck!
Yup, you sure can: this. You embed the icon in the hta file
Better You use Exescript Software
It's Good because ease of its use and add icon to resource file (which appears on top border of hta)
After that add icon in settings menu to Exe File and build the project
U will get a exe file with custom icon.

Resources