Developer documentation
Version 3.0.3-105-gd3941f44
color_button.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
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 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __gui_color_button_h__
18#define __gui_color_button_h__
19
20#include "gui/opengl/gl.h"
21
22class QColorButton : public QPushButton
24 Q_OBJECT
25 Q_PROPERTY (QColor color READ color WRITE setColor)
26
27 public:
28 QColorButton (QWidget *parent = NULL, const char *name = NULL);
29 QColorButton (const QColor &c, QWidget *parent = NULL, const char *name = NULL);
30 virtual ~QColorButton () {}
31
32 QColor color () const { return (col); }
33 void setColor (const QColor &c);
34 QSize sizeHint () const;
35
36 signals:
37 void changed (const QColor &newColor);
38
39 protected slots:
41
42 protected:
43 virtual void paintEvent (QPaintEvent *p);
44
45 private:
46 QColor col;
47 QPoint mPos;
48};
49
50#endif
NOMEMALIGN QColor color
Definition: color_button.h:25
void setColor(const QColor &c)
virtual ~QColorButton()
Definition: color_button.h:30
QColorButton(const QColor &c, QWidget *parent=NULL, const char *name=NULL)
QSize sizeHint() const
void changed(const QColor &newColor)
QColor color() const
Definition: color_button.h:32
virtual void paintEvent(QPaintEvent *p)
void chooseColor()
QColorButton(QWidget *parent=NULL, const char *name=NULL)
#define NOMEMALIGN
Definition: memory.h:22
const std::string name
Definition: thread.h:108