[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Sep 18 07:44:05 UTC 2004
CVS commit by okellogg:
Implement wish #89699.
M +32 -0 uml.cpp 1.113
M +15 -0 umllistview.cpp 1.117
M +2 -0 umllistview.h 1.45
--- kdesdk/umbrello/umbrello/uml.cpp #1.112:1.113
@@ -1417,4 +1417,36 @@ void UMLApp::keyReleaseEvent(QKeyEvent *
e->accept();
break;
+ case Qt::Key_Left:
+ if (m_view && m_view->getSelectCount()) {
+ m_view->moveSelectedBy(-1, 0 );
+ e->accept();
+ } else {
+ e->ignore();
+ }
+ break;
+ case Qt::Key_Right:
+ if (m_view && m_view->getSelectCount()) {
+ m_view->moveSelectedBy( 1, 0 );
+ e->accept();
+ } else {
+ e->ignore();
+ }
+ break;
+ case Qt::Key_Up:
+ if (m_view && m_view->getSelectCount()) {
+ m_view->moveSelectedBy( 0, -1 );
+ e->accept();
+ } else {
+ e->ignore();
+ }
+ break;
+ case Qt::Key_Down:
+ if (m_view && m_view->getSelectCount()) {
+ m_view->moveSelectedBy( 0, 1 );
+ e->accept();
+ } else {
+ e->ignore();
+ }
+ break;
default:
e->ignore();
--- kdesdk/umbrello/umbrello/umllistview.cpp #1.116:1.117
@@ -14,4 +14,5 @@
#include <qpoint.h>
#include <qrect.h>
+#include <qevent.h>
#include <qtooltip.h>
#include <kiconloader.h>
@@ -201,4 +202,16 @@ void UMLListView::contentsMouseReleaseEv
this->KListView::contentsMouseReleaseEvent(me);
}
+
+void UMLListView::keyPressEvent(QKeyEvent *ke) {
+ UMLView *view = UMLApp::app()->getCurrentView();
+ if (view && view->getSelectCount()) {
+ // Widgets have been selected in the diagram area,
+ // assume they handle the keypress.
+ ke->accept(); // munge and do nothing
+ } else {
+ QListView::keyPressEvent(ke); // let parent handle it
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////////////////////////
void UMLListView::popupMenuSel(int sel) {
@@ -1072,4 +1085,6 @@ void UMLListView::slotDropped(QDropEvent
}
UMLListViewItem *newParent = (UMLListViewItem*)item;
+ kdDebug() << "moveObj: newParent->getText() is " << newParent->getText()
+ << endl;
UMLDrag::LvTypeAndID_It it(srcList);
UMLDrag::LvTypeAndID * src = 0;
--- kdesdk/umbrello/umbrello/umllistview.h #1.44:1.45
@@ -29,4 +29,5 @@
class QMouseEvent;
+class QKeyEvent;
class IDChangeLog;
class ListPopupMenu;
@@ -347,4 +348,5 @@ class UMLListView : public KListView {
void tidyChangeItem();
bool acceptDrag (QDropEvent* event) const;
+ void keyPressEvent(QKeyEvent *);
/**
More information about the umbrello-devel
mailing list