Unity Launcher icon not being set by Qt application - qt

I'm trying to get my Qt application to display an icon in the Unity Launcher but it's not working. In code, I'm simply using:
qApp->setWindowIcon(QIcon("path/to/icon.png"));
but it's not doing anything. I've also tried setting the icon directly on the main window but it doesn't help either.
Any idea what could be the issue?
PS: I've checked the icon path and it is correct.

Without knowing the details of unity, I'm pretty sure that you'll have to create and install a .desktop file with the icon in it. See for example here. Whatever you set at runtime, the launcher cannot know about before starting the application, so it will need the information from an external configuration.

To enable picture encoding in Windows(not in Ubuntu) I've put the QT\4.8.3\plugins\imageformats folder near my app.
I think You should try the same.

Related

TestApplication with Qt5.9 and embedded linux on Raspberry Pi 3

Setting up Qt5.9 on my RaspberryPi3 with raspbian-lite version of image.
Next compile test application qtbase/examples/opengl/qopenglwidget
With run I can see next message
QFontDatabase: Cannot find font directory /usr/local/qt5pi/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.
Application was running, but there is no any text.
I want to use standard fonts, but I don't now how I can do it.
OR, How to use FREE-Types from http://dejavu-fonts.org.
Please help me, somebody
I found right answer. It was very simple:
You must add any font (*.ttf) in-to directory /usr/local/qt5pi/lib/fonts on raspberryPi. For example, I use free fonts from
http://dejavu-fonts.org.

Is it possible to set icon for a custom file used by my app

I would like to create and app using Qt which will use custom files. The app will be available on Windows, OS X and Linux.
The idea is to have a custom icon for my file type (e.g. when you install Adobe's Master Collection, .as, .fla, .ps, etc. files have they own icons).
As far as I know Qt only helps you with app icon. I did not find any kind of support for this kind of problem.
This seems to be an OS problem. Do I need to create scripts to run on app install? (I will be using Bitrock's install builder to provide installers)
How can I achive this behaviour on all OSs?

Flex Builder 4 mobile modifying app properties

I am building an app in Flex Builder 4 (iOS and Android) and have my app worked almost to completion and about ready for deployment. Unfortunately, I cannot find how to change the app icon and title for the system to read, so my app still shows up as Main with the default package symbol in the launcher. Does anyone know where to apply changes to these properties?
You need to edit these details in the .xml file for your project. It will be located in the root of your src folder and will be named something like MyProject-app.xml. Double click this, there you can edit the filename, version number, icon, etc.
NOTE: the default view is Design, i found it much easier to edit in the Source view.

QT/C++ on MAC - Application Icon doesn't set

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>));

Enable Icons ADL

I can't seem to work out how to enable icons in the AIR Debug Launcher. This seems to work on Linux, but when I run it on Windows or Mac only the Adobe AIR icon shows. I have specified the location of the icon in <icon></icon> in the application descriptor file.
Those icons are created from the file references in the application descriptor file when the application installs itself so you won't really be able to see them during development.
There is a solution available on Christian Cantrell's Adobe blog that works around this though the instructions are from February 2008. This may or may not work with the latest Flex SDK or Flex/Flash Builder IDE.
Fortunately, I’ve found an easy way to make this work. Here’s what you do:
Make a copy of your application icon and name it something different. One version should be referenced by your application descriptor file, and the other will be compiled into your application. (You don’t technically have to make a copy of the icon, but when generating a release build of your application, Flex Builder doesn’t copy over embedded resources which means your application icon will be missing. Trust me when I tell you that it’s easier to create a copy and avoid this whole issue.)
Compile the copy of your application icon into your application using code like this:
[Embed(source="assets/application.png")] public var appIconClass:Class;
In your application’s initialization code, create a Bitmap instance of your icon like this:
var appIcon:Bitmap = new appIconClass();
Set your icon like this:
InteractiveIcon(NativeApplication.nativeApplication.icon).bitmaps = [appIcon];
This code is a little oversimplified because it doesn’t take platform differences into account. A more complete implementation might do something like this:
Check to see what kinds of icons the client supports. You can do this with the NativeApplication.supportsDockIcon and NativeApplication.supportsSystemTrayIcon APIs.
Scale the Bitmap to the appropriate dimensions for the platform.
Set the icon(s) using the NativeApplication’s icon property.

Resources