Commit Graph

1604 Commits

Author SHA1 Message Date
Ogi Moore
56ee690d58
Merge pull request #1527 from ixjlyons/improve-parameter-docs
Improve parametertree documentation coverage
2021-01-30 11:01:08 -08:00
Kenneth Lyons
c24d25bce3 Improve parametertree documentation
- Increase cross-referencing
- Give all built-in parameter and parameter items at least minimal
  docstring
- Start improving coverage of the special options available for some
  parameters
- Organize the built in parameters reference for easier navigation
2021-01-30 10:06:49 -08:00
pijyoi
ce8c3262f8
switch to use of QOpenGLWidget in GraphicsView.py (#1525)
* switch to use of QOpenGLWidget in GraphicsView.py

experimental plotting in PlotCurveItem gets broken by this. so we allow
Qt5 users to opt back to using QGLWidget with the enableExperimental
option.

* allow Qt6 users to turn on enableExperimental

to more easily allow users to see the broken-ness.

* drop QGLWidget, use only QOpenGLWidget
2021-01-30 08:59:29 -08:00
KIU Shueng Chuan
6b7afbf75c remove six module 2021-01-29 16:13:27 +08:00
Ogi Moore
961cdac51c
Infiniteline emits clicked signal event (#1522) 2021-01-28 22:02:51 -08:00
Dennis Göries
5bb3800adc
ItemSample: Allow toggle of visibility via mouse click in LegendItem (#1497)
* Legend toggle directly on ItemSample

* Add invisible Eye icon

* Include package data and remove username from svg

* Allow svg and png in the setup.py and cleanup sg
2021-01-28 21:14:41 -08:00
Sérgio Peixoto
3f02b30140
Bugfix/wrong translate implementation (#1520)
* Removes all translate call on the parameter name and moves them into the title instead allowing to decouple visualization from code logic

* Removes all translate calls from the Exporter class property Name and moves the translation logic when setting the QListWidgetItems for the formatList

* Adds missing call to translation function for the export action on GraphicsScene
2021-01-28 08:42:18 -08:00
KIU Shueng Chuan
2f4ceee1ce fix RemoteSpeedTest shutdown errors
fix BufferError: cannot close exported pointers exist
for some reason, even though the ctypes object falls out of function
scope, it causes a lingering reference.
in any case, the use of ctypes is no longer necessary.

Don't change temporary files mid-way for Darwin
This fixes the CI issues on Darwin.

close the remote process on app shutdown.
2021-01-28 07:19:54 +08:00
Ogi Moore
b54aa3914d
Attempt i18n localization (#1513)
* Trying translate on exporter strings

* Try translate on other misc context menu strings

* First f-string and I screw it up...

* add more translation calls
2021-01-27 11:34:32 -08:00
Ogi Moore
309195ceea
Fix windows hidpi (#1516)
* set environment variables before starting QApp

* fix-422

* Better support of hidpi

* Fix Typo in App-Name

* Remove fontScaleFactor bits

* Add documenation for hidpi displays

* Fix pg not defined
2021-01-27 10:59:07 -08:00
Ogi Moore
85773e4530
Revert "have mkQApp configure QApplication such that it handles HIDPI displays on Windows (#1509)" (#1515)
This reverts commit 98f6b2f1a5.
2021-01-27 10:42:38 -08:00
Ogi Moore
98f6b2f1a5
have mkQApp configure QApplication such that it handles HIDPI displays on Windows (#1509)
* set environment variables before starting QApp

* fix-422

* Better support of hidpi

* Fix Typo in App-Name

* Remove fontScaleFactor bits

* Add documenation for hidpi displays
2021-01-27 10:05:56 -08:00
KIU Shueng Chuan
d96ec314be RemoteGraphicsView.py : fix mouse interactions for Qt 5.12
mouse interactions had previously only been tested on Qt 5.15 and
Qt 6.0, and found to be not working on Qt 5.12.
differences in Qt 5.12 and Qt 5.15 are documented in the comments.

an addition bug found (and fixed) was that right-click was drawing
the pop-up menu away from the mouse position.
2021-01-23 19:28:11 +08:00
KIU Shueng Chuan
5186cbd80b remove Qt4 generated template files 2021-01-23 12:12:20 +08:00
KIU Shueng Chuan
6c760f3de1 add PyQt6 to CI
skip tests that don't work for Qt6

add Qt6 and remove Qt4 from test_examples.py

update README.md

switch mouse tests to use QPointF

this eliminates all the special casing for different bindings
2021-01-23 08:31:00 +08:00
KIU Shueng Chuan
eec411a3c6 fixup Flowchart for PyQt6 2021-01-23 08:31:00 +08:00
KIU Shueng Chuan
d0c062d7e5 Revert "workaround missing setStops binding"
This reverts commit c4addbeaea.
2021-01-23 08:30:59 +08:00
KIU Shueng Chuan
2e688cf672 PySide6 : shim missing binding QGradient.setStops 2021-01-23 08:30:59 +08:00
KIU Shueng Chuan
3a9e81cc49 update RemoteGraphicsView.py for Qt6 2021-01-23 08:30:59 +08:00
KIU Shueng Chuan
c0336acc11 bug: style() should have been styleHint()
Style is enum for { StyleNormal, StyleItalic, StyleOblique }
2021-01-23 08:29:52 +08:00
KIU Shueng Chuan
6dbda78231 Container.py : fix RecursionError 2021-01-23 08:29:52 +08:00
KIU Shueng Chuan
8a091859f1 GradientWidget.py : workaround or-ing of enum flag values 2021-01-23 08:29:52 +08:00
KIU Shueng Chuan
0957735255 AxisItem.py : workaround or-ing of text flags 2021-01-23 08:29:52 +08:00
KIU Shueng Chuan
04e0a5e5af WidgetGroup.py : PyQt6 was taking PyQt4 codepath
we drop PyQt4 codepath
2021-01-23 08:29:51 +08:00
KIU Shueng Chuan
edea696bc3 ROI.py : pyqt6 has no KeyboardModifier class
the correct type to use is actually KeyboardModifiers
2021-01-23 08:29:51 +08:00
KIU Shueng Chuan
13d652c794 convert to QPointF mouse event position
DockDrop.py : use QPointF mouse coords
2021-01-23 08:29:45 +08:00
KIU Shueng Chuan
607db15949 call super() on virtual QWidget methods 2021-01-23 08:29:44 +08:00
KIU Shueng Chuan
0fa4557ad6 don't cast buttons, enums and flags to int 2021-01-23 08:29:44 +08:00
KIU Shueng Chuan
3ce7f58384 import sip from Qt.py 2021-01-23 08:29:43 +08:00
KIU Shueng Chuan
dcbddb0abf add PyQt6 support to Qt.py and functions.py 2021-01-23 08:29:43 +08:00
KIU Shueng Chuan
ab41c03358 generate _pyqt6.py files
VideoTemplate_pyside6.py : regenerate for cuda feature
2021-01-23 08:29:39 +08:00
Ogi Moore
4e070f40bc Fixed typo 2021-01-21 08:48:54 -08:00
Ogi Moore
b3a0051a99 Use os.getenv, not os.environ 2021-01-19 23:23:24 -08:00
Martin Chase
1654cb62ac
Small ImageItem-related improvements (#1501)
* Initial asv configuration

* makeARGB benchmarks are working

* Fix array type checking and allow making QImage in greyscale mode

* Performance improvements

* benchmark minor update

* Add CLI args to video speed test for easier / automated benchmarking

* udpate asv conf

* use a buffer-qimage so we can avoid allocing so much

this should improve performance under windows

* Add CLI args to video speed test for easier / automated benchmarking

* use a buffer-qimage so we can avoid allocing so much

this should improve performance under windows

* playing with numba

* oh, mins/maxes in the other order

* maybe put the cupy in here and see what happens

* pre-alloc for gpu and cpu

* handle possibility of not having cupy

* no numba in this branch

* organize imports

* name them after their use, not their expected device

* cupy.take does not support clip mode, so do it explicitly

* add CUDA option to the VideoSpeedTest

* rename private attr xp to _xp

* handle resizes at the last moment

* cupy is less accepting of lists as args

* or somehow range isn't allowed? what histogram is this?

* construct the array with python objects

* get the python value right away

* put LUT into cupy if needed

* docstring about cuda toolkit version

* better handling and display of missing cuda lib

* lint

* import need

* handle switching between cupy and numpy in a single ImageItem

* only use xp when necessary

we can now depend on numpy >= 1.17, which means __array_function__-implementing cupy can
seamlessly pass into numpy functions. the remaining uses of xp are for our functions which
need to allocate new data structures, an operation that has to be substrate-specific.

remove empty_cupy; just check if the import succeeded, instead.

* use an option to control use of cupy

* convert cupy.ceil array to int for easier mathing

* RawImageWidget gets to use the getCupy function now, too

* raise error to calm linters; rename for clarity

* Add Generated Template Files

* document things better

* cruft removal

* warnings to communicate when cupy is expected but somehow broken

* Merge branch 'cupy-rebase' into 'l/imageitem-performance'

Abundant conflicts; accept theirs in nearly every case.

* playing with settings to suss out timeout

* playing with more stuff to suss out timeout

* replace with empty list

* skip test_ExampleApp on linux+pyside2 only

* clean out some bits that no longer make sense; linty

* ignore airspeed velocity dir

* lint

* tidy up for merge

* lint

* lint, avoid shadowing

* specific import; run-as-script setup

Co-authored-by: Luke Campagnola <luke.campagnola@gmail.com>
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2021-01-19 23:19:03 -08:00
Torsten Sommer
510626c15f
Add NonUniformImage, example and tests. (#509)
* Add NonUniformImage, example and tests.

* Use updated test-data tag

* Fix line ending, remove lut.setLevels keyword arguments call

Co-authored-by: Ogi <ognyan.moore@gmail.com>
2021-01-19 21:43:58 -08:00
Martin Chase
f2b4a15b2d
Performance enhancement: use CUDA in ImageItem (#1466)
* Add CLI args to video speed test for easier / automated benchmarking

* use a buffer-qimage so we can avoid allocing so much

this should improve performance under windows

* playing with numba

* oh, mins/maxes in the other order

* maybe put the cupy in here and see what happens

* pre-alloc for gpu and cpu

* handle possibility of not having cupy

* no numba in this branch

* organize imports

* name them after their use, not their expected device

* cupy.take does not support clip mode, so do it explicitly

* add CUDA option to the VideoSpeedTest

* rename private attr xp to _xp

* handle resizes at the last moment

* cupy is less accepting of lists as args

* or somehow range isn't allowed? what histogram is this?

* construct the array with python objects

* get the python value right away

* put LUT into cupy if needed

* docstring about cuda toolkit version

* better handling and display of missing cuda lib

* lint

* import need

* handle switching between cupy and numpy in a single ImageItem

* only use xp when necessary

we can now depend on numpy >= 1.17, which means __array_function__-implementing cupy can
seamlessly pass into numpy functions. the remaining uses of xp are for our functions which
need to allocate new data structures, an operation that has to be substrate-specific.

remove empty_cupy; just check if the import succeeded, instead.

* use an option to control use of cupy

* convert cupy.ceil array to int for easier mathing

* RawImageWidget gets to use the getCupy function now, too

* raise error to calm linters; rename for clarity

* Add Generated Template Files

* document things better

* cruft removal

* warnings to communicate when cupy is expected but somehow broken

* playing with settings to suss out timeout

* playing with more stuff to suss out timeout

* replace with empty list

* skip test_ExampleApp on linux+pyside2 only

Co-authored-by: Luke Campagnola <luke.campagnola@gmail.com>
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
2021-01-19 21:26:24 -08:00
Ogi Moore
78bc0fd3ca
Merge pull request #1495 from pijyoi/future_compat
some fixes for PySide6 future compatibility
2021-01-19 21:05:50 -08:00
Ogi Moore
ee623c0fa9 Get testdata using checkout action 2021-01-19 20:20:19 -08:00
KIU Shueng Chuan
b6e713c306 bug: AlignCenter should have been AlignHCenter
from the Qt documentation,
- "AlignCenter = AlignVCenter | AlignHCenter"
- "You can use at most one horizontal and one vertical flag at a time.
  Qt::AlignCenter counts as both horizontal and vertical"
- "Conflicting combinations of flags have undefined meanings"

for AxisItem.py, from the code structure, it would appear that the
intent was to use AlignHCenter.

for ROI.py, AlignCenter == AlignCenter | AlignVCenter
2021-01-19 09:45:56 +08:00
KIU Shueng Chuan
9f54baed0c test_reload.py: skip for PySide6 and Python 3.9 2021-01-16 14:37:21 +08:00
KIU Shueng Chuan
d0a7ceea2d relax image tolerance for PySide6 2021-01-16 14:37:21 +08:00
KIU Shueng Chuan
28c0ea4b33 test_ref_cycles.py : change skip criteria
test_ImageView()
- PySide6 fails the same as PySide2

test_PlotWidget() and test_GraphicsWindow()
- PySide6 succeeds.
- PySide2 also succeeds. (at least on Linux and on version 5.15.2)
2021-01-16 14:37:21 +08:00
Ogi Moore
901f772b5f Skip matplotlib qt6 tests 2021-01-16 14:37:21 +08:00
KIU Shueng Chuan
e03d4be767 fix: QComboBox::AdjustToMinimumContentsLength is no longer available
documentation for Qt 4.8 and Qt 5.12 have advised to "Use
AdjustToContents or AdjustToContentsOnFirstShow instead"

documentation in Qt 5.15 no longer shows AdjustToMinimumContentsLength.
2021-01-16 14:33:47 +08:00
KIU Shueng Chuan
f21dfd9d95 fix get_resolution.py to use QScreen
QDesktopWidget is deprecated in Qt5 and removed in Qt6
2021-01-16 14:33:47 +08:00
KIU Shueng Chuan
4b1a8fe6b4 call GraphicsView.enterEvent() with QEnterEvent
Qt5 prototype is QWidget::enterEvent(QEvent*)
Qt6 prototype is QWidget::enterEvent(QEnterEvent*)
where QEnterEvent inherits from QEvent

RemoteGraphicsView.enterEvent() is actually already called with a
QEnterEvent instance, so all we need to do is to be able to reconstruct
it in Renderer.enterEvent()
2021-01-16 00:16:28 +08:00
KIU Shueng Chuan
74683be68b GraphicsScene.py : check for C++ item live-ness
this gets triggered in PySide6 but not in PyQt5, PySide2.
2021-01-15 13:12:36 +08:00
KIU Shueng Chuan
10530568f0 ScatterPlotItem.py: use non _USE_QRECT codepath for PySide6
verified by using ScatterPlotSpeedTest.py that PySide6 benefits from this.
2021-01-15 12:47:13 +08:00
KIU Shueng Chuan
6c9b910c5c RemoteGraphicsView.py : include PySide6 in PySide family
this is only sufficient to make remote rendering work.

various errors still get triggered under PySide6 when we try remote plotting.
2021-01-15 10:25:24 +08:00
KIU Shueng Chuan
4f619bbb4c update glinfo.py to use QOpenGLWidget 2021-01-15 08:25:09 +08:00