Qt-interest Archive, April 2007
difference between qtoolbutton and qpushbutton
Message 1 in thread
hi, all
what's the difference between QToolButton and QPushButton? i just want to
add a few buttons to my toolbar.
or both are ok?
regards
fengli
Message 2 in thread
Generally, QToolButton is the button you will want in toolbar. Main
difference is the signals.
QPushbutton send just a simple clicked(), while QToolButton sends
triggered(QAction*), which allows you to set up one universal slot to
receive actions from all toolbuttons/menus/etc and then handle it as
necessary
Also, if you set keyboard shourtcut in the QAction by
QAction::setShortcut, they should work without any extra programming
on your side
Martin Petricek
On 4/23/07, 张凤丽 <zhangfenglisdu@xxxxxxxxx> wrote:
> hi, all
> what's the difference between QToolButton and QPushButton? i just want to
> add a few buttons to my toolbar.
> or both are ok?
> regards
> fengli
>
N?叉??z千u??h?У贽糙蕺绗囤?[^r(??殪够??{az??-⒒ay?雀????wb?+?b?m??+-糙?[^r(??{^?-
Message 3 in thread
hi,
why nothing?
fengli
2007/4/23, 张凤丽 <zhangfenglisdu@xxxxxxxxx>:
>
> hi, all
> what's the difference between QToolButton and QPushButton? i just want to
> add a few buttons to my toolbar.
> or both are ok?
> regards
> fengli
>
Message 4 in thread
because it seams you didn't read the doc before posting this question....
The push button <http://doc.trolltech.com/4.3/qpushbutton.html>, or
command button, is perhaps the most commonly used widget in any
graphical user interface. Push (click) a button to command the computer
to perform some action, or to answer a question. Typical buttons are OK,
Apply, Cancel, Close, Yes, No and Help.
A tool button <http://doc.trolltech.com/4.3/qtoolbutton.html> is a
special button that provides quick-access to specific commands or
options. As opposed to a normal command button, a tool button usually
doesn't show a text label, but shows an icon instead.
张凤丽 a écrit:
> hi,
> why nothing?
> fengli
>
> 2007/4/23, 张凤丽 <zhangfenglisdu@xxxxxxxxx
> <mailto:zhangfenglisdu@xxxxxxxxx>>:
>
> hi, all
> what's the difference between QToolButton and QPushButton? i just
> want to add a few buttons to my toolbar.
> or both are ok?
> regards
> fengli
>
>