Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benjamin Jakimow
EO Time Series Viewer
Commits
3de57190
Commit
3de57190
authored
Dec 05, 2012
by
Luke Campagnola
Browse files
Merged testing code from Kratz
Numerous fixes for python 3 compatibility
parents
80148920
374e1340
Changes
62
Hide whitespace changes
Inline
Side-by-side
Qt.py
View file @
3de57190
...
...
@@ -42,7 +42,7 @@ else:
versionReq
=
[
4
,
7
]
QtVersion
=
PySide
.
QtCore
.
__version__
if
USE_PYSIDE
else
QtCore
.
QT_VERSION_STR
m
=
re
.
match
(
r
'(\d+)\.(\d+).*'
,
QtVersion
)
if
m
is
not
None
and
map
(
int
,
m
.
groups
())
<
versionReq
:
print
map
(
int
,
m
.
groups
())
if
m
is
not
None
and
list
(
map
(
int
,
m
.
groups
())
)
<
versionReq
:
print
(
map
(
int
,
m
.
groups
())
)
raise
Exception
(
'pyqtgraph requires Qt version >= %d.%d (your version is %s)'
%
(
versionReq
[
0
],
versionReq
[
1
],
QtVersion
))
__init__.py
View file @
3de57190
...
...
@@ -22,7 +22,7 @@ if sys.version_info[0] < 2 or (sys.version_info[0] == 2 and sys.version_info[1]
from
.
import
python2_3
## install workarounds for numpy bugs
import
numpy_fix
from
.
import
numpy_fix
## in general openGL is poorly supported with Qt+GraphicsView.
## we only enable it where the performance benefit is critical.
...
...
@@ -111,7 +111,7 @@ if not hasattr(sys, 'frozen'): ## If we are frozen, there's a good chance we don
## Import almost everything to make it available from a single namespace
## don't import the more complex systems--canvas, parametertree, flowchart, dockarea
## these must be imported separately.
import
frozenSupport
from
.
import
frozenSupport
def
importModules
(
path
,
globals
,
locals
,
excludes
=
()):
"""Import all modules residing within *path*, return a dict of name: module pairs.
...
...
documentation/source/3dgraphics/meshdata.rst
View file @
3de57190
MeshData
========
.. autoclass:: pyqtgraph.opengl.MeshData
.MeshData
.. autoclass:: pyqtgraph.opengl.MeshData
:members:
.. automethod:: pyqtgraph.opengl.MeshData.
MeshData.
__init__
.. automethod:: pyqtgraph.opengl.MeshData.__init__
examples/Arrow.py
View file @
3de57190
...
...
@@ -48,6 +48,7 @@ anim = a.makeAnimation(loop=-1)
anim
.
start
()
## Start Qt event loop unless running in interactive mode or using pyside.
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/CLIexample.py
View file @
3de57190
...
...
@@ -15,6 +15,7 @@ pg.show(data, title="Simplest possible image example")
## Start Qt event loop unless running in interactive mode or using pyside.
import
sys
if
sys
.
flags
.
interactive
!=
1
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
sys
.
flags
.
interactive
!=
1
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
app
.
exec_
()
examples/ColorButton.py
View file @
3de57190
...
...
@@ -25,6 +25,7 @@ btn.sigColorChanging.connect(change)
btn
.
sigColorChanged
.
connect
(
done
)
## Start Qt event loop unless running in interactive mode or using pyside.
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/ConsoleWidget.py
View file @
3de57190
...
...
@@ -23,6 +23,7 @@ c = pyqtgraph.console.ConsoleWidget(namespace=namespace, text=text)
c
.
show
()
## Start Qt event loop unless running in interactive mode or using pyside.
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/DataSlicing.py
View file @
3de57190
# -*- coding: utf-8 -*-
## Add path to library (just for examples; you do not need this)
import
sys
,
os
sys
.
path
.
insert
(
0
,
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'..'
))
import
initExample
import
numpy
as
np
import
scipy
...
...
@@ -52,5 +50,7 @@ imv1.setLevels(-0.003, 0.003)
update
()
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/DataTreeWidget.py
View file @
3de57190
...
...
@@ -30,6 +30,7 @@ tree.resize(600,600)
## Start Qt event loop unless running in interactive mode or using pyside.
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
\ No newline at end of file
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
\ No newline at end of file
examples/Draw.py
View file @
3de57190
...
...
@@ -36,6 +36,7 @@ img.setDrawKernel(kern, mask=kern, center=(1,1), mode='add')
img
.
setLevels
([
0
,
10
])
## Start Qt event loop unless running in interactive mode or using pyside.
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/Flowchart.py
View file @
3de57190
...
...
@@ -97,6 +97,7 @@ fc.connectTerminals(fNode.Out, fc.dataOut)
## Start Qt event loop unless running in interactive mode or using pyside.
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/GLImageItem.py
View file @
3de57190
...
...
@@ -43,5 +43,7 @@ ax = gl.GLAxisItem()
w
.
addItem
(
ax
)
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/GLIsosurface.py
View file @
3de57190
...
...
@@ -47,7 +47,7 @@ data = np.abs(np.fromfunction(psi, (50,50,100)))
print
(
"Generating isosurface.."
)
verts
=
pg
.
isosurface
(
data
,
data
.
max
()
/
4.
)
md
=
gl
.
MeshData
.
MeshData
(
vertexes
=
verts
)
md
=
gl
.
MeshData
(
vertexes
=
verts
)
colors
=
np
.
ones
((
md
.
faceCount
(),
4
),
dtype
=
float
)
colors
[:,
3
]
=
0.2
...
...
@@ -68,5 +68,7 @@ m2.translate(-25, -25, -50)
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/GLMeshItem.py
View file @
3de57190
...
...
@@ -129,5 +129,7 @@ w.addItem(m3)
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/GLScatterPlotItem.py
View file @
3de57190
...
...
@@ -102,5 +102,7 @@ t.start(50)
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/GLSurfacePlot.py
View file @
3de57190
...
...
@@ -94,5 +94,7 @@ timer.timeout.connect(update)
timer
.
start
(
30
)
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/GLViewWidget.py
View file @
3de57190
...
...
@@ -24,5 +24,7 @@ ax2.setParentItem(b)
b
.
translate
(
1
,
1
,
1
)
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/GLVolumeItem.py
View file @
3de57190
...
...
@@ -59,5 +59,7 @@ ax = gl.GLAxisItem()
w
.
addItem
(
ax
)
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/GLshaders.py
View file @
3de57190
...
...
@@ -104,5 +104,7 @@ w.addItem(m6)
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
examples/GradientEditor.py
View file @
3de57190
...
...
@@ -23,5 +23,7 @@ mw.setCentralItem(ge)
## Start Qt event loop unless running in interactive mode.
if
sys
.
flags
.
interactive
!=
1
:
app
.
exec_
()
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
().
exec_
()
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
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