Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
taste-setup
Commits
ea42ad3e
Commit
ea42ad3e
authored
Nov 08, 2019
by
Maxime Perrotin
Browse files
Make UserWidgets compatible with Pyside and Pyside2
parent
6ea69ccc
Changes
1
Hide whitespace changes
Inline
Side-by-side
misc/AutoGUI/UserWidgets.py
View file @
ea42ad3e
...
...
@@ -14,8 +14,14 @@ import sys
import
os
import
importlib
from
PySide.QtCore
import
(
QObject
,
Signal
,
Slot
,
Qt
,
QTimer
)
import
PySide.QtGui
as
QtGui
try
:
from
PySide.QtCore
import
(
QObject
,
Signal
,
Slot
,
Qt
,
QTimer
)
from
PySide.QtGui
import
*
except
ImportError
:
# When using Python3/PySide2
from
PySide2.QtCore
import
*
from
PySide2.QtGui
import
*
from
PySide2.QtWidgets
import
*
from
asn1_value_editor
import
UserWidgetsCommon
...
...
@@ -34,11 +40,11 @@ class CustomTC_Widget(UserWidgetsCommon.TC):
self
.
_asn1_typename
=
asn1_typename
# examples of widgets
#self.widget =
QtGui.
QListWidget()
#self.widget = QListWidget()
#self.widget.itemClicked.connect(self.select)
#self.setWidget(self.widget)
#self.widget =
QtGui.
QPushButton(asn1_typename)
#self.widget = QPushButton(asn1_typename)
#self.widget.clicked.connect(self.clicked))
#self.setWidget(self.widget)
...
...
@@ -113,5 +119,5 @@ class CustomTM_Widget(UserWidgetsCommon.TM):
if
__name__
==
'__main__'
:
print
'This module can only be imported from the main TASTE guis'
print
(
'This module can only be imported from the main TASTE guis'
)
sys
.
exit
(
-
1
)
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