Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Jakimow
EO Time Series Viewer
Commits
2aac1faa
Commit
2aac1faa
authored
11 years ago
by
Luke Campagnola
Browse files
Options
Downloads
Patches
Plain Diff
fixes for python3
parent
4886270b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyqtgraph/widgets/ComboBox.py
+4
-4
4 additions, 4 deletions
pyqtgraph/widgets/ComboBox.py
pyqtgraph/widgets/tests/test_combobox.py
+2
-2
2 additions, 2 deletions
pyqtgraph/widgets/tests/test_combobox.py
with
6 additions
and
6 deletions
pyqtgraph/widgets/ComboBox.py
+
4
−
4
View file @
2aac1faa
from
..Qt
import
QtGui
,
QtCore
from
..SignalProxy
import
SignalProxy
from
..
ordereddict
import
OrderedDict
from
..
pgcollections
import
OrderedDict
from
..python2_3
import
asUnicode
class
ComboBox
(
QtGui
.
QComboBox
):
...
...
@@ -189,9 +189,9 @@ class ComboBox(QtGui.QComboBox):
texts
=
items
items
=
dict
([(
x
,
x
)
for
x
in
items
])
elif
isinstance
(
items
,
dict
):
texts
=
items
.
keys
()
texts
=
list
(
items
.
keys
()
)
else
:
raise
TypeError
(
"
items argument must be list or dict
.
"
)
raise
TypeError
(
"
items argument must be list or dict
(got %s).
"
%
type
(
items
)
)
for
t
in
texts
:
if
t
in
self
.
_items
:
...
...
@@ -200,7 +200,7 @@ class ComboBox(QtGui.QComboBox):
for
k
,
v
in
items
.
items
():
self
.
_items
[
k
]
=
v
QtGui
.
QComboBox
.
addItems
(
self
,
texts
)
QtGui
.
QComboBox
.
addItems
(
self
,
list
(
texts
)
)
self
.
itemsChanged
()
...
...
This diff is collapsed.
Click to expand it.
pyqtgraph/widgets/tests/test_combobox.py
+
2
−
2
View file @
2aac1faa
...
...
@@ -24,7 +24,7 @@ def test_combobox():
assert
cb
.
value
()
==
5
# Set list instead of dict
cb
.
setItems
(
items
.
keys
())
cb
.
setItems
(
list
(
items
.
keys
())
)
assert
str
(
cb
.
currentText
())
==
'
b
'
cb
.
setValue
(
'
c
'
)
...
...
@@ -40,5 +40,5 @@ if __name__ == '__main__':
cb
.
show
()
cb
.
setItems
({
''
:
None
,
'
a
'
:
1
,
'
b
'
:
2
,
'
c
'
:
3
})
def
fn
(
ind
):
print
"
New value:
"
,
cb
.
value
()
print
(
"
New value:
%s
"
%
cb
.
value
()
)
cb
.
currentIndexChanged
.
connect
(
fn
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment