I need to create a menu that changes the background of a QWidget. I'd like to place a QIcon that represents the selected color into the QActions which populates the QMenu. I'd like to not have to pop out Photoshop and paint the icons manually. Is it possible to program a simple icon that is filled with a certain color? This way I can have an arbitrary number of QActions if needed, and I won't have to make whole bunch of icons in Photoshop. \
You can construct a QIcon from a QPixmap. QPixmap can be constructed with a given size, then filled with a colour using 'fill'.
For example, to create a red 100x100 icon:
QPixmap pixmap(100,100);
pixmap.fill(QColor("red"));
QIcon redIcon(pixmap);