Commit Graph

33 Commits

Author SHA1 Message Date
Kyle Sunden
6a59b7e5b5
Many unused import cleanups (#1935)
* Many unused import cleanups

Ignored some star imports, some vendored code in colorama, only looked within pyqtgraph the library, not e.g. examples

* SpinBox decimal imported with both import and from import
2021-07-31 07:35:23 -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
e892ad37aa Add missing enums 2021-06-10 21:28:19 -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
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
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
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
f863390409 change MidButton to MiddleButton
the former is no longer present in Qt 6 as an alias
2021-01-15 08:25:05 +08:00
Charles Brunet
4575decf6f
Prevent item duplication in Node context menu (#1361)
* Prevent item duplication in Node context menu

* Prevent duplicated items on Terminal context menu

* try better solution to prevent item duplication
2020-11-11 09:02:46 -08:00
Carlos Pascual
3aa3e9b991
Emit signal when GraphicScene.addItem() is used (#1388)
* Emit signal when GraphicScene.addItem() is used

Emit a signal (sigItemAdded) just after adding an item to a scene.
The item object is emited as the only signal argument.
This signal is useful for code that may want to react to newly added
items of a plot.

* Emit signal when GraphicScene.removeItem() is used

Emit a signal (sigItemRemoved) just after removing an item from a scene.
The item object is emited as the only signal argument.
This signal is useful for code that may want to react to removed
items in a plot.
2020-11-06 14:06:53 -08:00
Gianfranco Costamagna
32a79f18a4 sip: switch to new PyQt5 api import, with fallback to the old implementation if not found.
Also calls to setapi are not needed anymore, so use them only with the old implementation.

See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966045
for reference
2020-07-27 14:52:07 +02:00
Ogi Moore
ce6da3e93f First pass at implementing the diff from PR307 2020-06-24 23:34:17 -07:00
Ales Erjavec
02b7532706 Remove use of GraphicsScene._addressCache in translateGraphicsItem
Use QGraphicsItem.toQGrapicsObject on the item instead.

This probably is not even needed since PyQt 4.9
2020-05-01 13:05:51 +02:00
Kenneth Lyons
faef56c3e7 Qulogic py3 fixes (#1073)
* py3k: Remove reduce calls.

* py3k: Remove compatibility sortList function.

Sorting by key has existed since Python 2.4.

* Remove unnecessary sys.path manipulation.

This file doesn't have any __main__ code to run anyway.

* Use context manager
2019-11-12 08:45:42 -08:00
miranis
e3884ebd20 Update GraphicsScene.py (#599)
In lines 174 and 191 cev[0] is being accessed when cev is an empty list. I get this error when inheriting from GraphicsLayoutWidget and overloading mouseDoubleClickEvent.
2019-09-12 20:24:48 -07:00
Ogi Moore
2f4ac51a11
Check if items having events sent to are still in the scene (#919)
Check if items having events sent to are still in the scene
2019-06-19 22:08:54 -07:00
Luke Campagnola
58a865e088 Add signal documentation for graphicsscene 2018-04-25 13:19:50 -07:00
Luke Campagnola
8f7b55302f Added PolyLineROI unit tests, fixed several bugs in mouse interaction with PolyLineROI. 2016-05-30 18:00:19 -07:00
Luke Campagnola
2b9f613eab Added unit tests checking infiniteline interactivity 2016-02-03 23:13:58 -08:00
Luke Campagnola
0976991efd Import from python2_3 for all uses of basestring, cmp, and xrange 2015-05-19 09:29:55 -04:00
Luke Campagnola
f6ded808ef Fixed a few exit crashes, added unit tests to cover them 2014-11-26 21:25:17 -05:00
Luke Campagnola
4896de5ee4 Fixed item context menus appearing after mouse has exited the item area.
This occurred because the scene does not receive mouse move events while a context menu is displayed.
If the user right-clicks on a new location while the menu is open, then the click event is delieverd as if the mouse had not moved.

Corrected by sending a just-in-time hover event immediately before mouse press, if the cursor has moved.
2014-08-15 12:45:35 -04:00
Luke Campagnola
5488f9ec84 Added BarGraphItem.shape() to allow better mouse interaction 2014-02-09 10:38:29 -05:00
Luke Campagnola
f21e0b86a4 fixed circular import 2013-12-23 10:22:53 -05:00
Luke Campagnola
a2e8290d8e console, graphicsscene, and 2nd-level graphicsitems 2013-12-23 07:51:33 -05:00
Luke Campagnola
19cf49bc7d fixed context menu handling for non-GraphicsItems 2013-11-21 23:29:03 -05:00
Antony Lee
23a0d6d7c0 Use actions of ViewBox's contextMenu in full menu.
The main change is on `ViewBox.getContextMenus`, which now returns an
up-to-date of actions that `GraphicsScene.addParentContextMenus` can use.

Also, `getContextMenus` was given a default implementation in the base
class (falling back on `getMenu` if defined), and some cleanup was done.
2013-11-20 12:23:07 -08:00
Luke Campagnola
175aef2b75 Bugfix: "QGraphicsScene is not defined" 2013-02-10 13:56:42 -05:00
Luke Campagnola
01b8968a0a Performance improvements:
- AxisItem shows 2 tick levels instead of 3
  - Lots of boundingRect and dataBounds caching
    (improves ViewBox auto-range performance, especially with multiple plots)
  - GraphicsScene avoids testing for hover intersections with non-hoverable items
    (much less slowdown when moving mouse over plots)
These are deep changes; need good testing before we release them.
2013-01-09 22:21:32 -05:00
Luke Campagnola
af59296231 Reorganized directory structure to be more standard
Started new SVG exporter
Merged updates from ACQ4
2012-12-25 00:43:31 -05:00