From d552141cda3ec5059875576a4be8b0b04b7d0406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gosselin?= Date: Wed, 16 May 2018 02:15:15 -0400 Subject: [PATCH] Prevent dset info highlighting when circling --- gwhat/widgets/spinboxes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gwhat/widgets/spinboxes.py b/gwhat/widgets/spinboxes.py index 05280a1fe..c1fbb689d 100644 --- a/gwhat/widgets/spinboxes.py +++ b/gwhat/widgets/spinboxes.py @@ -15,6 +15,7 @@ # ---- Imports: Third Parties +from PyQt5.QtCore import Qt from PyQt5.QtWidgets import (QApplication, QDoubleSpinBox, QFileDialog, QGridLayout, QListWidget, QMenu, QMessageBox, QStyle, QToolButton, QWidget, QSpinBox, @@ -29,6 +30,8 @@ def __init__(self, model=None): self.setValue(0) self.setWrapping(True) self.lineEdit().setReadOnly(True) + self.valueChanged.connect( + self.lineEdit().deselect, Qt.QueuedConnection) @property def model(self): @@ -64,8 +67,8 @@ def textFromValue(self, value): if __name__ == '__main__': app = QApplication(sys.argv) - model = {'test': 'patate', 'test2': 'orange'} - text_sp = DictSpinBox(model) + model = ['test', 'patate', 'test2', 'orange'] + text_sp = StrSpinBox(model) text_sp.show() sys.exit(app.exec_())