Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

With your own application you usually want to add your own icons. This is one simple way to add it using Qt’s RCC tool.

It was added the support for partial icon resource. It is implemented according Qt specification. First of all user should create not windows DLL but Qt RCC resource files. It can be compiled using rcc tool. User need to add special post build step to his QRC file, requires three steps to get icons available in the user interface.

Create the QRC file

A QRC file is a simple XML file that shows the location of the image files like below. Please see https://doc.qt.io/qt-5/resources.html for more details.

Code Block
<RCC>
    <qresource prefix="/images">
        <file>dark/icons/icon1.png</file>
        <file>dark/icons/icon2.png</file>
        <file>dark/icons/icon3.png</file>
        <file>light/icons/icon1.png</file>
        <file>light/icons/icon2.png</file>
        <file>light/icons/icon3.png</file>
    </qresource>
</RCC>

Compile the resource file

Compile the QRC file with the RCC tool such as

Code Block
languagepowershell
rcc -binary iconres.qrc -o iconres.rcc

Compiled Place the compiled .RCC file should be copied to into the custom icon location path from the profile settings. Then customer By default it is C:\Users\<user>\AppData\Roaming\ARES Commander Edition\<version>.

Setting icon for the User Interface

Now you need to change the application XML file with ui in the definitions section. We have special attribute “iconResource” for ui definitions. This attribute sets resource for iconsThere is the special attribute iconResource that you need to update. Also update the icon names as below.

Code Block
languagexml
<definition 
  darkIconName="RCDATA_16_3DCORBIT":/images/dark/icons/icon1.png"
  lightIconName="RCDATA_16_3DCORBIT:/images/light/icons/icon1.png" 
  ... iconRecource
  iconRecource="iconres.rcc" 
  ... 
  id="ID_3dcorbit" 
  name="Orbita continua 3D"
/>

So customer need to do these steps:

...

compile RCC resource file;

...

copy RCC file to custom icon location path. By default it is C:\Users\<user>\AppData\Roaming\ARES Commander Edition\<version>

...

You can also set the icon names and resource via CFx API.