54 Public method to initialize a colour selection button. |
54 Public method to initialize a colour selection button. |
55 |
55 |
56 @param colourKey key of the colour resource (string) |
56 @param colourKey key of the colour resource (string) |
57 @param button reference to a button to show the colour on (QPushButton) |
57 @param button reference to a button to show the colour on (QPushButton) |
58 @param prefMethod preferences method to get the colour |
58 @param prefMethod preferences method to get the colour |
59 @keyparam byName flag indicating to retrieve/save by colour name |
59 @param byName flag indicating to retrieve/save by colour name |
60 (boolean) |
60 (boolean) |
61 @keyparam hasAlpha flag indicating to allow alpha channel (boolean) |
61 @param hasAlpha flag indicating to allow alpha channel (boolean) |
62 """ |
62 """ |
63 colour = QColor(prefMethod(colourKey)) |
63 colour = QColor(prefMethod(colourKey)) |
64 size = button.size() |
64 size = button.size() |
65 pm = QPixmap(size.width() / 2, size.height() / 2) |
65 pm = QPixmap(size.width() / 2, size.height() / 2) |
66 pm.fill(colour) |
66 pm.fill(colour) |