Try   HackMD

What is the different between QPushButton and QToolButton?

tags: problemsQt5(C++)
  • 參考
    • QPushButton is simply a button. QToolButton is part of a group of widgets in the QtWidgets module that operate on QActions: QMenu and QToolBar are other examples. As a result, QToolButton is much more complex under the hood than QPushButton.
    • A QToolButton should generally have an icon.
    • A QPushButton should always have text.
    • From Qt doc: http://doc.qt.io/qt-5/qtoolbutton.html#details
    • "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."
    • When i want a button in the GUI simple with only an icon, I use QToolButton. But when i want a classic button, i use QPushButton.
    • No big differences,