[Qt-interest] QPushButton - remain down...

BRM bm_witness at yahoo.com
Tue Mar 2 19:22:46 CET 2010


Yes, I set the 'setCheckable()'. The normal 'clicked()' signal does tell whether it is checked/unchecked.
Oddly, the QPushButton, QCheckBox, and QToolButton use different signals to generate the same information...

QToolButton is kind of understandable - it's signals with an action; but clicked() versus stateChanged() could probably be reduced.

Ben

----- Original Message ----

> From: Dan White <ygor at comcast.net>
> To: BRM <bm_witness at yahoo.com>
> Cc: qt-interest <qt-interest at trolltech.com>
> Sent: Tue, March 2, 2010 12:56:01 PM
> Subject: Re: [Qt-interest] QPushButton - remain down...
> Did you try using the setCheckable() method on a QPushButton ?
> Or make your own subclass that toggles a binary state each time it is pressed.
> ----- BRM wrote:
> > I have a series of items I am putting into a QToolBar so the user can select 
> them during run.
> > Presently I am using the QCheckBox, but it takes up a lot of room.
> > Preferably, I'd like to have a QPushButton kind of widget that has two states: 
> Up and Down.
> > Looking through the documentation, I did notice that QPushButton has those 
> states, but it does not seem to remain in those states.
> > 
> > Am I missing something to enable this?
> > Or am I going to need to subclass?
> > 
> > Note: I'm presently using Qt 4.5 (4.5.1, 4.5.2).
> > 
> > TIA,
> > 
> > Ben
> > 
> > 
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest





More information about the Qt-interest-old mailing list