Locked History Attachments

Tutorial_Add_an_icon_to_your_view

" How to add an icon to your view"

  1. Add a icon file to your bundle's resources directory.
  2. Add the following line to the view tag in the plugin.xml file of your bundle: icon="resources/your-icon.png"

It should look like this:

   1 <?xml version="1.0" encoding="UTF-8"?>
   2 <plugin>
   3   <extension point="org.opencherry.ui.views">
   4     <view id="org.mitk.views.your-view"
   5           name="your-view-name"
   6           class="::QmitkYourViewClass"
   7           icon="resources/your-icon.png"/>
   8   </extension>
   9 </plugin>
  1. Add the icon file name to the files.cmake of your bundle:

SET(RESOURCE_FILES
  resources/your-icon.png
  # additional resources
)

ATTENTION: Add it to the variable RESOURCE_FILES, not to RES_FILES

NOTE: You do not need to add the icon to a Qt Resource File (.qrc), if you don't want to reference it yourself via the Qt Resource System.

Re-Generate your project files with cmake, compile, start ExtApp. Your view should now have the icon in the menu bar and view title bar.