LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / libs / utils / qtcolorbutton.h
blobfd8991819e255bf98c0848adb0f62cc0d373c26f
1 /**
2 ******************************************************************************
4 * @file qtcolorbutton.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
7 * @brief
8 * @see The GNU Public License (GPL) Version 3
9 * @defgroup
10 * @{
12 *****************************************************************************/
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef QTCOLORBUTTON_H
30 #define QTCOLORBUTTON_H
32 #include "utils_global.h"
34 #include <QToolButton>
36 namespace Utils {
37 class QTCREATOR_UTILS_EXPORT QtColorButton : public QToolButton {
38 Q_OBJECT Q_PROPERTY(bool backgroundCheckered READ isBackgroundCheckered WRITE setBackgroundCheckered)
39 Q_PROPERTY(bool alphaAllowed READ isAlphaAllowed WRITE setAlphaAllowed)
40 public:
41 QtColorButton(QWidget *parent = 0);
42 ~QtColorButton();
44 bool isBackgroundCheckered() const;
45 void setBackgroundCheckered(bool checkered);
47 bool isAlphaAllowed() const;
48 void setAlphaAllowed(bool allowed);
50 QColor color() const;
52 public slots:
53 void setColor(const QColor &color);
55 signals:
56 void colorChanged(const QColor &color);
57 protected:
58 void paintEvent(QPaintEvent *event);
59 void mousePressEvent(QMouseEvent *event);
60 void mouseMoveEvent(QMouseEvent *event);
61 #ifndef QT_NO_DRAGANDDROP
62 void dragEnterEvent(QDragEnterEvent *event);
63 void dragLeaveEvent(QDragLeaveEvent *event);
64 void dropEvent(QDropEvent *event);
65 #endif
66 private:
67 class QtColorButtonPrivate *d_ptr;
68 friend class QtColorButtonPrivate;
69 Q_DISABLE_COPY(QtColorButton)
70 Q_PRIVATE_SLOT(d_ptr, void slotEditColor())
72 } // namespace Utils
74 #endif // QTCOLORBUTTON_H