Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_gui_widgets_qabstractbutton.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5QPushButton *button = new QPushButton(tr("Ro&ck && Roll"), this);
7
8
10button->setIcon(QIcon(":/images/print.png"));
11button->setShortcut(tr("Alt+F7"));
13
14
16void MyWidget::reactToToggle(bool checked)
17{
18 if (checked) {
19 // Examine the new button states.
20 ...
21 }
22}
void setShortcut(const QKeySequence &key)
void setIcon(const QIcon &icon)
The QIcon class provides scalable icons in different modes and states.
Definition qicon.h:20
The QPushButton widget provides a command button.
Definition qpushbutton.h:20
QPushButton
[1]
#define tr(X)
QPushButton * button
[0]