summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Piekos <mateuszpiekos@gmail.com>2012-07-23 09:53:25 (GMT)
committerMateusz Piekos <mateuszpiekos@gmail.com>2012-07-23 09:53:25 (GMT)
commit04eba421f1c33064939a281e169dec472f424c32 (patch)
treefb831deee92615d375698034236d29491b9fbc35 /Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
parentb4384bde09c72dde1620478c98fc20eb76529f3f (diff)
downloadswift-contrib-04eba421f1c33064939a281e169dec472f424c32.zip
swift-contrib-04eba421f1c33064939a281e169dec472f424c32.tar.bz2
Added abitlity to change color and line witdth of drawn elements
Diffstat (limited to 'Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp')
-rw-r--r--Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
index d89a7f6..b3f42a9 100644
--- a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
+++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
@@ -43,6 +43,7 @@ namespace Swift {
widthBox = new QSpinBox(this);
connect(widthBox, SIGNAL(valueChanged(int)), this, SLOT(changeLineWidth(int)));
+ connect(graphicsView, SIGNAL(lineWidthChanged(int)), widthBox, SLOT(setValue(int)));
widthBox->setValue(1);
moveUpButton = new QPushButton("Move Up", this);
@@ -246,12 +247,10 @@ namespace Swift {
QLine line = lineItem->line().toLine();
QColor color = lineItem->pen().color();
WhiteboardLineElement::ref element = boost::make_shared<WhiteboardLineElement>(line.x1()+lineItem->pos().x(), line.y1()+lineItem->pos().y(), line.x2()+lineItem->pos().x(), line.y2()+lineItem->pos().y());
-// element->setShift(lineItem->pos().x(), lineItem->pos().y());
element->setColor(Color(color.red(), color.green(), color.blue(), color.alpha()));
element->setPenWidth(lineItem->pen().width());
element->setID(lineItem->data(100).toString().toStdString());
-// whiteboardSession_->sendElement(element);
el = element;
}
FreehandLineItem* freehandLineItem = qgraphicsitem_cast<FreehandLineItem*>(item);
@@ -269,7 +268,6 @@ namespace Swift {
element->setPoints(points);
element->setID(freehandLineItem->data(100).toString().toStdString());
-// whiteboardSession_->sendElement(element);
el = element;
}
@@ -283,9 +281,9 @@ namespace Swift {
element->setBrushColor(Color(brushColor.red(), brushColor.green(), brushColor.blue(), brushColor.alpha()));
element->setPenColor(Color(penColor.red(), penColor.green(), penColor.blue(), penColor.alpha()));
element->setPenWidth(rectItem->pen().width());
+ std::cout << penColor.red() << " " << brushColor.red() << std::endl;
element->setID(rectItem->data(100).toString().toStdString());
-// whiteboardSession_->sendElement(element);
el = element;
}
@@ -299,7 +297,6 @@ namespace Swift {
element->setColor(Color(color.red(), color.green(), color.blue(), color.alpha()));
element->setID(textItem->data(100).toString().toStdString());
-// whiteboardSession_->sendElement(element);
el = element;
}
@@ -322,7 +319,6 @@ namespace Swift {
element->setPenWidth(polygonItem->pen().width());
element->setID(polygonItem->data(100).toString().toStdString());
-// whiteboardSession_->sendElement(element);
el = element;
}
@@ -342,7 +338,6 @@ namespace Swift {
element->setPenWidth(ellipseItem->pen().width());
element->setID(ellipseItem->data(100).toString().toStdString());
-// whiteboardSession_->sendElement(element);
el = element;
}