def custom_change_event(self, value): """Emits editingFinished if valueChanged AND left mouse button is down. (i.e. when the user clicks on the spin buttons) Paramters --------- value : float The value of this custom double spin box. """ if QApplication.mouseButtons() & Qt.LeftButton: self.editingFinished.emit()
def updateDragPosition(self): if not self.dragInProgress(): return if not QApplication.mouseButtons() & Qt.LeftButton: self.finishDrag() return pos = QCursor.pos() self.dragIndicator.move(pos + QPoint(1, 1)) foundWrapper = False window = QApplication.topLevelAt(pos) for wrapper in self.wrappers: if wrapper.window() == window: if wrapper.rect().contains(wrapper.mapFromGlobal(pos)): self.findSuggestions(wrapper) if len(self.suggestions) > 0: #starting or restarting timer if self.dropSuggestionSwitchTimer.isActive(): self.dropSuggestionSwitchTimer.stop() self.dropSuggestionSwitchTimer.start() foundWrapper = True break if not foundWrapper: self.handleNoSuggestions()
def custom_change_event(self, value): if QApplication.mouseButtons() & Qt.LeftButton: self.editingFinished.emit()