qt-interest@trolltech.com
[Top] [All Lists]

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

Subject: Re: [Qt-interest] QPushButton - remain down...
From: BRM
Date: Tue, 2 Mar 2010 09:28:34 -0800 PST
----- Original Message ----

> On Mar 2, 2010, at 9:32 AM, 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?
> I'm pretty sure you can make it checkable (setCheckable(true)) to do what you 
> want. Not necessarily intuitive...

Thanks - that did it.
 
----- Original Message ----
> From: Robert Hairgrove 
<evorgriahr@xxxxxxxxxx>
> 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).
> Did you look at the QToolButton 
class yet?

Yes I did.

When I was originally reading through all of it there were several things that 
popped out to me:

- QPushButton documentation mentions:"If you need toggle behavior (see 
setCheckable()) or a button that auto-repeats the activation signal when being 
pushed down like the arrows in a scroll bar (see setAutoRepeat()), a command 
button is probably not what you want. When in doubt, use a tool button."
- QPushButton does not generate the setChecked() signal, only QCheckBox does.
- QToolButton seemed not to do what I wanted; though the above probably applies 
to it as well.

So as Brad said - it's not intuitive on how to do this.

Thanks all!

Ben

_______________________________________________
Qt-interest mailing list
Qt-interest@xxxxxxxxxxxxx
http://lists.trolltech.com/mailman/listinfo/qt-interest

<Prev in Thread] Current Thread [Next in Thread>