src/platform/qt/ColorPicker.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#pragma once
7
8#include <QColor>
9#include <QObject>
10
11class QWidget;
12
13namespace QGBA {
14
15class ColorPicker : public QObject {
16Q_OBJECT
17
18public:
19 ColorPicker();
20 ColorPicker(QWidget* parent, const QColor& defaultColor);
21
22 ColorPicker& operator=(const ColorPicker&);
23
24signals:
25 void colorChanged(const QColor&);
26
27public slots:
28 void setColor(const QColor&);
29
30protected:
31 bool eventFilter(QObject* obj, QEvent* event) override;
32
33private:
34 QWidget* m_parent = nullptr;
35 QColor m_defaultColor;
36};
37
38}