summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/Whiteboard/ColorWidget.cpp')
-rw-r--r--Swift/QtUI/Whiteboard/ColorWidget.cpp57
1 files changed, 32 insertions, 25 deletions
diff --git a/Swift/QtUI/Whiteboard/ColorWidget.cpp b/Swift/QtUI/Whiteboard/ColorWidget.cpp
index e96b760..7669ecc 100644
--- a/Swift/QtUI/Whiteboard/ColorWidget.cpp
+++ b/Swift/QtUI/Whiteboard/ColorWidget.cpp
@@ -4,34 +4,41 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+
+#include <Swift/QtUI/Whiteboard/ColorWidget.h>
-#include "ColorWidget.h"
-#include <QPainter>
#include <QMouseEvent>
+#include <QPainter>
namespace Swift {
- ColorWidget::ColorWidget(QWidget* parent) : QWidget(parent) {
- setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
- }
-
- QSize ColorWidget::sizeHint() const {
- return QSize(20, 20);
- }
-
- void ColorWidget::setColor(QColor color) {
- this->color = color;
- update();
- }
-
- void ColorWidget::paintEvent(QPaintEvent* /*event*/) {
- QPainter painter(this);
- painter.fillRect(0, 0, 20, 20, color);
- }
-
- void ColorWidget::mouseReleaseEvent(QMouseEvent* event) {
- if (event->button() == Qt::LeftButton) {
- emit clicked();
- }
- }
+ ColorWidget::ColorWidget(QWidget* parent) : QWidget(parent) {
+ setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+ }
+
+ QSize ColorWidget::sizeHint() const {
+ return QSize(20, 20);
+ }
+
+ void ColorWidget::setColor(QColor color) {
+ this->color = color;
+ update();
+ }
+
+ void ColorWidget::paintEvent(QPaintEvent* /*event*/) {
+ QPainter painter(this);
+ painter.fillRect(0, 0, 20, 20, color);
+ }
+
+ void ColorWidget::mouseReleaseEvent(QMouseEvent* event) {
+ if (event->button() == Qt::LeftButton) {
+ emit clicked();
+ }
+ }
}