|
17 | 17 | QPainterPathStroker |
18 | 18 | ) |
19 | 19 | from AnyQt.QtCore import ( |
20 | | - Qt, QEvent, QPointF, QRectF, QRect, QSize, QTimer, QPropertyAnimation |
| 20 | + Qt, QEvent, QPointF, QRectF, QRect, QSize, QTime, QTimer, QPropertyAnimation |
21 | 21 | ) |
22 | 22 | from AnyQt.QtCore import pyqtSignal as Signal, pyqtProperty as Property |
23 | 23 |
|
@@ -799,6 +799,9 @@ def __init__(self, widget_description=None, parent=None, **kwargs): |
799 | 799 | self.warningItem = None |
800 | 800 | self.infoItem = None |
801 | 801 |
|
| 802 | + self.mousePressTime = QTime() |
| 803 | + self.mousePressTime.start() |
| 804 | + |
802 | 805 | self.__title = "" |
803 | 806 | self.__processingState = 0 |
804 | 807 | self.__progress = -1 |
@@ -1241,10 +1244,14 @@ def __updateMessages(self): |
1241 | 1244 | origin = origin + QPointF(rect.width() + spacing, 0) |
1242 | 1245 |
|
1243 | 1246 | def mousePressEvent(self, event): |
1244 | | - if self.shapeItem.path().contains(event.pos()): |
1245 | | - return super().mousePressEvent(event) |
1246 | | - else: |
| 1247 | + if self.mousePressTime.elapsed() < QApplication.doubleClickInterval(): |
1247 | 1248 | event.ignore() |
| 1249 | + else: |
| 1250 | + self.mousePressTime.restart() |
| 1251 | + if self.shapeItem.path().contains(event.pos()): |
| 1252 | + return super().mousePressEvent(event) |
| 1253 | + else: |
| 1254 | + event.ignore() |
1248 | 1255 |
|
1249 | 1256 | def mouseDoubleClickEvent(self, event): |
1250 | 1257 | if self.shapeItem.path().contains(event.pos()): |
|
0 commit comments