* Fix the `clickable` property of `PlotDataItem`.
Currently if you attempt to set the `clickable` property of a PlotDataItem,
this property is silently ignored. The expected behavior is to set the
`clickable` property of the underlying PlotCurveItem.
* Use setCurvesClickable and curvesClickable instead
* curve is singular
- Adds doc strings for user-facing methods so they appear in the
documentation.
- Allows PlotItem.addLegend to accept the same arguments as LegendItem
constructor for convenience.
- Fixes a bug for adding a BarGraphItem (which doesn't have an antialias
option) to LegendItem
This issue was introduced in merging develop into #1175.
While refactoring for the merge, the change in namespace was not
correctly attributed, leading to the parameter `opts` to be assumed
in local namespace when it isn't.
* Do not wrap PlotView/ImageView
There is no need to wrap PlotView/ImageView into QMainWindow, since
only purpose of the QMainWindow is some default menu toolbar & menu
handling, that is not used by PyQtGraph anyway.
Moreover, every parent-less Qt widget can become window, so this
change just use PlotView/ImageView as windows, removing extra
complexity, eg. method forwarding, self.win property.
Another benefit of this change, it that these windows get initial
dimensions and titles as they were designed in .ui file.
* Properly cleanup on ImageView.close()
We should not close explicitly child widgets or clear scene, otherwise
Qt will deallocate children views, and cause "wrapped C/C++ object of
type ImageItem has been deleted" error next time we call close()
and/or some other methods.
All children, including self.ui.roiPlot, self.ui.graphicsView will be
closed together with its parent, so there is no need to close them
explicitly.
So the purpose of close it to reclaim the memory, but not to make the existing ImageView object dysfunctional.
* Remove references to plot & image windows after close
PyQtGraph images and plots module list variables are currently holding
references to all plots and image windows returned directly from main
module. This does not seem to be documented however, and causes the Qt
windows to be not released from memory, even if user releases all own
references.
This change removes the references from images/plots list once window
is closed, so when there is no other reference, window and all related
memory is reclaimed.
* Change all UI forms title from Form to PyQtGraph
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
* changed structure to redefine axis via
plotitem.setAxes
* cleanuup
* remove old axesitems before adding new ones
* DEBUGGED plotitem.setAxes
NEW AxisItem.setOrientation (needed by plotitem.setAxes)
show/hide right axes after .setAxes()
Co-authored-by: Ogi Moore <ognyan.moore@gmail.com>
* Fix duplicate menus in GradientEditorItem
Add call to ev.accept in Tivk.mouseClickEvent to prevent parent menu from opening on a right click of a Tick.
Co-authored-by: Ogi <ognyan.moore@gmail.com>
Add a check in the viewTransformChanged function to only force a rerender when the downsampling factor changed.
Previously simply moving the image around or zooming in/out without changing the downsampling factor would force a complete rerendering of the image, which was very slow with large images. This way, the expensive rerender is only forced if necessary.
* Check and enforce view limits in the setRange function
* Check limits when setting aspectRatio
- This change is required due to moving the limit checking out of the updateViewRange function.
- If the original logic remained, aspect ratio could be lost due to "squshing" the requested view into the viewBox
* Add tests for ViewBox zooming limits and aspect ratio
* - Move test code to proper location and fix instantiation of QApplication
Co-authored-by: Israel Brewster <ijbrewster@alaska.edu>
* 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>