Adding an icon to a button

Thanks very much everyone. I currently have it working with this in the CMakeLists.txt:

set(MODULE_PYTHON_RESOURCES
  Resources/Icons/${MODULE_NAME}.png
  Resources/Icons/SSFPIcon.png
  )

And this in my module Widget class:

    moduleDir = os.path.dirname(slicer.util.modulePath(self.__module__))
    SSFPIconPath = os.path.join(moduleDir, 'Resources/Icons', 'SSFPIcon.png')
    loadSSFPIcon = qt.QIcon(SSFPIconPath)
    self.LoadSSFPButton = qt.QPushButton(" Load SSFP Image Series")
    self.LoadSSFPButton.setIcon(loadSSFPIcon)
    self.layout.addWidget(self.LoadSSFPButton)
1 Like