[Uml-devel] branches/work/soc-umbrello/umbrello
Gopala Krishna A
krishna.ggk at gmail.com
Fri Aug 1 10:28:01 UTC 2008
SVN commit 840568 by gopala:
Added
* UMLScene::isArrowMode which determines whether current toolbar mode
is arrow mode or not.
* UMLScene::isMouseMovingItems which tells whether items/widgets on
scene are being clicked and dragged.
M +13 -0 umlscene.cpp
M +7 -0 umlscene.h
--- branches/work/soc-umbrello/umbrello/umlscene.cpp #840567:840568
@@ -110,6 +110,8 @@
m_nSnapY = 10;
m_nCollaborationId = 0;
+ m_isMouseMovingItems = false;
+
// Initialize other data
//m_AssociationList.setAutoDelete(true);
//m_WidgetList.setAutoDelete(true);
@@ -385,6 +387,7 @@
void UMLScene::mouseReleaseEvent(QGraphicsSceneMouseEvent* ome)
{
m_pToolBarState->mouseRelease(ome);
+ m_isMouseMovingItems = false;
}
void UMLScene::slotToolBarChanged(int c)
@@ -1117,6 +1120,10 @@
void UMLScene::mousePressEvent(QGraphicsSceneMouseEvent* ome)
{
+ if (isArrowMode() && ome->buttons().testFlag(Qt::LeftButton)) {
+ m_isMouseMovingItems = true;
+ }
+
m_pToolBarState->mousePress(ome);
//TODO should be managed by widgets when are selected. Right now also has some
@@ -1131,6 +1138,12 @@
m_bChildDisplayedDoc = false;
}
+bool UMLScene::isArrowMode()
+{
+ return m_pToolBarState ==
+ m_pToolBarStateFactory->getState(WorkToolBar::tbb_Arrow, this);
+}
+
void UMLScene::makeSelected(NewUMLRectWidget * uw)
{
if (uw) {
--- branches/work/soc-umbrello/umbrello/umlscene.h #840567:840568
@@ -903,6 +903,10 @@
void callBaseMouseMethod(QGraphicsSceneMouseEvent *event);
+ bool isMouseMovingItems() const {
+ return m_isMouseMovingItems;
+ }
+
protected:
void drawBackground(QPainter *p, const QRectF& rect);
@@ -1038,7 +1042,10 @@
*/
void mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent);
+ bool m_isMouseMovingItems;
+ bool isArrowMode();
+
/**
* Selects all the widgets of the given association widget.
*/
More information about the umbrello-devel
mailing list