Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
mag-core
Commits
a2790b34
Commit
a2790b34
authored
Oct 26, 2018
by
Tobias WEBER
Browse files
qt4 compatibility
parent
c209c8c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/tascalc/qtas.py
View file @
a2790b34
...
...
@@ -5,25 +5,42 @@
# @license see 'LICENSE' file
#
# -----------------------------------------------------------------------------
# dependencies
import
sys
import
tascalc
as
tas
import
numpy
as
np
import
numpy.linalg
as
la
import
PyQt5
as
qt
import
PyQt5.QtCore
as
qtc
import
PyQt5.QtWidgets
as
qtw
import
sys
# try to import qt5...
try
:
import
PyQt5
as
qt
import
PyQt5.QtCore
as
qtc
import
PyQt5.QtWidgets
as
qtw
qt_ver
=
5
except
ImportError
:
# ...and if not possible try to import qt4 instead
try
:
import
PyQt4
as
qt
import
PyQt4.QtCore
as
qtc
import
PyQt4.QtGui
as
qtw
qt_ver
=
4
except
ImportError
:
print
(
"Error: No suitable version of Qt was found!"
)
exit
(
-
1
)
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# main application
app
=
qtw
.
QApplication
(
sys
.
argv
)
app
.
setApplicationName
(
"qtas"
)
app
.
setStyle
(
"Fusion"
)
sett
=
qtc
.
QSettings
(
"tobis_stuff"
,
"qtas"
)
tabs
=
qtw
.
QTabWidget
()
# -----------------------------------------------------------------------------
...
...
@@ -402,7 +419,10 @@ mainlayout = qtw.QGridLayout(dlg)
mainlayout
.
addWidget
(
tabs
)
if
sett
.
contains
(
"geo"
):
dlg
.
restoreGeometry
(
sett
.
value
(
"geo"
))
geo
=
sett
.
value
(
"geo"
)
if
qt_ver
==
4
:
geo
=
geo
.
toByteArray
()
dlg
.
restoreGeometry
(
geo
)
xtalChanged
()
KiKfChanged
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment