spurious mouseReleaseEvent caused a crash
authorDiane Trout <diane@caltech.edu>
Wed, 22 Mar 2006 04:44:08 +0000 (04:44 +0000)
committerDiane Trout <diane@caltech.edu>
Wed, 22 Mar 2006 04:44:08 +0000 (04:44 +0000)
For some reason a mouseReleaseEvent was making it to mussa when
using one of the load dialog boxes. This caused a crash.
This patch causes it to not crash.
Though this patch also seems to sometimes select things for no apparent
reason.

qui/seqbrowser/SequenceBrowser.cpp

index 1fac6da4af8773e37b1a3fca91f3dd79a3c24080..00885dd256e20fd2997c92ce26339888f4d74c74 100644 (file)
@@ -126,9 +126,11 @@ void SequenceBrowser::mouseMoveEvent( QMouseEvent *e)
 void SequenceBrowser::mouseReleaseEvent( QMouseEvent *e)
 {
   drawingBand = false;
-  rubberBand->hide();
-  QRect r = QRect(bandOrigin, e->pos()).normalized();
-  bandOrigin = r.topLeft();
-
-  selectRegion(r.top(), r.left(), r.bottom(), r.right());
+  if (rubberBand != 0) {
+    rubberBand->hide();
+    QRect r = QRect(bandOrigin, e->pos()).normalized();
+    bandOrigin = r.topLeft();
+  
+    selectRegion(r.top(), r.left(), r.bottom(), r.right());
+  }
 }