QIcon has a notion of state, e.g. when requesting a pixmap from a QIcon one can ask it for a pixmap for an On state (like a depressed push button) or in an Off state.
Creating a state-aware QIcon is straightforward: Just call the QIcon::addPixmap() member function with a suitable combination of the mode and state arguments to compose the desired pixmaps into the QIcon.
When using Qt's theme mechanism, however, one creates the QIcon using the QIcon::fromTheme() static member function. The icons returned by this function are not state-aware. In fact, from the Qt sources I learnt that only the QIcon::Mode is applied on the fly, e.g. to gray out the icon for a Disabled mode.
So consider I create two distinct icons from the theme, onIcon and offIcon, how could I merge them into a single QIcon to cover the respective States?