Repository: pyqtgraph/pyqtgraph

Issue:
FillBetweenItem has no way to change FillRule
<!-- In the following, please describe your issue in detail! -->
<!-- If some of the sections do not apply, just remove them. -->

### Short description
There is currently no way (at least that I have found) to change the fillrule for the painterpath in the FillBetweenItem. being able to set it to winding would be very useful for certain cases.

### 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
from PySide2.QtWidgets import QApplication

win = pg.plot()
win.setWindowTitle('pyqtgraph example: FillBetweenItem')
win.setXRange(0, 1.5)
win.setYRange(0, 1.5)

x1=[0,1,1,0,0]
y1=[0,0,1,1,0]
x2=[0.5,1.5,1.5,0.5,0.5]
y2=[0.5,0.5,1.5,1.5,0.5]
curve1 = win.plot(x=x1, y=y1, pen='k')
curve2 = win.plot(x=x2, y=y2, pen='k')
brushes = [0.5, (100, 100, 255), 0.5]
fill = pg.FillBetweenItem(curve1, curve2,brush=(100,100,255))
win.addItem(fill)

## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
    QApplication.instance().exec_()
```

### Expected behavior
Fill in the overlap

### Real behavior
Hole in the middle.


### Tested environment(s)

 * PyQtGraph version: 0.12.1
 * Qt Python binding: PyQt5 5.15.4 Qt 5.15.2
 * Python version: 3.7.7
 * NumPy version: 1.20.2
 * Operating system: Windows 10
 * Installation method: PIP


Discussion:
Hello, we would be interested in working on this bug as part of our free software development course. Would it be ok and is it still relevant for the project to fix this bug?

We were able to reproduce this bug on ubuntu 22.04 using python 3.5.10 and pyqtgraph 0.11.1

Our next step is to test the bug on the current version of pyqtgraph.
We were able to reproduce this bug on ubuntu 22.04 using python 3.10.12 and the development version of pyqtgraph.

We obtained the following error 
line 21, in <module>
    QApplication.instance().exec_()
AttributeError: 'NoneType' object has no attribute 'exec_' 
 
We had to use the PySide6 library instead of PySide2 to avoid the error.
For the moment, we've extracted the intersection points and used them to create a new polygon to fill the empty space.
The only problem is that when you create a polygon from above, there's a margin around it, which sometimes creates bugs.

Resolving patch:
diff --git a/pyqtgraph/examples/FillBetweenItem.py b/pyqtgraph/examples/FillBetweenItem.py
--- a/pyqtgraph/examples/FillBetweenItem.py
+++ b/pyqtgraph/examples/FillBetweenItem.py
@@ -20,7 +20,8 @@
 mn = mx = np.zeros(len(x))
 curves = [win.plot(x=x, y=np.zeros(len(x)), pen='k') for i in range(4)]
 brushes = [0.5, (100, 100, 255), 0.5]
-fills = [pg.FillBetweenItem(curves[i], curves[i+1], brushes[i]) for i in range(3)]
+fills = [pg.FillBetweenItem(curves[0], curves[3], brushes[0]),
+         pg.FillBetweenItem(curves[1], curves[2], brushes[1])]
 for f in fills:
     win.addItem(f)
 
diff --git a/pyqtgraph/graphicsItems/FillBetweenItem.py b/pyqtgraph/graphicsItems/FillBetweenItem.py
--- a/pyqtgraph/graphicsItems/FillBetweenItem.py
+++ b/pyqtgraph/graphicsItems/FillBetweenItem.py
@@ -23,7 +23,7 @@ def __init__(self, curve1=None, curve2=None, brush=None, pen=None):
         self.updatePath()
         
     def setBrush(self, *args, **kwds):
-        """Change the fill brush. Acceps the same arguments as pg.mkBrush()"""
+        """Change the fill brush. Accepts the same arguments as pg.mkBrush()"""
         QtWidgets.QGraphicsPathItem.setBrush(self, fn.mkBrush(*args, **kwds))
         
     def setPen(self, *args, **kwds):
@@ -55,7 +55,6 @@ def setCurves(self, curve1, curve2):
 
     def curveChanged(self):
         self.updatePath()
-
     def updatePath(self):
         if self.curves is None:
             self.setPath(QtGui.QPainterPath())
@@ -69,14 +68,18 @@ def updatePath(self):
 
         path = QtGui.QPainterPath()
         transform = QtGui.QTransform()
+
         ps1 = paths[0].toSubpathPolygons(transform)
         ps2 = paths[1].toReversed().toSubpathPolygons(transform)
         ps2.reverse()
+
         if len(ps1) == 0 or len(ps2) == 0:
             self.setPath(QtGui.QPainterPath())
             return
         
-            
         for p1, p2 in zip(ps1, ps2):
-            path.addPolygon(p1 + p2)
+            intersection = p1.intersected(p2)
+            if not intersection.isEmpty():
+                path.addPolygon(intersection)
+            path.addPolygon(p1 + p2)       
         self.setPath(path)


Test patch: