summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Piekos <mateuszpiekos@gmail.com>2012-07-02 07:50:57 (GMT)
committerMateusz Piekos <mateuszpiekos@gmail.com>2012-07-02 07:50:57 (GMT)
commit975435c14b61b241a8e5890c21c60a5be48c2116 (patch)
tree138a38df0edef2ea953adb9793e2e2402b2d533a /Swift/QtUI
parenta8f57139d663a176af87d7bc71dd85c62f6274cf (diff)
downloadswift-contrib-975435c14b61b241a8e5890c21c60a5be48c2116.zip
swift-contrib-975435c14b61b241a8e5890c21c60a5be48c2116.tar.bz2
Clearing whiteboard window on session initialization
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/Whiteboard/GView.cpp5
-rw-r--r--Swift/QtUI/Whiteboard/GView.h1
-rw-r--r--Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp1
3 files changed, 7 insertions, 0 deletions
diff --git a/Swift/QtUI/Whiteboard/GView.cpp b/Swift/QtUI/Whiteboard/GView.cpp
index fe0e5f9..27197d0 100644
--- a/Swift/QtUI/Whiteboard/GView.cpp
+++ b/Swift/QtUI/Whiteboard/GView.cpp
@@ -59,6 +59,11 @@ namespace Swift {
idPrefix = prefix;
}
+ void GView::clear() {
+ scene()->clear();
+ items_.clear();
+ }
+
QString GView::getNewID() {
return idPrefix + P2QSTRING(idGenerator.generateID());
}
diff --git a/Swift/QtUI/Whiteboard/GView.h b/Swift/QtUI/Whiteboard/GView.h
index 4830381..0069fb5 100644
--- a/Swift/QtUI/Whiteboard/GView.h
+++ b/Swift/QtUI/Whiteboard/GView.h
@@ -34,6 +34,7 @@ namespace Swift {
QGraphicsItem* getItem(const QString id) const;
void addItem(QGraphicsItem* item, QString id);
void setIDPrefix(QString prefix);
+ void clear();
public slots:
void moveUpSelectedItem();
diff --git a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
index 9aa6eb0..66db6db 100644
--- a/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
+++ b/Swift/QtUI/Whiteboard/QtWhiteboardWindow.cpp
@@ -204,6 +204,7 @@ namespace Swift {
}
void QtWhiteboardWindow::setSession(WhiteboardSession::ref session) {
+ graphicsView->clear();
whiteboardSession_ = session;
graphicsView->setIDPrefix(P2QSTRING(whiteboardSession_->getClientID()));
whiteboardSession_->onElementReceived.connect(boost::bind(&QtWhiteboardWindow::handleWhiteboardElementReceive, this, _1));