+ Thomas Anderson's patch for spacenav

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5242 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
wmayer
2011-12-09 11:29:51 +00:00
parent a5c8113aaa
commit 012e50c524
6 changed files with 123 additions and 56 deletions

View File

@@ -205,11 +205,11 @@ void ObjectLabelObserver::slotRelabelObject(const App::DocumentObject& obj, cons
// make sure that there is a name conflict otherwise we don't have to do anything
if (match) {
// remove number from end to avoid lengthy names
size_t lastpos = label.length()-1;
while (label[lastpos] >= 48 && label[lastpos] <= 57)
lastpos--;
label = label.substr(0, lastpos+1);
// remove number from end to avoid lengthy names
size_t lastpos = label.length()-1;
while (label[lastpos] >= 48 && label[lastpos] <= 57)
lastpos--;
label = label.substr(0, lastpos+1);
label = Base::Tools::getUniqueName(label, objectLabels, 3);
this->current = &obj;
const_cast<App::DocumentObject&>(obj).Label.setValue(label);
@@ -1437,7 +1437,7 @@ public:
(int)event->type());
}
try {
if (event->type() == Spaceball::ButtonEvent::ButtonEventType)
if (event->type() == Spaceball::ButtonEvent::ButtonEventType || Spaceball::MotionEvent::MotionEventType)
return processSpaceballEvent(receiver, event);
else
return QApplication::notify(receiver, event);