summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-12-30 16:47:37 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-12-30 18:03:54 (GMT)
commit96b31c598f5c229c3acc0579ddfe22dd503e2b9d (patch)
treed73db22e591e49f088f359b9876df232eb99c6a9 /Swift/QtUI/Whiteboard
parentb19210aa48e7cea40929593daed997668fe789be (diff)
downloadswift-96b31c598f5c229c3acc0579ddfe22dd503e2b9d.zip
swift-96b31c598f5c229c3acc0579ddfe22dd503e2b9d.tar.bz2
Enable & fix pedantic CLang warnings.
Change-Id: I70109624b4bd7aab9ba679a3eaabc225dd64a03a
Diffstat (limited to 'Swift/QtUI/Whiteboard')
-rw-r--r--Swift/QtUI/Whiteboard/ColorWidget.h2
-rw-r--r--Swift/QtUI/Whiteboard/FreehandLineItem.h2
-rw-r--r--Swift/QtUI/Whiteboard/GView.h2
-rw-r--r--Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp17
-rw-r--r--Swift/QtUI/Whiteboard/QtWhiteboardWindow.h2
-rw-r--r--Swift/QtUI/Whiteboard/TextDialog.h4
6 files changed, 15 insertions, 14 deletions
diff --git a/Swift/QtUI/Whiteboard/ColorWidget.h b/Swift/QtUI/Whiteboard/ColorWidget.h
index 6abdf00..ae1af0f 100644
--- a/Swift/QtUI/Whiteboard/ColorWidget.h
+++ b/Swift/QtUI/Whiteboard/ColorWidget.h
@@ -10,7 +10,7 @@
namespace Swift {
class ColorWidget : public QWidget {
- Q_OBJECT;
+ Q_OBJECT
public:
ColorWidget(QWidget* parent = 0);
QSize sizeHint() const;
diff --git a/Swift/QtUI/Whiteboard/FreehandLineItem.h b/Swift/QtUI/Whiteboard/FreehandLineItem.h
index f3c6607..b1af3d1 100644
--- a/Swift/QtUI/Whiteboard/FreehandLineItem.h
+++ b/Swift/QtUI/Whiteboard/FreehandLineItem.h
@@ -10,8 +10,6 @@
#include <QPainter>
#include <iostream>
-using namespace std;
-
namespace Swift {
class FreehandLineItem : public QGraphicsItem {
public:
diff --git a/Swift/QtUI/Whiteboard/GView.h b/Swift/QtUI/Whiteboard/GView.h
index 88ea326..6a4fd2f 100644
--- a/Swift/QtUI/Whiteboard/GView.h
+++ b/Swift/QtUI/Whiteboard/GView.h
@@ -18,7 +18,7 @@
namespace Swift {
class GView : public QGraphicsView {
- Q_OBJECT;
+ Q_OBJECT
public:
enum Mode { Rubber, Line, Rect, Circle, HandLine, Text, Polygon, Select };
enum Type { New, Update, MoveUp, MoveDown };
diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
index 50d7f54..414e590 100644
--- a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
+++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
@@ -10,6 +10,7 @@
#include <boost/bind.hpp>
#include <boost/smart_ptr/make_shared.hpp>
+#include <boost/numeric/conversion/cast.hpp>
#include <Swiften/Whiteboard/WhiteboardSession.h>
#include <Swiften/Elements/WhiteboardPayload.h>
@@ -264,7 +265,9 @@ namespace Swift {
std::vector<std::pair<int, int> > points;
QVector<QPointF>::const_iterator it = freehandLineItem->points().constBegin();
for ( ; it != freehandLineItem->points().constEnd(); ++it) {
- points.push_back(std::pair<int, int>(it->x()+item->pos().x(), it->y()+item->pos().y()));
+ points.push_back(std::pair<int, int>(
+ boost::numeric_cast<int>(it->x()+item->pos().x()),
+ boost::numeric_cast<int>(it->y()+item->pos().y())));
}
element->setColor(WhiteboardColor(color.red(), color.green(), color.blue(), color.alpha()));
@@ -310,7 +313,9 @@ namespace Swift {
std::vector<std::pair<int, int> > points;
QVector<QPointF>::const_iterator it = polygon.begin();
for (; it != polygon.end(); ++it) {
- points.push_back(std::pair<int, int>(it->x()+item->pos().x(), it->y()+item->pos().y()));
+ points.push_back(std::pair<int, int>(
+ boost::numeric_cast<int>(it->x()+item->pos().x()),
+ boost::numeric_cast<int>(it->y()+item->pos().y())));
}
element->setPoints(points);
@@ -328,10 +333,10 @@ namespace Swift {
QGraphicsEllipseItem* ellipseItem = qgraphicsitem_cast<QGraphicsEllipseItem*>(item);
if (ellipseItem) {
QRectF rect = ellipseItem->rect();
- int cx = rect.x()+rect.width()/2 + item->pos().x();
- int cy = rect.y()+rect.height()/2 + item->pos().y();
- int rx = rect.width()/2;
- int ry = rect.height()/2;
+ int cx = boost::numeric_cast<int>(rect.x()+rect.width()/2 + item->pos().x());
+ int cy = boost::numeric_cast<int>(rect.y()+rect.height()/2 + item->pos().y());
+ int rx = boost::numeric_cast<int>(rect.width()/2);
+ int ry = boost::numeric_cast<int>(rect.height()/2);
WhiteboardEllipseElement::ref element = boost::make_shared<WhiteboardEllipseElement>(cx, cy, rx, ry);
QColor penColor = ellipseItem->pen().color();
diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h
index 4665ef0..3957bb7 100644
--- a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h
+++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.h
@@ -30,7 +30,7 @@
namespace Swift {
class QtWhiteboardWindow : public QWidget, public WhiteboardWindow
{
- Q_OBJECT;
+ Q_OBJECT
public:
QtWhiteboardWindow(WhiteboardSession::ref whiteboardSession);
void show();
diff --git a/Swift/QtUI/Whiteboard/TextDialog.h b/Swift/QtUI/Whiteboard/TextDialog.h
index f4d9a13..64a0fe2 100644
--- a/Swift/QtUI/Whiteboard/TextDialog.h
+++ b/Swift/QtUI/Whiteboard/TextDialog.h
@@ -16,12 +16,10 @@
#include <iostream>
-using namespace std;
-
namespace Swift {
class TextDialog : public QDialog
{
- Q_OBJECT;
+ Q_OBJECT
public:
TextDialog(QGraphicsTextItem* item, QWidget* parent = 0);