Results 1 to 5 of 5

Thread: pushButton and toolButton

  1. #1
    Join Date
    Mar 2010
    Location
    Brasília, Brasil
    Posts
    15
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Question pushButton and toolButton

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: pushButton and toolButton

    The difference is explained in the QToolButton documentation.
    Did you read it?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Dec 2010
    Location
    BEIJING CHINA
    Posts
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: pushButton and toolButton

    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?

  4. #4
    Join Date
    Feb 2013
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: pushButton and toolButton

    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

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: pushButton and toolButton

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Can't change toolbutton icon
    By waynew in forum Newbie
    Replies: 4
    Last Post: 8th December 2010, 08:37
  2. Set a ToolButton Hovered
    By vajindarladdad in forum Newbie
    Replies: 7
    Last Post: 1st September 2009, 12:33
  3. Toolbutton odd sizes
    By andytork in forum Qt Programming
    Replies: 0
    Last Post: 21st January 2009, 06:25
  4. how exclusive toolbutton in toolbar
    By irmakci in forum Qt Programming
    Replies: 2
    Last Post: 30th July 2008, 22:33
  5. Dockwidget and Toolbutton
    By sandeepvl in forum Qt Programming
    Replies: 3
    Last Post: 13th May 2008, 07:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.