internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pyqtgraph/pyqtgraph

Issue:
GraphicsLayoutWidget not updating when item removed while not shown
Hey Everyone,

I ran into the following problem today. I am not sure if I am doing something wrong, but the behavior feels unexpected.

- Add 2 lines to a plot
- Add plot to a GraphicsLayoutWidget
- Both lines shown
- Remove plot from GraphicsLayoutWidget
- Remove one line from plot
- Add plot to GraphicsLayoutWidget
- Both lines are visible although DataItem is removed from the plot

I wrote a short example to demonstrate the error
[example.txt](https://github.com/pyqtgraph/pyqtgraph/files/3541759/example.txt)

Obviously a fix would be appreciated, but for now a feasible workaround would be good enough for me as well.

This also causes a memory leak. Even when the removed line object is deleted, it is still shown in the GLW with no user accessible reference to it.

Here is where I stumbled over this:

I have a list of measurements, the user can select. Only the selected plots are shown in GraphicsLayoutWidget.

If the customer changes a setting, more or less graphs are added to each plot. This also happens to plots not currently shown.

Hope you can help me out.

Best
Strey


Discussion:

Resolving patch:
diff --git a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
--- a/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
+++ b/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
@@ -563,8 +563,8 @@ def removeItem(self, item):
         if item in self.dataItems:
             self.dataItems.remove(item)
             
-        if item.scene() is not None:
-            self.vb.removeItem(item)
+        self.vb.removeItem(item)
+        
         if item in self.curves:
             self.curves.remove(item)
             self.updateDecimation()
diff --git a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py
--- a/pyqtgraph/graphicsItems/ViewBox/ViewBox.py
+++ b/pyqtgraph/graphicsItems/ViewBox/ViewBox.py
@@ -399,10 +399,12 @@ def addItem(self, item, ignoreBounds=False):
         """
         if item.zValue() < self.zValue():
             item.setZValue(self.zValue()+1)
+            
         scene = self.scene()
         if scene is not None and scene is not item.scene():
             scene.addItem(item)  ## Necessary due to Qt bug: https://bugreports.qt-project.org/browse/QTBUG-18616
         item.setParentItem(self.childGroup)
+        
         if not ignoreBounds:
             self.addedItems.append(item)
         self.updateAutoRange()
@@ -413,7 +415,12 @@ def removeItem(self, item):
             self.addedItems.remove(item)
         except:
             pass
-        self.scene().removeItem(item)
+        
+        scene = self.scene()
+        if scene is not None:
+            scene.removeItem(item)
+        item.setParentItem(None)
+        
         self.updateAutoRange()
 
     def clear(self):


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
PlotWidget.__getattr__ raises wrong exception type - but this has a simple fix
`hasattr(widget, "some_non_existing_attribute")` raises `NameError` instead of returning `False` for instances of `PlotWidget`. I think that `PlotWidget.__getattr__` (in PlotWidget.py) should raise `AttributeError` instead of `NameError`, which would be converted correctly to `False` by `hasattr`. I believe the same holds for `TabWindow.__getattr__` (in graphicsWindows.py).



Discussion:
This was partially fixed by https://github.com/pyqtgraph/pyqtgraph/commit/52754d48594f713092a7e6b55a6fdcb046f76be6

`TabWindow.__getattr__` still raises a `NameError` so that should be fixed. I believe that's the only one remaining.

Resolving patch:
diff --git a/pyqtgraph/graphicsWindows.py b/pyqtgraph/graphicsWindows.py
--- a/pyqtgraph/graphicsWindows.py
+++ b/pyqtgraph/graphicsWindows.py
@@ -45,10 +45,7 @@ def __init__(self, title=None, size=(800,600)):
         self.show()
         
     def __getattr__(self, attr):
-        if hasattr(self.cw, attr):
-            return getattr(self.cw, attr)
-        else:
-            raise NameError(attr)
+        return getattr(self.cw, attr)
     
 
 class PlotWindow(PlotWidget):


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
Line Labels not visible for small graph values
Hey Everyone,

I found a bug where InfLinLables attached to InfiniteLines are not properly shown, if the total y-range of the graph is too small. Simple example below.

If the label position is big enough (e.g. 0.5) the label sometimes comes into view. But this is not always the case.

The red line label also moves out of sight if you zoom in too much.

### Short description
InfLineLabels are not visible if the Y-Values of a graph are too small

### Code to reproduce
```python
import sys
from PyQt5 import QtWidgets
from PyQt5.QtCore import Qt
import pyqtgraph as pg
from pyqtgraph import mkPen


class Example(QtWidgets.QMainWindow):
    def __init__(self):
        super(Example, self).__init__()

        self.resize(800, 600)

        glw = pg.GraphicsLayoutWidget(self)
        self.setCentralWidget(glw)

        x_vals = [0, 1, 2, 3, 4]
        y_vals1 = [0, 1, 2, 3, 4]
        y_vals2 = [0.000, 0.001, 0.002, 0.003, 0.004]

        plot1 = pg.PlotItem()
        plot2 = pg.PlotItem()

        red_line = plot1.plot(x=x_vals, y=y_vals1, pen="r")
        green_line = plot2.plot(x=x_vals, y=y_vals2, pen="g")

        label_kwargs = {"position": 0.05,
                         "color": "w"}

        plot1.addLine(x=2.5,
                      pen=mkPen('r', style=Qt.DashLine),
                      label="{:.2f}".format(2.5),
                      labelOpts=label_kwargs)

        plot2.addLine(x=2.5,
                      pen=mkPen('g', style=Qt.DashLine),
                      label="{:.2f}".format(2.5),
                      labelOpts=label_kwargs)

        glw.addItem(plot1, 0, 0)
        glw.addItem(plot2, 1, 0)


if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    ex = Example()
    ex.show()
    sys.exit(app.exec_())

```

### Expected behavior
Label of green Infinite line should be at the bottom of the graph, as it is with the red line

### Real behavior
Label is not in the view range and only becomes visible once you zoom out so y=-1 becomes visible

### Tested environment(s)

 * PyQtGraph version: Current development branch
 * Qt Python binding: PyQt 5.12.3
 * Python version: 3.7.4
 * NumPy version: 1.16.3
 * Operating system: Win10
 * Installation method: pip


Discussion:

Resolving patch:
diff --git a/pyqtgraph/graphicsItems/InfiniteLine.py b/pyqtgraph/graphicsItems/InfiniteLine.py
--- a/pyqtgraph/graphicsItems/InfiniteLine.py
+++ b/pyqtgraph/graphicsItems/InfiniteLine.py
@@ -314,8 +314,8 @@ def _computeBoundingRect(self):
         length = br.width()
         left = br.left() + length * self.span[0]
         right = br.left() + length * self.span[1]
-        br.setLeft(left - w)
-        br.setRight(right + w)
+        br.setLeft(left)
+        br.setRight(right)
         br = br.normalized()
         
         vs = self.getViewBox().size()


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
Flowchart context menu shows redundant submenu.
<!-- In the following, please describe your issue in detail! -->
<!-- If some of the sections do not apply, just remove them. -->

### Short description
<!-- This should summarize the issue. -->
The flowchart widget's context menu shows some useless submenu. It is caused by 
https://github.com/pyqtgraph/pyqtgraph/blob/ed6586c7ddd3ad95eadd40cb8fda7c4c1d4c746b/pyqtgraph/flowchart/Flowchart.py#L837-L838

![image](https://user-images.githubusercontent.com/11760870/67123142-74ab3100-f1bd-11e9-8d09-911a758b40c5.png)


### Code to reproduce


### Expected behavior
<!-- What should happen? -->
The submenus should not be created.

### Real behavior
<!-- What happens? -->
The submenu is not created. Only the actions should show.

### Tested environment(s)

 * PyQtGraph version: 0.11.0.dev0+g4b8f56b
 * Qt Python binding: PySide2 5.13.1 Qt 5.13.1
 * Python version: 3.7
 * NumPy version: 1.17.1
 * Operating system: 
 * Installation method: pip install git+https://github.com/pyqtgraph/pyqtgraph

### Additional context



Discussion:

Resolving patch:
diff --git a/pyqtgraph/flowchart/Flowchart.py b/pyqtgraph/flowchart/Flowchart.py
--- a/pyqtgraph/flowchart/Flowchart.py
+++ b/pyqtgraph/flowchart/Flowchart.py
@@ -834,9 +834,9 @@ def reloadLibrary(self):
     def buildMenu(self, pos=None):
         def buildSubMenu(node, rootMenu, subMenus, pos=None):
             for section, node in node.items():
-                menu = QtGui.QMenu(section)
-                rootMenu.addMenu(menu)
-                if isinstance(node, OrderedDict): 
+                if isinstance(node, OrderedDict):
+                    menu = QtGui.QMenu(section)
+                    rootMenu.addMenu(menu)
                     buildSubMenu(node, menu, subMenus, pos=pos)
                     subMenus.append(menu)
                 else:


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
AttributeError: module 'pyqtgraph.widgets' has no attribute 'RemoteGraphicsView'
<!-- In the following, please describe your issue in detail! -->
<!-- If some of the sections do not apply, just remove them. -->

### Short description
<!-- This should summarize the issue. -->
Trying to use RemoteGraphicsView throws an error, says there is no RemoteGraphicsView module
### Code to reproduce
<!-- Please provide a minimal working example that reproduces the issue in the code block below.
     Ideally, this should be a full example someone else could run without additional setup. -->
```python
import pyqtgraph as pg
import numpy as np

view = pg.widgets.RemoteGraphicsView()
```

### Expected behavior
<!-- What should happen? -->
Create a RemoteGraphicsView object
### Real behavior
<!-- What happens? -->

```
>>> view = pg.widgets.RemoteGraphicsView()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'pyqtgraph.widgets' has no attribute 'RemoteGraphicsView'
```

### Tested environment(s)

 * PyQtGraph version: 0.10.0<!-- output of pyqtgraph.__version__ -->
 * Qt Python binding: PyQt5<!-- output of pyqtgraph.Qt.VERSION_INFO -->
 * Python version: 3.7.4
 * NumPy version: 1.16.4 <!-- output of numpy.__version__ -->
 * Operating system: Windows 10
 * Installation method: pip<!-- e.g. pip, conda, system packages, ... -->

### Additional context
If I look in the site-packages folder for pyqtgraph, I can see the RemoteGraphicsView file in the widgets folder, and other widgets load normally


Discussion:
You should be able to import it with

```python
from pyqtgraph.widgets.RemoteGraphicsView import RemoteGraphicsView
```

We could implement some imports in `widgets/__init__.py` to make this a bit less of a hassle -- maybe that should be a separate issue.
That works! I would vote for implementing this into the __init__.py to make it more consistent with other widgets, but closing this now. 
Going to re-open so we remember to submit a PR for this fix.

EDIT: @rwalroth thanks for confirming @ixjlyons 's suggestion worked.
Looking at `widgets/__init__.py` I saw some commented out code

```
#importAll('widgets', globals(), locals(),
          #excludes=['MatplotlibWidget', 'RawImageWidget', 'RemoteGraphicsView'])
```

Looks like there was some intention to not have this guy be included right off the bat.

I'll make a PR with the change and see if anything breaks.

Resolving patch:
diff --git a/pyqtgraph/__init__.py b/pyqtgraph/__init__.py
--- a/pyqtgraph/__init__.py
+++ b/pyqtgraph/__init__.py
@@ -260,6 +260,7 @@ def renamePyc(startDir):
 from .widgets.TableWidget import * 
 from .widgets.ProgressDialog import *
 from .widgets.GroupBox import GroupBox
+from .widgets.RemoteGraphicsView import RemoteGraphicsView
 
 from .imageview import *
 from .WidgetGroup import *


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
nextafter fails in  makeARGB() when maxVal=0
<!-- In the following, please describe your issue in detail! -->
After #955  makeARGB() fails when maxVal=0

<!-- If some of the sections do not apply, just remove them. -->

### Short description
<!-- This should summarize the issue. -->

### Code to reproduce
<!-- Please provide a minimal working example that reproduces the issue in the code block below.
     Ideally, this should be a full example someone else could run without additional setup. -->
```python
import pyqtgraph as pg
import numpy as np

img = np.zeros(shape=[3,3,3], dtype='float')
pg.makeARGB(img, levels=[0,0])
```

### Expected behavior
<!-- What should happen? -->
no error
### Real behavior
<!-- What happens? -->
I get the following error:
```
/usr/lib/python2.7/dist-packages/pyqtgraph/functions.py:1019: RuntimeWarning: divide by zero encountered in double_scalars
  data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=dtype)
/usr/lib/python2.7/dist-packages/pyqtgraph/functions.py:870: RuntimeWarning: invalid value encountered in multiply
  d2 *= scale
```

### Tested environment(s)

 * PyQtGraph version: develop branch
 * Qt Python binding: 5.7
 * Python version:  2.7
 * NumPy version: 1:1.12.1
 * Operating system: debian
 * Installation method: packages, git

### Additional context



Discussion:

Resolving patch:
diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py
--- a/pyqtgraph/functions.py
+++ b/pyqtgraph/functions.py
@@ -1134,7 +1134,9 @@ def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False):
             if minVal != 0 or maxVal != scale:
                 if minVal == maxVal:
                     maxVal = np.nextafter(maxVal, 2*maxVal)
-                data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=dtype)
+                rng = maxVal-minVal
+                rng = 1 if rng == 0 else rng
+                data = rescaleData(data, scale/rng, minVal, dtype=dtype)
 
     profile()
     # apply LUT if given


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
SVGExporter: Pixel images are blurred
<!-- In the following, please describe your issue in detail! -->
<!-- If some of the sections do not apply, just remove them. -->

### Short description
In exported SVGs, pixel images are blurred.

### Code to reproduce
<!-- Please provide a minimal working example that reproduces the issue in the code block below.
     Ideally, this should be a full example someone else could run without additional setup. -->
```python
import numpy as np
import pyqtgraph as pg
from  pyqtgraph import exporters

app = pg.mkQApp()

arr = np.array([[1,2],[3,4]])
pw = pg.PlotWindow()
img = pg.ImageItem(arr)
pw.addItem(img)

ex = exporters.SVGExporter(pw.plotItem)
ex.export(fileName="test.svg")
```

Screenshots are taken in Inkscape.

### Expected behavior
![image](https://user-images.githubusercontent.com/31772910/78727594-5be23380-7935-11ea-8f8a-96abe546e363.png)



### Real behavior
![image](https://user-images.githubusercontent.com/31772910/78727146-2a1c9d00-7934-11ea-94ca-61c42b19fd48.png)

### Tested environment(s)

 * PyQtGraph version: Latest commit from `develop` ( 88931bc4a57c62445f20a53166306b16c00763bf )
 * Qt Python binding: PyQt5 5.14.1 Qt 5.14.1
 * Python version: 3.8.2
 * NumPy version: 1.18.2
 * Operating system: Linux 5.5.7-1-MANJARO x86_64 19.0.2 Kyria
 * Installation method: Executed from source package


Discussion:

Resolving patch:
diff --git a/pyqtgraph/exporters/SVGExporter.py b/pyqtgraph/exporters/SVGExporter.py
--- a/pyqtgraph/exporters/SVGExporter.py
+++ b/pyqtgraph/exporters/SVGExporter.py
@@ -69,6 +69,13 @@ def export(self, fileName=None, toBytes=False, copy=False):
 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  version="1.2" baseProfile="tiny">
 <title>pyqtgraph SVG export</title>
 <desc>Generated with Qt and pyqtgraph</desc>
+<style>
+    image {
+        image-rendering: crisp-edges;
+        image-rendering: -moz-crisp-edges;
+        image-rendering: pixelated;
+    }
+</style>
 """
 
 def generateSvg(item, options={}):


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
Plots after event loop has started does not update axes immediately
<!-- In the following, please describe your issue in detail! -->
<!-- If some of the sections do not apply, just remove them. -->

### Short description
<!-- This should summarize the issue. -->
When plotting data after the event loop has started, the axes are not updated immediately.

Results of git bisection:
d77ad273c71870881c3fda3d2b49d3488f100425 is the first bad commit
commit d77ad273c71870881c3fda3d2b49d3488f100425
Author: 2xB <31772910+2xB@users.noreply.github.com>
Date:   Sat Aug 17 20:52:45 2019 +0200

### Code to reproduce
<!-- Please provide a minimal working example that reproduces the issue in the code block below.
     Ideally, this should be a full example someone else could run without additional setup. -->
```python
import pyqtgraph

QtCore = pyqtgraph.Qt.QtCore
app = pyqtgraph.mkQApp()

plotwgt = pyqtgraph.PlotWidget()
curve = pyqtgraph.PlotCurveItem()
plotwgt.addItem(curve)

def draw_later():
    curve.setData(list(range(100)))
        
timer = QtCore.QTimer.singleShot(0, draw_later)
plotwgt.show()
app.exec_()
```

### Expected behavior
<!-- What should happen? -->
![plot_good](https://user-images.githubusercontent.com/2657027/77027654-d15f8180-69d1-11ea-80a6-c0889f1b930b.PNG)

### Real behavior
<!-- What happens? -->
![plot_bad](https://user-images.githubusercontent.com/2657027/77027662-d58b9f00-69d1-11ea-857d-72fd4a78fabf.PNG)


### Tested environment(s)

 * PyQtGraph version: 0.11.0rc0
 * Qt Python binding: PyQt5 5.9.2 Qt 5.9.6
 * Python version: Python 3.7.6
 * NumPy version: 1.18.1
 * Operating system: Windows 10 64-bits
 * Installation method: extract to local directory

### Additional context



Discussion:
Thanks for reporting. I'm thinking this is something we should fix for next release. @2xB any insight would be appreciated.

Resolving patch:
diff --git a/pyqtgraph/graphicsItems/PlotCurveItem.py b/pyqtgraph/graphicsItems/PlotCurveItem.py
--- a/pyqtgraph/graphicsItems/PlotCurveItem.py
+++ b/pyqtgraph/graphicsItems/PlotCurveItem.py
@@ -365,11 +365,12 @@ def updateData(self, *args, **kargs):
 
         #self.setCacheMode(QtGui.QGraphicsItem.NoCache)  ## Disabling and re-enabling the cache works around a bug in Qt 4.6 causing the cached results to display incorrectly
                                                         ##    Test this bug with test_PlotWidget and zoom in on the animated plot
+        self.yData = kargs['y'].view(np.ndarray)
+        self.xData = kargs['x'].view(np.ndarray)
+        
         self.invalidateBounds()
         self.prepareGeometryChange()
         self.informViewBoundsChanged()
-        self.yData = kargs['y'].view(np.ndarray)
-        self.xData = kargs['x'].view(np.ndarray)
 
         profiler('copy')
 


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
pg.mkQApp generates warning
<!-- In the following, please describe your issue in detail! -->
<!-- If some of the sections do not apply, just remove them. -->

### Short description
`pg.mkQApp()` generates warning `QSettings::value: Empty key passed`

### Code to reproduce
```python
import pyqtgraph as pg
pg.mkQApp()
```

### Expected behavior
No output

### Real behavior
<!-- What happens? -->
Output to console:
```
QSettings::value: Empty key passed
QSettings::value: Empty key passed
```

### Tested environment(s)

 * PyQtGraph version: Latest commit from `develop` ( 6f4048596b080f71eaec544555159cb7c40c075f )
 * Qt Python binding: PyQt5 5.14.1 Qt 5.14.1
 * Python version: 3.8.2
 * NumPy version: 1.18.2
 * Operating system: Linux 5.5.7-1-MANJARO x86_64 19.0.2 Kyria
 * Installation method: Executed from source package

### Additional context
This is because `mkQApp` calls `QApplication([])`, which according to its documentation should never be called without arguments: See warning in https://doc.qt.io/qt-5/qapplication.html#QApplication


Discussion:

Resolving patch:
diff --git a/pyqtgraph/Qt.py b/pyqtgraph/Qt.py
--- a/pyqtgraph/Qt.py
+++ b/pyqtgraph/Qt.py
@@ -329,9 +329,18 @@ def isQObjectAlive(obj):
 
 
 QAPP = None
-def mkQApp():
-    global QAPP    
+def mkQApp(name="pyqtgraph", qt_args=[]):
+    """
+    Creates new QApplication or returns current instance if existing.
+    
+    ==============  =================================================================================
+    **Arguments:**
+    name            Application name, passed to Qt
+    qt_args         Array of command line arguments passed to Qt
+    ==============  =================================================================================
+    """
+    global QAPP
     QAPP = QtGui.QApplication.instance()
     if QAPP is None:
-        QAPP = QtGui.QApplication([])
+        QAPP = QtGui.QApplication([name] + qt_args)
     return QAPP


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
PolyLineROI context menu displays "Remove ROI" even when ROI is not removable

### Short description
PolyLineROI context menu displays "Remove ROI" even when ROI is not removable.

### Code to reproduce and Real behavior
```python
import pyqtgraph.examples
pyqtgraph.examples.run()
```
Right click on a handle of the PolyLineROI and see the "ROI->Remove ROI" action, although in the source of the example the PolyLineROI is not set to be removable.
![image](https://user-images.githubusercontent.com/3519989/80692605-16e39400-8ad2-11ea-8677-221946d79c05.png)

### Expected behavior
No "Remove ROI" context menu entry should appear in handles of PolyLineROI when it is not set to be removable.

### Tested environment(s)

 * PyQtGraph version: 0.11.0.dev0+g556ba55
 * Qt Python binding: PyQt5 5.9.2 Qt 5.9.6
 * Python version:  3.6
 * NumPy version: 1.18.1
 * Operating system:  Windows 10
 * Installation method: pip



Discussion:

Resolving patch:
diff --git a/pyqtgraph/graphicsItems/ROI.py b/pyqtgraph/graphicsItems/ROI.py
--- a/pyqtgraph/graphicsItems/ROI.py
+++ b/pyqtgraph/graphicsItems/ROI.py
@@ -758,6 +758,9 @@ def getMenu(self):
             remAct.triggered.connect(self.removeClicked)
             self.menu.addAction(remAct)
             self.menu.remAct = remAct
+        # ROI menu may be requested when showing the handle context menu, so
+        # return the menu but disable it if the ROI isn't removable
+        self.menu.setEnabled(self.contextMenuEnabled())
         return self.menu
 
     def removeClicked(self):


Test patch:
Repository: pyqtgraph/pyqtgraph

Issue:
Bugfix: PlotCurveItem.sigClicked emits MouseClickEvent
Hi all,

currently `PlotCurveItem.sigClicked` emits `self`, a `PlotCurveItem`:

```
def mouseClickEvent(self, ev):
    if not self.clickable or ev.button() != QtCore.Qt.LeftButton:
        return
    if self.mouseShape().contains(ev.pos()):
        ev.accept()
        self.sigClicked.emit(self)
```

Since it can be useful to get the MouseClickEvent in the GraphicsView I suggest to either emit
            `self.sigClicked.emit(ev)`
or
            `self.sigClicked.emit(self, ev)`

cheers!



Discussion:
In order to get access to the keyboard modifiers, I currently do the latter: `self.sigClicked.emit(self, ev)`.

I think this PR should similarly change ScatterPlotItem and PlotDataItem, as well as update the docstrings.


Resolving patch:
diff --git a/pyqtgraph/graphicsItems/PlotCurveItem.py b/pyqtgraph/graphicsItems/PlotCurveItem.py
--- a/pyqtgraph/graphicsItems/PlotCurveItem.py
+++ b/pyqtgraph/graphicsItems/PlotCurveItem.py
@@ -613,7 +613,7 @@ def mouseClickEvent(self, ev):
             return
         if self.mouseShape().contains(ev.pos()):
             ev.accept()
-            self.sigClicked.emit(self)
+            self.sigClicked.emit(self, ev)
 
 
 


Test patch: