Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtWidgets/qpushbutton.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QPUSHBUTTON_H
0005 #define QPUSHBUTTON_H
0006 
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qabstractbutton.h>
0009 
0010 QT_REQUIRE_CONFIG(pushbutton);
0011 
0012 QT_BEGIN_NAMESPACE
0013 
0014 
0015 class QPushButtonPrivate;
0016 class QMenu;
0017 class QStyleOptionButton;
0018 
0019 class Q_WIDGETS_EXPORT QPushButton : public QAbstractButton
0020 {
0021     Q_OBJECT
0022 
0023     Q_PROPERTY(bool autoDefault READ autoDefault WRITE setAutoDefault)
0024     Q_PROPERTY(bool default READ isDefault WRITE setDefault)
0025     Q_PROPERTY(bool flat READ isFlat WRITE setFlat)
0026 
0027 public:
0028     explicit QPushButton(QWidget *parent = nullptr);
0029     explicit QPushButton(const QString &text, QWidget *parent = nullptr);
0030     QPushButton(const QIcon& icon, const QString &text, QWidget *parent = nullptr);
0031     ~QPushButton();
0032 
0033     QSize sizeHint() const override;
0034     QSize minimumSizeHint() const override;
0035 
0036     bool autoDefault() const;
0037     void setAutoDefault(bool);
0038     bool isDefault() const;
0039     void setDefault(bool);
0040 
0041 #if QT_CONFIG(menu)
0042     void setMenu(QMenu* menu);
0043     QMenu* menu() const;
0044 #endif
0045 
0046     void setFlat(bool);
0047     bool isFlat() const;
0048 
0049 public Q_SLOTS:
0050 #if QT_CONFIG(menu)
0051     void showMenu();
0052 #endif
0053 
0054 protected:
0055     bool event(QEvent *e) override;
0056     void paintEvent(QPaintEvent *) override;
0057     void keyPressEvent(QKeyEvent *) override;
0058     void focusInEvent(QFocusEvent *) override;
0059     void focusOutEvent(QFocusEvent *) override;
0060     void mouseMoveEvent(QMouseEvent *) override;
0061     virtual void initStyleOption(QStyleOptionButton *option) const;
0062     bool hitButton(const QPoint &pos) const override;
0063     QPushButton(QPushButtonPrivate &dd, QWidget* parent = nullptr);
0064 
0065 private:
0066     Q_DISABLE_COPY(QPushButton)
0067     Q_DECLARE_PRIVATE(QPushButton)
0068 };
0069 
0070 QT_END_NAMESPACE
0071 
0072 #endif // QPUSHBUTTON_H