summaryrefslogtreecommitdiff
path: root/silx/gui/qt/_qt.py
diff options
context:
space:
mode:
Diffstat (limited to 'silx/gui/qt/_qt.py')
-rw-r--r--silx/gui/qt/_qt.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/silx/gui/qt/_qt.py b/silx/gui/qt/_qt.py
index a54ea67..6bf7d93 100644
--- a/silx/gui/qt/_qt.py
+++ b/silx/gui/qt/_qt.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2004-2017 European Synchrotron Radiation Facility
+# Copyright (c) 2004-2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -40,7 +40,7 @@ provides the namespace of PyQt5 over PyQt4, PySide and PySide2.
__authors__ = ["V.A. Sole"]
__license__ = "MIT"
-__date__ = "11/10/2017"
+__date__ = "23/05/2018"
import logging
@@ -78,27 +78,27 @@ elif 'PyQt4.QtCore' in sys.modules:
else: # Then try Qt bindings
try:
- import PyQt4 # noqa
+ import PyQt5 # noqa
except ImportError:
try:
- import PySide # noqa
+ import PyQt4 # noqa
except ImportError:
try:
- import PyQt5 # noqa
+ import PySide # noqa
except ImportError:
try:
import PySide2 # noqa
except ImportError:
raise ImportError(
- 'No Qt wrapper found. Install PyQt4, PyQt5 or PySide2.')
+ 'No Qt wrapper found. Install PyQt5, PyQt4 or PySide2.')
else:
BINDING = 'PySide2'
else:
- BINDING = 'PyQt5'
+ BINDING = 'PySide'
else:
- BINDING = 'PySide'
+ BINDING = 'PyQt4'
else:
- BINDING = 'PyQt4'
+ BINDING = 'PyQt5'
if BINDING == 'PyQt4':
@@ -255,10 +255,10 @@ def exceptionHandler(type_, value, trace):
The script/application willing to use it should implement code similar to:
.. code-block:: python
-
+
if __name__ == "__main__":
sys.excepthook = qt.exceptionHandler
-
+
"""
_logger.error("%s %s %s", type_, value, ''.join(traceback.format_tb(trace)))
msg = QMessageBox()
@@ -268,4 +268,3 @@ def exceptionHandler(type_, value, trace):
msg.setDetailedText(("%s " % value) + ''.join(traceback.format_tb(trace)))
msg.raise_()
msg.exec_()
-