Commit Graph

2926 Commits

Author SHA1 Message Date
ntjess
81823768c0
feature More parameter item types (#1844)
* feature More parameter item types

Pen: Pops up a dialouge that allows the user to customize a pen. Setting pen value is not working yet.
Progress bar: For indication things.
Slider: Easier way to set values that dont require precision.
Fonts: Picking font types. Next thing could be a Font dialog.
Calendar: For picking dates or intervals
Open/save file/files/directory: Pops up an open/save file/directory dialog to select a file/directory. Filter string and caption can be defined too.

A PenSelectorDialog widget was created for the pen parameter item too.

Also added these parameter items to the example.

* PyQt/Side6 compatibility fixup

* Revisions from intial PR

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialog.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/parametertree/parameterTypes.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/parametertree/parameterTypes.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialog.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Update pyqtgraph/widgets/PenSelectorDialogbox.py

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>

* Bugfix: module instead of class import on param tree example

* Enrich the slider parameter

* Address pijyoi comments on pen style parameter

* Different file picker for easier porting

* Better organization and formatting, minor refactoring

* PyQt6/PySide6 fixup for file dialog

* Minor adjustment to file picker

* Bugfix: for 'None' sigChanged

'None' is explicitly allowed for a WidgetParameterItem's `sigChanged` value. However, this raises an error on a changed value unless the commit's fix is applied

* Calendar works better as sub item

* Fixes bugs in pen parameter's dialog + makes it resizable

* more bugfixes and recommended changes, lets pen serialize its options

* better pen save state

* Fixes file parameter qualms

* Fixes font parameter qualms

* Fixes calendar parameter qualms

* Fixes multiply-defined slider optsChanged

* Fixes pen parameter qualms

* ptree example minor bugfix

* Pen dialog bugfixes

* File dialog bugfixes / mild improvements

* unto ptree save state regression

* file fixup

* Adds parameter descriptions to docstrings

* Improved parameter documentation

* adds 'relativeTo' option for file parameter

* Less abuse of Qt enums during or-operations

* More uniform handling of relative paths

* More cleanup of enum setting

* better name for window title (matches qt name)

* Favor os.path over pathlib

* Exposes 'directory', 'windowTitle' to file parameter

* Fixup and add comparison to parameter tree state restoration

* Exposes "cosmetic" in pen parameter

* Indicate defaults in parameter documentation

* QtEnumParameter works for enums outside QtCore.Qt

* see if altering pytest report fixes ci bug

* Cleanup unused import and redundant `self.widget` assignments

Co-authored-by: Fekete Imre <feketeimre87@gmail.com>
Co-authored-by: ChristophRose <42769515+ChristophRose@users.noreply.github.com>
2021-07-23 14:40:49 -07:00
Nils Nemitz
8f96c78715
Extend ColorMap with HSL cycles and subset generation (#1911)
* Extend ColorMap with HSL cycles and subset generation

* relaxed color palette data

* added hex to be installed in colors/maps/
2021-07-23 14:38:17 -07:00
Ogi Moore
d396d33799
Remove the use of pyqtgraph.ptime (#1914)
* Remove the use of pyqtgraph.ptime

With us supporting python3.7+, we have no more need for the ptime module
and can instead safely use perf_counter for everything.

* Address small issues PR turned up

* Reword comment in ImageView
2021-07-22 20:57:50 -07:00
Martin Chase
1d40d50b89
push bullet lists over 2 spaces to get them to show up as such in the… (#1912)
* push bullet lists over 2 spaces to get them to show up as such in the docs

* separate the literal block from the bullet list
2021-07-21 07:12:35 -07:00
Ogi Moore
66ec0996f4
Merge pull request #1610 from j9ac9k/boost-plotline-performance
Boost plotline performance
2021-07-18 13:44:01 -07:00
Ogi Moore
699ed578f4
Merge pull request #1913 from ixjlyons/update-sphinx
Bump sphinx and theme versions
2021-07-18 12:46:09 -07:00
Kenneth Lyons
0ae6b753fc Bump sphinx and theme versions 2021-07-18 12:37:29 -07:00
Ogi Moore
4e293dd17d
Merge pull request #1909 from NilsNemitz/None-check_AxisItem_label
None-check AxisItem.label before access
2021-07-18 10:44:48 -07:00
Nils Nemitz
8b4db67ae9 None-check self.label before access 2021-07-18 17:24:55 +09:00
Ogi Moore
d5990bf32c Uncomment ViewBox.itemChange
This handles calls for ViewBox.prepareForPaint
2021-07-17 22:30:36 -07:00
Dennis Goeries
cdb427ff2f Provide a different plot test 2021-07-17 22:29:06 -07:00
Ogi Moore
ed66eef203
Merge pull request #1902 from pijyoi/simpler_mvp
simplify modelview projection computation
2021-07-17 22:03:32 -07:00
Ogi Moore
58aac09387
Merge pull request #1903 from pijyoi/cleanup_glv
Cleanup GLViewWidget
2021-07-17 21:59:40 -07:00
Kenneth Lyons
ba7129a719
Add option to limit LinearRegionitem bounds to a secondary item (#1834)
* Added clipItem option to LinearRegionItem

* Added a clipItem option to LinearRegionItem

Handle case when no self.viewBox() is yet available

* Implement LinearRegionItem clipItem

* Undo unnecessary change

* Update clipItem doc

* Fixup docstring formatting

* Cleanup

* Support clearing clipItem via setBounds. Fix initialization bug

* Add tests for LinearRegionItem clipItem

* Better clipItem demo in crosshair example

* Another test to verify claim in docstring

Co-authored-by: Arjun Chennu <arjun.chennu@gmail.com>
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
Co-authored-by: Arjun Chennu <achennu@mpi-bremen.de>
2021-07-17 21:02:06 -07:00
KIU Shueng Chuan
cbc9b4d310 catch specific KeyError exception 2021-07-18 10:45:58 +08:00
Ogi Moore
ddab4180e9
Merge pull request #1907 from pijyoi/fix_glvol_arm64
fix GLVolumeItem example for arm64
2021-07-17 18:16:52 -07:00
KIU Shueng Chuan
6f49ede5c1 glDisable(GL_TEXTURE_3D) -> glDisable(GL_TEXTURE_2D) 2021-07-18 09:09:57 +08:00
Ogi Moore
76f3612245
Merge pull request #1904 from Artturin/tests-h5py-optional
tests/exporters/test_hdf5.py: skip if no h5py
2021-07-17 16:35:30 -07:00
Artturin
2de5cd78da tests/exporters/test_hdf5.py: skip if no h5py 2021-07-18 01:26:22 +03:00
Ogi Moore
ddf73c2ecf
Merge pull request #1901 from outofculture/where-will-metaarray-be
put new MetaArray location in deprecation warning
2021-07-17 09:50:16 -07:00
KIU Shueng Chuan
fa77dae941 render upright image (was previously transposed image) 2021-07-17 21:19:48 +08:00
KIU Shueng Chuan
5283eeb71b remove override of devicePixelRatio() 2021-07-17 18:55:55 +08:00
KIU Shueng Chuan
aca627ac8c GLTextItem: use device independent pixels for viewport 2021-07-17 18:39:59 +08:00
KIU Shueng Chuan
31e10fdc1d raise ValueError instead of ctypes.ArgumentError
ctypes.ArgumentError got imported through PyOpenGL import *
2021-07-17 18:29:42 +08:00
KIU Shueng Chuan
f85a1015ad fix GLTextItem to use relative imports 2021-07-17 18:28:09 +08:00
KIU Shueng Chuan
e10dbfd9e1 change examples to use setCameraPosition 2021-07-17 18:25:21 +08:00
KIU Shueng Chuan
6ca81fdddb Revert "restore opts['viewport'] after clobbering"
This reverts commit 7a17cda956.
2021-07-17 18:25:21 +08:00
KIU Shueng Chuan
7a17cda956 restore opts['viewport'] after clobbering 2021-07-17 16:14:25 +08:00
KIU Shueng Chuan
dfd5b5dc1b fix attribute access in failure branch 2021-07-17 16:06:44 +08:00
KIU Shueng Chuan
5b2674c9d5 change some deviceWidth() to width()
viewport / region use device pixels: deviceWidth()
anywhere else uses device independent pixels : width()
2021-07-17 15:59:14 +08:00
KIU Shueng Chuan
f43f795950 don't check opengl version again during paint
we already fail upfront at initializeGL(), so any error that occurs
here won't be due to OpenGL version < 2.0
2021-07-17 15:59:14 +08:00
KIU Shueng Chuan
9bf6c01f58 fix renderToArray() broken for hidpi
define opts['viewport'] to be in device pixels.

note from the removed comments that there was one place assuming
opts['viewport'] was in device pixels and the other assuming that it was
in device independent pixels.
2021-07-17 14:49:47 +08:00
KIU Shueng Chuan
bc52a2afe0 return ValueError for wrong argument, not RuntimeError 2021-07-17 13:46:11 +08:00
KIU Shueng Chuan
fab505a431 remove unneeded call to makeCurrent()
in any case, context will not be valid until the widget is shown.
2021-07-17 13:32:33 +08:00
KIU Shueng Chuan
1814ff535d fail upfront for OpenGL ES instead of during item add 2021-07-17 13:30:20 +08:00
KIU Shueng Chuan
f698ccc06e load background color from configOption 2021-07-17 13:05:40 +08:00
KIU Shueng Chuan
ce4c6d95ed fix setCameraPosition not setting ele and azi in euler mode 2021-07-17 11:04:32 +08:00
KIU Shueng Chuan
b5fc3d2a7e add comment about definition of viewport 2021-07-17 10:40:27 +08:00
KIU Shueng Chuan
1b00d3448a reimplement readQImage()
tested that call to repaint() is not needed
2021-07-17 10:34:27 +08:00
KIU Shueng Chuan
5d7dd101f2 load matrix instead of multiplying to identity 2021-07-17 10:21:26 +08:00
KIU Shueng Chuan
025ca08574 delete empty resizeGL() 2021-07-17 10:17:31 +08:00
KIU Shueng Chuan
ee9b1565bd don't redefine width() and height()
Qt widgets define width() and height() to be in device independent
pixels. Don't change that meaning.
2021-07-17 10:14:53 +08:00
KIU Shueng Chuan
e158034c07 remove devicePixelRatio argument. only needed for Qt4 2021-07-17 09:49:51 +08:00
KIU Shueng Chuan
31f9d0024a simplify modelview projection computation
1) no need to get rect(), which is actually defined as
	QRect(0, 0, width(), height())
2) use col-maj data() instead of row-maj copyDataTo()
   - glLoadMatrixf() takes col-maj
2021-07-17 07:56:21 +08:00
Martin Chase
bcb629495c put new location in deprecation warning 2021-07-16 15:59:23 -07:00
Ogi Moore
d28e1c8075
Merge pull request #1895 from j9ac9k/update-contributing-guide
Update contributing guide ahead of scipy sprints
2021-07-15 21:01:07 -07:00
Ogi Moore
b79171dc3a Update contributing guide ahead of scipy sprints 2021-07-15 20:42:32 -07:00
Ogi Moore
910142aa6f
Merge pull request #1897 from pijyoi/fix_win32_plotcurveitem_opengl
PlotCurveItem: setup modelview and projection
2021-07-15 19:48:20 -07:00
KIU Shueng Chuan
7442ab1e52 PlotCurveItem: setup modelview and projection 2021-07-15 23:16:26 +08:00
Ogi Moore
b9e079b10c
Merge pull request #1889 from swt2c/gltextitem_py310
Fix GLTextItem with Python 3.10
2021-07-12 09:57:01 -07:00