You are not logged in.

1

Monday, July 13th 2009, 6:25pm

Change button Icon on toggle

Hello, all;

I'm trying to program a QPushButton or QToolButton to change the icon being displayed when toggled/activated. Unfortunately, I'm on a shard system and unable to use QSetIcon or add it to the library. Any suggestions on how to proceed?

Thanks in advance,

Allan

2

Tuesday, July 14th 2009, 2:03am

There are some signals you can use and then set your icon in the slot when it gets activated:

QObject::connect(pToolButton, SIGNAL(pressed()), this, SLOT(ChangeIcon( )));

3

Tuesday, July 14th 2009, 2:03am

You can use "setStyleSheet".

4

Wednesday, July 15th 2009, 12:36am

Great, thanks for the input! I appreciate the assistance.