[Interest] how to programmatically create QIcon for use with QToolButton?

Hamish Moffatt hamish at risingsoftware.com
Tue Sep 24 10:13:52 CEST 2019


On 24/9/19 3:23 pm, David M. Cotter wrote:
>
> Does |QToolButton| use the normal / selected / disabled states of a 
> |QIcon| that is programmatically created from |QPixmaps|? ie: when the 
> user clicks in the |QToolButton|, shouldn't it show the "selected" 
> icon variant? and when the window is deactivated, shouldn't it show 
> the "disabled" state?
>
> I can't for the life of me get the "selected" (pressed?) or "disabled" 
> states to draw.
>
> for the code i'm using see this forum post:
> https://forum.qt.io/topic/107143/how-to-programmatically-create-qicon-for-use-with-qtoolbutton


Which style are you using? I had some problems with the Fusion style 
doing its own thing with my icons. I used a QProxyStyle derivative to 
stop it doing that.


Hamish

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190924/419dac92/attachment.html>


More information about the Interest mailing list