Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpushbutton.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QPUSHBUTTON_H
6#define QPUSHBUTTON_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtWidgets/qabstractbutton.h>
10
12
13QT_BEGIN_NAMESPACE
14
15
16class QPushButtonPrivate;
17class QMenu;
18class QStyleOptionButton;
19
20class Q_WIDGETS_EXPORT QPushButton : public QAbstractButton
21{
22 Q_OBJECT
23
24 Q_PROPERTY(bool autoDefault READ autoDefault WRITE setAutoDefault)
25 Q_PROPERTY(bool default READ isDefault WRITE setDefault)
26 Q_PROPERTY(bool flat READ isFlat WRITE setFlat)
27
28public:
29 explicit QPushButton(QWidget *parent = nullptr);
30 explicit QPushButton(const QString &text, QWidget *parent = nullptr);
31 QPushButton(const QIcon& icon, const QString &text, QWidget *parent = nullptr);
32 ~QPushButton();
33
34 QSize sizeHint() const override;
35 QSize minimumSizeHint() const override;
36
37 bool autoDefault() const;
38 void setAutoDefault(bool);
39 bool isDefault() const;
40 void setDefault(bool);
41
42#if QT_CONFIG(menu)
43 void setMenu(QMenu* menu);
44 QMenu* menu() const;
45#endif
46
47 void setFlat(bool);
48 bool isFlat() const;
49
50public Q_SLOTS:
51#if QT_CONFIG(menu)
52 void showMenu();
53#endif
54
55protected:
56 bool event(QEvent *e) override;
57 void paintEvent(QPaintEvent *) override;
58 void keyPressEvent(QKeyEvent *) override;
59 void focusInEvent(QFocusEvent *) override;
60 void focusOutEvent(QFocusEvent *) override;
61 void mouseMoveEvent(QMouseEvent *) override;
62 virtual void initStyleOption(QStyleOptionButton *option) const;
63 bool hitButton(const QPoint &pos) const override;
64 QPushButton(QPushButtonPrivate &dd, QWidget* parent = nullptr);
65
66private:
67 Q_DISABLE_COPY(QPushButton)
68 Q_DECLARE_PRIVATE(QPushButton)
69};
70
71QT_END_NAMESPACE
72
73#endif // QPUSHBUTTON_H
QColor grabScreenColor(const QPoint &p)
bool selectColor(const QColor &color)
void init(const QColor &initial)
void setCurrentAlpha(int a)
QColorPickingEventFilter * colorPickingEventFilter
bool handleColorPickingMouseButtonRelease(QMouseEvent *e)
QColor currentQColor() const
bool handleColorPickingMouseMove(QMouseEvent *e)
void _q_setCustom(int index, QRgb color)
QPushButton * eyeDropperButton
void updateColorLabelText(const QPoint &)
void setCurrentColor(const QColor &color, SetColorMode setColorMode=SetColorAll)
bool isAlphaVisible() const
QVBoxLayout * leftLay
void setCurrentQColor(const QColor &color)
bool canBeNativeDialog() const override
void setCurrentRgbColor(QRgb rgb)
QRgb currentColor() const
void newColorTypedIn(QRgb rgb)
bool handleColorPickingKeyPress(QKeyEvent *e)
void updateColorPicking(const QPoint &pos)
QSharedPointer< QColorDialogOptions > options
void newStandard(int, int)
void setVisible(bool visible) override
QDialogButtonBox * buttons
bool supportsColorPicking() const
QPointer< QObject > receiverToDisconnectOnClose
virtual void initHelper(QPlatformDialogHelper *h) override
QByteArray memberToDisconnectOnClose
QPushButton * addCusBt
void newHsv(int h, int s, int v)
virtual void helperPrepareShow(QPlatformDialogHelper *h) override
QColorLuminancePicker * lp
void newCustom(int, int)
QPlatformColorDialogHelper * platformColorDialogHelper() const
void nextCustom(int, int)
The QColorDialog class provides a dialog widget for specifying colors.
friend class QPainter
\inmodule QtCore\reentrant
Definition qpoint.h:29
The QPushButton widget provides a command button.
Definition qpushbutton.h:21
QColSpinBox(QWidget *parent)
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void keyPressEvent(QKeyEvent *event) override
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
void mouseMoveEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
QSize sizeHint() const override
void setCrossVisible(bool visible)
void resizeEvent(QResizeEvent *) override
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
void mousePressEvent(QMouseEvent *) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void keyPressEvent(QKeyEvent *event) override
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
bool eventFilter(QObject *, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
void applicationStateChanged(Qt::ApplicationState state)
QColorPickingEventFilter(QColorDialogPrivate *dp, QObject *parent)
void mouseReleaseEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void mousePressEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
void mouseMoveEvent(QMouseEvent *e) override
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void paintEvent(QPaintEvent *) override
This event handler can be reimplemented in a subclass to receive paint events passed in event.
QColor currentQColor() const
void setHsv(int h, int s, int v)
void currentColorChanged(const QColor &color)
friend class QT_PREPEND_NAMESPACE(QUntypedBindable)
QtPrivate::QColorShower QColorShower
static void rgb2hsv(QRgb rgb, int &h, int &s, int &v)
static int pHeight
static int pWidth
QtPrivate::QColorPickingEventFilter QColorPickingEventFilter
QtPrivate::QColorLuminancePicker QColorLuminancePicker
QtPrivate::QColorPicker QColorPicker
static const Qt::WindowFlags qcd_DefaultWindowFlags
@ colorColumns
@ standardColorRows
@ customColorRows
QT_REQUIRE_CONFIG(colordialog)
#define qApp
QT_REQUIRE_CONFIG(progressbar)
QT_REQUIRE_CONFIG(thread)