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
qtcolorbutton_p.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
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists for the convenience
9// of Qt Designer. This header file may change from version to version
10// without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef QTCOLORBUTTON_H
16#define QTCOLORBUTTON_H
17
18#include <QtWidgets/QToolButton>
19
21
23{
24 Q_OBJECT
25 Q_PROPERTY(bool backgroundCheckered READ isBackgroundCheckered WRITE setBackgroundCheckered)
26public:
29
30 bool isBackgroundCheckered() const;
31 void setBackgroundCheckered(bool checkered);
32
33 QColor color() const;
34
35public slots:
36 void setColor(QColor color);
37
40
41protected:
42 void paintEvent(QPaintEvent *event) override;
43 void mousePressEvent(QMouseEvent *event) override;
44 void mouseMoveEvent(QMouseEvent *event) override;
45#ifndef QT_NO_DRAGANDDROP
46 void dragEnterEvent(QDragEnterEvent *event) override;
47 void dragLeaveEvent(QDragLeaveEvent *event) override;
48 void dropEvent(QDropEvent *event) override;
49#endif
50
51private:
55};
56
57QT_END_NAMESPACE
58
59#endif
QColor color() const
void mouseMoveEvent(QMouseEvent *event) override
\reimp
void paintEvent(QPaintEvent *event) override
\reimp
void dragLeaveEvent(QDragLeaveEvent *event) override
void setBackgroundCheckered(bool checkered)
void dragEnterEvent(QDragEnterEvent *event) override
void dropEvent(QDropEvent *event) override
bool isBackgroundCheckered() const
void mousePressEvent(QMouseEvent *event) override
\reimp
void setBrush(const QBrush &brush)
QSize sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &index) const override
This pure abstract function must be reimplemented if you want to provide custom rendering.
void paint(QPainter *painter, const QStyleOptionViewItem &opt, const QModelIndex &index) const override
This pure abstract function must be reimplemented if you want to provide custom rendering.
void setPalette(const QPalette &palette)
void setPalette(const QPalette &palette, const QPalette &parentPalette)
QBrush brushAt(const QModelIndex &index) const
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
Returns the data for the given role and section in the header with the specified orientation.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns for the children of the given parent.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
QPalette::ColorRole colorRole() const
quint64 rowMask(const QModelIndex &index) const
QVariant data(const QModelIndex &index, int role) const override
Returns the data stored under the given role for the item referred to by the index.
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Sets the role data for the item at index to value.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns the item flags for the given index.
void setPalette(const QPalette &palette, const QPalette &parentPalette)
void setLabel(const QString &label)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static QString paletteFilter()
static bool savePalette(const QString &fileName, const QPalette &pal, QString *errorMessage)
static QString msgCannotReadPalette(const QString &fileName, const QXmlStreamReader &reader)
static QString msgCannotReadPalette(const QString &fileName, const QXmlStreamReader &reader, const QString &why)
static bool loadPalette(const QString &fileName, QPalette *pal, QString *errorMessage)