提交 bbde461d 编写于 作者: K Kentaro Wada

Use pyqt4v2 which is automatically selected by qtpy with pyqt4>=4.6

上级 daab8101
......@@ -7,7 +7,7 @@ env:
# used by ci-helpers
- SETUP_XVFB=true PIP_DEPENDENCIES='hacking pytest pytest-qt'
matrix:
- PYTEST_QT_API=pyqt4 PYQT_PACKAGE='pyqt=4' PYTHON_VERSION=2.7
- PYTEST_QT_API=pyqt4v2 PYQT_PACKAGE='pyqt=4' PYTHON_VERSION=2.7
- PYTEST_QT_API=pyside2 CONDA_CHANNELS='conda-forge' PYQT_PACKAGE='pyside2' PYTHON_VERSION=2.7
- PYTEST_QT_API=pyside2 CONDA_CHANNELS='conda-forge' PYQT_PACKAGE='pyside2' PYTHON_VERSION=3.6
- PYTEST_QT_API=pyqt5 PYQT_PACKAGE='pyqt=5' PYTHON_VERSION=2.7
......
......@@ -78,18 +78,21 @@ class LabelDialog(QtWidgets.QDialog):
self.edit.setText(item.text())
def validate(self):
if QT5:
if self.edit.text().strip():
self.accept()
text = self.edit.text()
if hasattr(text, 'strip'):
text = text.strip()
else:
if self.edit.text().trimmed():
self.accept()
text = text.trimmed()
if text:
self.accept()
def postProcess(self):
if QT5:
self.edit.setText(self.edit.text().strip())
text = self.edit.text()
if hasattr(text, 'strip'):
text = text.strip()
else:
self.edit.setText(self.edit.text().trimmed())
text = text.trimmed()
self.edit.setText(text)
def popUp(self, text=None, move=True):
# if text is None, the previous label in self.edit is kept
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册