Commit Graph

66 Commits

Author SHA1 Message Date
Kyle Sunden a472f8c5de
Remove all usage of python2_3.py (#1939)
* Remove all usage of python2_3.py

Technically these functions were exported at the top level of the library, this removes them without warning... If we want to we can bring them back for there, but I honestly don't think its needed, as we are py3 only now and have been for multiple releases.

This may introduce a number of 'useless cast' or similar but those were always happening anyway

This PR brought to you by sed

* Update varname in hdf example to avoid collision with builtin

* Clean up some leftover comments surrounding imports of compat code

* Unnecessary string casts

* Additional unnecessary casts

* syntax error fix

* more unnecessary casts

* Yet more unnecessary casts
2021-08-01 21:43:32 -07:00
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
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 d455da9aec Use Qt6 Enum Namespace
This namespace appears to be valid in PySide2/PyQt5 5.12+ so we may as
well migrate to the newer namespace ourselves.
2021-06-08 21:23:49 -07:00
lidstrom83 6519734932
Deprecate unused/unnecessary modules (#1576)
* Deprecate ordereddict module

* Import OrderedDict from collections module instead of pgcollections

* Deprecate pgcollections module

* Deprecate lru_cache module

A simpler recipe exists from the standard library using OrderedDict.

* Deprecate pil_fix module

* Python 3.7 compatibility fix

* Avoid or suppress deprecation warnings in tests
2021-02-15 09:52:06 -08:00
Dennis Göries bac2ff5b4b
GraphIcons: Extend and deprecate previous pixmaps (#1534)
* GraphPixmaps: deprecate pixmaps

* Deprecation print

* More doc strings and deprecation warning
2021-02-05 21:09:59 -08:00
Kenneth Lyons 66c77118dc
Support suffix for int parameters (#1528)
* Support suffix for int parameters

* Fix spinbox test for new int formatting

* Tune up SpinBox tests a bit
2021-02-03 12:30:05 -08:00
Ogi Moore 0495f1dcce Replace deprecated method with suggested one 2021-01-31 20:39:07 -08:00
Ogi Moore 7b3fdda1e4 Merge branch 'master' into ptree 2021-01-31 13:36:53 -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
KIU Shueng Chuan 119c5fa3d0 convert QTreeWidget.setFirstItemColumnSpanned
convert QTreeWidget.setFirstItemColumnSpanned(item, True) to
item.setFirstColumnSpanned(True)

the former is deprecated since Qt 5.15.2 and removed in Qt 6.
2021-01-15 08:25:05 +08:00
Daniel Lidstrom daafb1d801 Revert previous commit 2020-12-23 00:05:36 -08:00
Daniel Lidstrom c2f0de0471 Attempt at passing Qt 4 CI pipelines 2020-12-21 23:15:57 -08:00
Daniel Lidstrom 6a8f7779dc Add tool tip support to action and group parameters 2020-12-21 23:09:19 -08:00
Daniel Lidstrom 2260030845 Focus change bug fix 2020-12-21 22:34:12 -08:00
Daniel Lidstrom 4618c705e2 Fixed bug where enabled opt is not respected 2020-12-21 20:40:34 -08:00
Daniel Lidstrom fab7b20094 ColorButton sizeHint override unnecessary 2020-12-21 17:18:34 -08:00
Daniel Lidstrom 944b75ffcd Don't miss any widgets when updating readonly 2020-12-21 17:11:22 -08:00
Daniel Lidstrom 4561b18377 Consistently emit values with Parameter.sigValueChanging 2020-12-21 12:30:08 -08:00
Daniel Lidstrom bea0fc1135 No interaction with WidgetParameterItem.subItem 2020-12-20 22:41:47 -08:00
Daniel Lidstrom 8519efdd8d Changed my mind 2020-12-20 19:12:11 -08:00
Daniel Lidstrom 0703e3db9b Ensure synchronization of parameter and widget's values 2020-12-20 18:43:11 -08:00
Daniel Lidstrom 6313bb8ae3 Avoid deprecation warnings 2020-12-17 19:00:22 -08:00
Daniel Lidstrom d9c6a2764a Removed pointless subclass method 2020-12-17 18:09:51 -08:00
Daniel Lidstrom ba304faa05 Provide size hints for nicer looking trees that don't need to be manually sized 2020-12-17 17:45:04 -08:00
Daniel Lidstrom db43c9447c Allow default button for text and colormap parameters 2020-12-17 09:53:39 -08:00
Daniel Lidstrom edf42114f8 Show colormap as sub item 2020-12-17 01:08:46 -08:00
Daniel Lidstrom 02079aec8a Handle text with WidgetParameterItem and SimpleParameter 2020-12-17 01:07:49 -08:00
Luke Campagnola 7d2fbe7596
Fix name/title handling (#1356)
- Parameters now respond to title change in setOpts
- Add Parameter.title()
- Action parameter uses default name/title handling in addition to setting button text (fixes #1320)
2020-10-26 21:56:26 -07:00
lidstrom83 cff19f3271
Hide WidgetParameterItem.defaultBtn if param has no default (#1411)
Co-authored-by: Daniel Lidstrom <dlidstrom@russelltech.com>
2020-10-22 08:28:03 -07:00
Luke Campagnola 605b0b2144 code cleanup 2020-07-13 13:45:31 -07:00
Luke Campagnola 78702eea8b code cleanup 2020-07-13 13:06:27 -07:00
Luke Campagnola eb4dd5626f SimpleParameter.setValue: coerce value for int parameters 2020-07-13 13:05:56 -07:00
Kenneth Lyons 96d1ef986f
Merge pull request #330 from lidstrom83/Parameter.defaultBtn_autoDefault
Set parameter's default button autoDefault value to False
2020-06-27 15:12:03 -07:00
2xB 7672b5b725
Fix: Parameter tree ignores user-set 'expanded' state (#1175)
* Fix: Parameter tree ignores user-set 'expanded' state

When setting the 'expanded' state of parameters, this change is not applied
in the graphically visible tree. This commit changes that behaviour by
adding a clause in `ParameterItem.optsChanged` to react to that.

Fixes #1130

* ParameterTree: Add option to synchronize "expanded" state

As seen in #1130, there is interest in synchronizing the "expanded" state
of `Parameter`s in `ParameterTree`s. As a default, this would lead to
users being forced to always have multiple `ParameterTree`s to be
expanded in the exact same way. Since that might not be desirable, this
commit adds an option to customize whether synchronization
of the "expanded" state should happen.

* Fix: Sync Parameter options "renamable" and "removable" with ParameterTrees

Currently, `Parameter` options `renamable` and `removable` are only considered
when building a new `ParameterTree`. This commit makes changes in those
options reflected in the corresponding `ParameterItem`s.

* ParameterTree: Reflect changes in Parameter option 'tip'

* Parameter: When setting "syncExpanded", update "expanded" state directly

Co-authored-by: 2xB <2xB@users.noreply.github.com>
2020-05-30 13:01:39 -07:00
Luke Campagnola 7d979bcf94 Check for missing ptree widget before accessing 2020-05-30 09:30:36 -07:00
2xB 4f1bf8bb18 GroupParameterItem: Did not pass changed options to ParameterItem
`ParameterItem` handles visibility changes in `optsChanged`.
`GroupParameterItem` overrides this function, but never calls
the super function, leading in visibility changes not being
applied. This PR fixes this by calling said function.

Fixes #788
2020-04-12 02:47:23 +02:00
rwalroth 455fdc2a2a Allowed actions to diplay title instead of name (#1069)
ActionParameterItem changed so that if there is
a title it will be displayed, otherwise displays name.
2019-11-19 20:05:45 -08:00
Luke Campagnola 51267f5696 int parameters use integer formatting 2018-04-25 14:54:35 -07:00
Luke Campagnola 2b0559fd75 adjust group parameter fg color 2018-01-31 08:44:09 -08:00
Petras Jokubauskas a15057835a fix: set foreground color for items
which background color is statically set,
so that values of those would be readable
when OS uses dark theme.
2017-10-20 15:35:53 +02:00
Luke Campagnola 812a65461d action parameter minor ui adjustment 2017-09-29 08:59:37 -07:00
Luke Campagnola ce7594b697 Add GroupParameter.sigAddNew signal 2017-09-29 08:59:14 -07:00
Luke Campagnola b4e722f07b Loosen string type checking a bit; let asUnicode throw errors if it
needs to.
2017-07-31 17:16:46 -07:00
Luke Campagnola c719ad4355 Check for existence of QtCore.QString before using it 2017-07-31 17:04:53 -07:00
Luke Campagnola 7761b9a23c Add basic type checking to parameters 2017-05-01 17:09:15 -07:00
Luke Campagnola 4aad24a52d Merge remote-tracking branch 'lidstrom83/Parameter_limits_fix' into spinbox-formatting 2016-12-09 09:54:39 -08:00
Luke Campagnola f0e26d3add Limit lineedit height in parametertree to match spinbox style 2016-12-07 17:34:44 -08:00
Luke Campagnola 65e9052580 Fix parametertree sending bad options to spinbox 2016-12-06 22:56:55 -08:00
Luke Campagnola c7923d3f95 Fix parameters sending 'children' key to setOpts on restoreState (fixes error seen in relativity demo)
Add debug replacement for sys.excepthook that prints full stack trace
2016-10-14 18:38:35 -07:00