6

I need to change my Qt application's dock icon (in MacOS X) in run-time according to some conditions.

I've found several recipes on trolltech.com:

  1. QApplication::setIcon()
  2. setApplicationIcon()
  3. qt_mac_set_app_icon()

but none of it works: there is no such methods/functions in Qt 4.5.

How can I change my application's dock icon and what icon formats can I use?

Thank you.

Michael
  • 903
  • 1
  • 8
  • 16

1 Answers1

10

In Qt 4.5 the methods you are searching for are called

QApplication::setWindowIcon(const QIcon &)

or

QWidget::setWindowIcon(const QIcon &).

You can use every image format for icons that Qt supports (e.g. BMP, GIF, JPG, PNG, TIFF, XPM, ...).

Maybe you want to have a look at Qt's documentation at http://doc.qtsoftware.com/4.5/index.html or use the Qt Assistant.

Hope that helps you.

Elrohir
  • 1,456
  • 14
  • 12