PDA

View Full Version : pushButton and toolButton



lucasbemo
19th December 2010, 19:32
Hi everybody,

Could someone help me with a simple question. What is the difference between the QPushButton and QToolButton? (I'm sorry for simple question, but I'm a new in Qt and I can not find the difference between these two class).

Thanks in advance.

high_flyer
20th December 2010, 09:10
The difference is explained in the QToolButton documentation.
Did you read it?

xiaokui
21st December 2010, 00:56
the simple answer is QPushButton can be pushed by the user, QToolButton also can be pushed by the user and should be placed in the tool bar.
the class name in the Qt is very simple , interesting and correctly.
you can get the difference from the difference class name. is this interesting?

waspinator
10th February 2013, 19:55
sorry for reviving this thread, but it comes up first in google results when searching for the difference.

ok, so when would you use a push button instead of a tool button? Can't you use the tool button in every place you would use a push button, but not the other way around?

Thanks

high_flyer
11th February 2013, 09:37
Is it really easier to post a question then first reading the previous posts and the documentation?


The QToolButton class provides a quick-access button to commands or options, usually used inside a QToolBar.

A tool button 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.