[Uml-devel] KDE/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Tue Dec 6 13:25:13 UTC 2005
SVN commit 486139 by okellogg:
apply commit 475999 from branches/KDE/3.5
M +29 -4 umlwidget.cpp
M +14 -0 umlwidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/umlwidget.cpp #486138:486139
@@ -412,6 +412,15 @@
m_pView->setAssoc(this);
}
+ UMLWidget *bkgnd = m_pView->testOnWidget(me->pos());
+ if (bkgnd) {
+ kdDebug() << "UMLWidget::mouseReleaseEvent: setting Z to "
+ << bkgnd->getZ() + 1 << endl;
+ setZ( bkgnd->getZ() + 1 );
+ } else {
+ setZ( 0 );
+ }
+
if (m_bResizing) {
m_bResizing = false;
m_pView->setCursor( KCursor::arrowCursor() );
@@ -890,17 +899,28 @@
m_pView->showDocumentation(this, false);
}
}//end if
- if (wt != wt_Text && wt != wt_Box) {
+ /* if (wt != wt_Text && wt != wt_Box) {
setZ(9);//keep text on top and boxes behind so don't touch Z value
- }
+ } */
} else {
- if (wt != wt_Text && wt != wt_Box) {
+ /* if (wt != wt_Text && wt != wt_Box) {
setZ(m_origZ);
- }
+ } */
if( m_bSelected )
m_pView -> updateDocumentation( true );
}
m_bSelected = _select;
+
+ const QPoint pos(getX(), getY());
+ UMLWidget *bkgnd = m_pView->testOnWidget(pos);
+ if (bkgnd) {
+ kdDebug() << "UMLWidget::setSelected: setting Z to "
+ << bkgnd->getZ() + 1 << endl;
+ setZ( bkgnd->getZ() + 1 );
+ } else {
+ setZ( 0 );
+ }
+
update();
/* selection changed, we have to make sure the copy and paste items
@@ -942,6 +962,11 @@
Q3CanvasItem::setY( (double)y );
}
+void UMLWidget::setZ(int z) {
+ m_origZ = getZ();
+ QCanvasItem::setZ(z);
+}
+
void UMLWidget::setName(const QString &strName) {
if (m_pObject)
m_pObject->setName(strName);
--- trunk/KDE/kdesdk/umbrello/umbrello/umlwidget.h #486138:486139
@@ -268,6 +268,13 @@
virtual void setY( int y );
/**
+ * Sets the z-coordinate.
+ *
+ * @param z The z-coordinate to be set.
+ */
+ virtual void setZ( int z );
+
+ /**
* Gets the x-coordinate.
*/
int getX() const {
@@ -282,6 +289,13 @@
}
/**
+ * Gets the z-coordinate.
+ */
+ int getZ() const {
+ return (int)QCanvasItem::z();
+ }
+
+ /**
* Returns the height of widget.
*/
int getHeight() const {
More information about the umbrello-devel
mailing list