Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

status: use QApplication.startDragTime()

Changeset 3b7523fefcb0

Parent 0e3d48ffbd55

by Steve Borho

Changes to one file · Browse files at 3b7523fefcb0 Showing diff from parent 0e3d48ffbd55 Diff from another changeset...

 
14
15
16
 
17
18
19
 
393
394
395
 
396
397
398
399
400
401
 
 
 
 
 
 
 
402
403
404
 
14
15
16
17
18
19
20
 
394
395
396
397
398
399
400
 
 
 
401
402
403
404
405
406
407
408
409
410
@@ -14,6 +14,7 @@
   from PyQt4.QtCore import Qt, QVariant, SIGNAL, SLOT, QAbstractTableModel  from PyQt4.QtCore import QObject, QEvent, QMimeData, QUrl, QString, QSettings +from PyQt4.QtCore import QTime  from PyQt4.QtGui import QWidget, QVBoxLayout, QSplitter, QTreeView, QLineEdit  from PyQt4.QtGui import QTextEdit, QFont, QColor, QDrag, QApplication  from PyQt4.QtGui import QFrame, QHBoxLayout, QLabel, QPushButton, QMenu @@ -393,12 +394,17 @@
    def mousePressEvent(self, event):   self.pressPos = event.pos() + self.pressTime = QTime.currentTime()   return QTreeView.mousePressEvent(self, event)     def mouseMoveEvent(self, event): - if (event.pos() - self.pressPos).manhattanLength() > \ - QApplication.startDragDistance(): - self.dragObject() + d = event.pos() - self.pressPos + if d.manhattanLength() < QApplication.startDragDistance(): + return + elapsed = self.pressTime.msecsTo(QTime.currentTime()) + if elapsed < QApplication.startDragTime(): + return + self.dragObject()   return QTreeView.mouseMoveEvent(self, event)     def customContextMenuRequested(self, point):