We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Propose removal of `GraphicsScene.ExportDialog.ExporterParameters`
I propose to remove `ExportDialog.exporterParameters`. They are used to remember the export parameters of an exporter when the user switches between exporters (e.g. SVGExporter and ImageExporter).

https://github.com/pyqtgraph/pyqtgraph/blob/db483f8ec22a0d53bd0e71fac69b0045a96c6637/pyqtgraph/GraphicsScene/exportDialog.py#L127-L136

### Reasons

1. I doubt that anyone actually needs this.

2. I would like to create a PR that automatically sets the correct resolution in the ImageExporter and also keeps the correct aspect ratio when the user changes width or height in the ImageExporter (This feature was intended but is currently broken). The problem is that a simple fix would invalidate the rationale behind `ExportDialog.exporterParameters`, because changing the scene item would also update the ImageExporter parameters (and the stored parameters are not used). An elaborate fix would add a lot of clutter code (creating a dictionary of dictionaries for each item and each exporter).
The simple fix is highlighted here:
https://github.com/paulmueller/pyqtgraph/blob/b81f6d66d2b3cf4d334aa31b75b71e68cc7a3796/pyqtgraph/GraphicsScene/exportDialog.py#L101-L111

### Related Bug

As mentioned in my second point, the ImageExporter currently only displays the height and width of the scene and it does not adjust when e.g. a PlotItem is selected (which has different height, widht, aspect ratio). Furthermore, width and height are not updated to match the PlotItem aspect ratio if I change one of width or height.

### Question

Would you accept a PR that gets rid of  `ExportDialog.exporterParameters` and fixes  the related bug?
Propose removal of `GraphicsScene.ExportDialog.ExporterParameters`
I propose to remove `ExportDialog.exporterParameters`. They are used to remember the export parameters of an exporter when the user switches between exporters (e.g. SVGExporter and ImageExporter).

https://github.com/pyqtgraph/pyqtgraph/blob/db483f8ec22a0d53bd0e71fac69b0045a96c6637/pyqtgraph/GraphicsScene/exportDialog.py#L127-L136

### Reasons

1. I doubt that anyone actually needs this.

2. I would like to create a PR that automatically sets the correct resolution in the ImageExporter and also keeps the correct aspect ratio when the user changes width or height in the ImageExporter (This feature was intended but is currently broken). The problem is that a simple fix would invalidate the rationale behind `ExportDialog.exporterParameters`, because changing the scene item would also update the ImageExporter parameters (and the stored parameters are not used). An elaborate fix would add a lot of clutter code (creating a dictionary of dictionaries for each item and each exporter).
The simple fix is highlighted here:
https://github.com/paulmueller/pyqtgraph/blob/b81f6d66d2b3cf4d334aa31b75b71e68cc7a3796/pyqtgraph/GraphicsScene/exportDialog.py#L101-L111

### Related Bug

As mentioned in my second point, the ImageExporter currently only displays the height and width of the scene and it does not adjust when e.g. a PlotItem is selected (which has different height, widht, aspect ratio). Furthermore, width and height are not updated to match the PlotItem aspect ratio if I change one of width or height.

### Question

Would you accept a PR that gets rid of  `ExportDialog.exporterParameters` and fixes  the related bug?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pyqtgraph/GraphicsScene/exportDialog.py`
Content:
```
1 from ..Qt import QtCore, QtGui, QT_LIB
2 from .. import exporters as exporters
3 from .. import functions as fn
4 from ..graphicsItems.ViewBox import ViewBox
5 from ..graphicsItems.PlotItem import PlotItem
6 
7 if QT_LIB == 'PySide':
8     from . import exportDialogTemplate_pyside as exportDialogTemplate
9 elif QT_LIB == 'PySide2':
10     from . import exportDialogTemplate_pyside2 as exportDialogTemplate
11 elif QT_LIB == 'PyQt5':
12     from . import exportDialogTemplate_pyqt5 as exportDialogTemplate
13 else:
14     from . import exportDialogTemplate_pyqt as exportDialogTemplate
15 
16 
17 class ExportDialog(QtGui.QWidget):
18     def __init__(self, scene):
19         QtGui.QWidget.__init__(self)
20         self.setVisible(False)
21         self.setWindowTitle("Export")
22         self.shown = False
23         self.currentExporter = None
24         self.scene = scene
25             
26         self.exporterParameters = {}
27 
28         self.selectBox = QtGui.QGraphicsRectItem()
29         self.selectBox.setPen(fn.mkPen('y', width=3, style=QtCore.Qt.DashLine))
30         self.selectBox.hide()
31         self.scene.addItem(self.selectBox)
32         
33         self.ui = exportDialogTemplate.Ui_Form()
34         self.ui.setupUi(self)
35         
36         self.ui.closeBtn.clicked.connect(self.close)
37         self.ui.exportBtn.clicked.connect(self.exportClicked)
38         self.ui.copyBtn.clicked.connect(self.copyClicked)
39         self.ui.itemTree.currentItemChanged.connect(self.exportItemChanged)
40         self.ui.formatList.currentItemChanged.connect(self.exportFormatChanged)
41         
42 
43     def show(self, item=None):
44         if item is not None:
45             ## Select next exportable parent of the item originally clicked on
46             while not isinstance(item, ViewBox) and not isinstance(item, PlotItem) and item is not None:
47                 item = item.parentItem()
48             ## if this is a ViewBox inside a PlotItem, select the parent instead.
49             if isinstance(item, ViewBox) and isinstance(item.parentItem(), PlotItem):
50                 item = item.parentItem()
51             self.updateItemList(select=item)
52         self.setVisible(True)
53         self.activateWindow()
54         self.raise_()
55         self.selectBox.setVisible(True)
56         
57         if not self.shown:
58             self.shown = True
59             vcenter = self.scene.getViewWidget().geometry().center()
60             self.setGeometry(vcenter.x()-self.width()/2, vcenter.y()-self.height()/2, self.width(), self.height())
61         
62     def updateItemList(self, select=None):
63         self.ui.itemTree.clear()
64         si = QtGui.QTreeWidgetItem(["Entire Scene"])
65         si.gitem = self.scene
66         self.ui.itemTree.addTopLevelItem(si)
67         self.ui.itemTree.setCurrentItem(si)
68         si.setExpanded(True)
69         for child in self.scene.items():
70             if child.parentItem() is None:
71                 self.updateItemTree(child, si, select=select)
72                 
73     def updateItemTree(self, item, treeItem, select=None):
74         si = None
75         if isinstance(item, ViewBox):
76             si = QtGui.QTreeWidgetItem(['ViewBox'])
77         elif isinstance(item, PlotItem):
78             si = QtGui.QTreeWidgetItem(['Plot'])
79             
80         if si is not None:
81             si.gitem = item
82             treeItem.addChild(si)
83             treeItem = si
84             if si.gitem is select:
85                 self.ui.itemTree.setCurrentItem(si)
86             
87         for ch in item.childItems():
88             self.updateItemTree(ch, treeItem, select=select)
89         
90             
91     def exportItemChanged(self, item, prev):
92         if item is None:
93             return
94         if item.gitem is self.scene:
95             newBounds = self.scene.views()[0].viewRect()
96         else:
97             newBounds = item.gitem.sceneBoundingRect()
98         self.selectBox.setRect(newBounds)
99         self.selectBox.show()
100         self.updateFormatList()
101         
102     def updateFormatList(self):
103         current = self.ui.formatList.currentItem()
104         if current is not None:
105             current = str(current.text())
106         self.ui.formatList.clear()
107         self.exporterClasses = {}
108         gotCurrent = False
109         for exp in exporters.listExporters():
110             self.ui.formatList.addItem(exp.Name)
111             self.exporterClasses[exp.Name] = exp
112             if exp.Name == current:
113                 self.ui.formatList.setCurrentRow(self.ui.formatList.count()-1)
114                 gotCurrent = True
115                 
116         if not gotCurrent:
117             self.ui.formatList.setCurrentRow(0)
118         
119     def exportFormatChanged(self, item, prev):
120         if item is None:
121             self.currentExporter = None
122             self.ui.paramTree.clear()
123             return
124         expClass = self.exporterClasses[str(item.text())]
125         exp = expClass(item=self.ui.itemTree.currentItem().gitem)
126 
127         if prev:
128             oldtext = str(prev.text())
129             self.exporterParameters[oldtext] = self.currentExporter.parameters()
130         newtext = str(item.text())
131         if newtext in self.exporterParameters.keys():
132             params = self.exporterParameters[newtext]
133             exp.params = params
134         else:
135             params = exp.parameters()
136             self.exporterParameters[newtext] = params
137 
138         if params is None:
139             self.ui.paramTree.clear()
140         else:
141             self.ui.paramTree.setParameters(params)
142         self.currentExporter = exp
143         self.ui.copyBtn.setEnabled(exp.allowCopy)
144         
145     def exportClicked(self):
146         self.selectBox.hide()
147         self.currentExporter.export()
148         
149     def copyClicked(self):
150         self.selectBox.hide()
151         self.currentExporter.export(copy=True)
152         
153     def close(self):
154         self.selectBox.setVisible(False)
155         self.setVisible(False)
156 
157     def closeEvent(self, event):
158         self.close()
159         QtGui.QWidget.closeEvent(self, event)
160
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pyqtgraph/GraphicsScene/exportDialog.py b/pyqtgraph/GraphicsScene/exportDialog.py
--- a/pyqtgraph/GraphicsScene/exportDialog.py
+++ b/pyqtgraph/GraphicsScene/exportDialog.py
@@ -22,8 +22,6 @@
         self.shown = False
         self.currentExporter = None
         self.scene = scene
-            
-        self.exporterParameters = {}
 
         self.selectBox = QtGui.QGraphicsRectItem()
         self.selectBox.setPen(fn.mkPen('y', width=3, style=QtCore.Qt.DashLine))
@@ -124,16 +122,7 @@
         expClass = self.exporterClasses[str(item.text())]
         exp = expClass(item=self.ui.itemTree.currentItem().gitem)
 
-        if prev:
-            oldtext = str(prev.text())
-            self.exporterParameters[oldtext] = self.currentExporter.parameters()
-        newtext = str(item.text())
-        if newtext in self.exporterParameters.keys():
-            params = self.exporterParameters[newtext]
-            exp.params = params
-        else:
-            params = exp.parameters()
-            self.exporterParameters[newtext] = params
+        params = exp.parameters()
 
         if params is None:
             self.ui.paramTree.clear()

{"golden_diff": "diff --git a/pyqtgraph/GraphicsScene/exportDialog.py b/pyqtgraph/GraphicsScene/exportDialog.py\n--- a/pyqtgraph/GraphicsScene/exportDialog.py\n+++ b/pyqtgraph/GraphicsScene/exportDialog.py\n@@ -22,8 +22,6 @@\n         self.shown = False\n         self.currentExporter = None\n         self.scene = scene\n-            \n-        self.exporterParameters = {}\n \n         self.selectBox = QtGui.QGraphicsRectItem()\n         self.selectBox.setPen(fn.mkPen('y', width=3, style=QtCore.Qt.DashLine))\n@@ -124,16 +122,7 @@\n         expClass = self.exporterClasses[str(item.text())]\n         exp = expClass(item=self.ui.itemTree.currentItem().gitem)\n \n-        if prev:\n-            oldtext = str(prev.text())\n-            self.exporterParameters[oldtext] = self.currentExporter.parameters()\n-        newtext = str(item.text())\n-        if newtext in self.exporterParameters.keys():\n-            params = self.exporterParameters[newtext]\n-            exp.params = params\n-        else:\n-            params = exp.parameters()\n-            self.exporterParameters[newtext] = params\n+        params = exp.parameters()\n \n         if params is None:\n             self.ui.paramTree.clear()\n", "issue": "Propose removal of `GraphicsScene.ExportDialog.ExporterParameters`\nI propose to remove `ExportDialog.exporterParameters`. They are used to remember the export parameters of an exporter when the user switches between exporters (e.g. SVGExporter and ImageExporter).\r\n\r\nhttps://github.com/pyqtgraph/pyqtgraph/blob/db483f8ec22a0d53bd0e71fac69b0045a96c6637/pyqtgraph/GraphicsScene/exportDialog.py#L127-L136\r\n\r\n### Reasons\r\n\r\n1. I doubt that anyone actually needs this.\r\n\r\n2. I would like to create a PR that automatically sets the correct resolution in the ImageExporter and also keeps the correct aspect ratio when the user changes width or height in the ImageExporter (This feature was intended but is currently broken). The problem is that a simple fix would invalidate the rationale behind `ExportDialog.exporterParameters`, because changing the scene item would also update the ImageExporter parameters (and the stored parameters are not used). An elaborate fix would add a lot of clutter code (creating a dictionary of dictionaries for each item and each exporter).\r\nThe simple fix is highlighted here:\r\nhttps://github.com/paulmueller/pyqtgraph/blob/b81f6d66d2b3cf4d334aa31b75b71e68cc7a3796/pyqtgraph/GraphicsScene/exportDialog.py#L101-L111\r\n\r\n### Related Bug\r\n\r\nAs mentioned in my second point, the ImageExporter currently only displays the height and width of the scene and it does not adjust when e.g. a PlotItem is selected (which has different height, widht, aspect ratio). Furthermore, width and height are not updated to match the PlotItem aspect ratio if I change one of width or height.\r\n\r\n### Question\r\n\r\nWould you accept a PR that gets rid of  `ExportDialog.exporterParameters` and fixes  the related bug?\nPropose removal of `GraphicsScene.ExportDialog.ExporterParameters`\nI propose to remove `ExportDialog.exporterParameters`. They are used to remember the export parameters of an exporter when the user switches between exporters (e.g. SVGExporter and ImageExporter).\r\n\r\nhttps://github.com/pyqtgraph/pyqtgraph/blob/db483f8ec22a0d53bd0e71fac69b0045a96c6637/pyqtgraph/GraphicsScene/exportDialog.py#L127-L136\r\n\r\n### Reasons\r\n\r\n1. I doubt that anyone actually needs this.\r\n\r\n2. I would like to create a PR that automatically sets the correct resolution in the ImageExporter and also keeps the correct aspect ratio when the user changes width or height in the ImageExporter (This feature was intended but is currently broken). The problem is that a simple fix would invalidate the rationale behind `ExportDialog.exporterParameters`, because changing the scene item would also update the ImageExporter parameters (and the stored parameters are not used). An elaborate fix would add a lot of clutter code (creating a dictionary of dictionaries for each item and each exporter).\r\nThe simple fix is highlighted here:\r\nhttps://github.com/paulmueller/pyqtgraph/blob/b81f6d66d2b3cf4d334aa31b75b71e68cc7a3796/pyqtgraph/GraphicsScene/exportDialog.py#L101-L111\r\n\r\n### Related Bug\r\n\r\nAs mentioned in my second point, the ImageExporter currently only displays the height and width of the scene and it does not adjust when e.g. a PlotItem is selected (which has different height, widht, aspect ratio). Furthermore, width and height are not updated to match the PlotItem aspect ratio if I change one of width or height.\r\n\r\n### Question\r\n\r\nWould you accept a PR that gets rid of  `ExportDialog.exporterParameters` and fixes  the related bug?\n", "before_files": [{"content": "from ..Qt import QtCore, QtGui, QT_LIB\nfrom .. import exporters as exporters\nfrom .. import functions as fn\nfrom ..graphicsItems.ViewBox import ViewBox\nfrom ..graphicsItems.PlotItem import PlotItem\n\nif QT_LIB == 'PySide':\n    from . import exportDialogTemplate_pyside as exportDialogTemplate\nelif QT_LIB == 'PySide2':\n    from . import exportDialogTemplate_pyside2 as exportDialogTemplate\nelif QT_LIB == 'PyQt5':\n    from . import exportDialogTemplate_pyqt5 as exportDialogTemplate\nelse:\n    from . import exportDialogTemplate_pyqt as exportDialogTemplate\n\n\nclass ExportDialog(QtGui.QWidget):\n    def __init__(self, scene):\n        QtGui.QWidget.__init__(self)\n        self.setVisible(False)\n        self.setWindowTitle(\"Export\")\n        self.shown = False\n        self.currentExporter = None\n        self.scene = scene\n            \n        self.exporterParameters = {}\n\n        self.selectBox = QtGui.QGraphicsRectItem()\n        self.selectBox.setPen(fn.mkPen('y', width=3, style=QtCore.Qt.DashLine))\n        self.selectBox.hide()\n        self.scene.addItem(self.selectBox)\n        \n        self.ui = exportDialogTemplate.Ui_Form()\n        self.ui.setupUi(self)\n        \n        self.ui.closeBtn.clicked.connect(self.close)\n        self.ui.exportBtn.clicked.connect(self.exportClicked)\n        self.ui.copyBtn.clicked.connect(self.copyClicked)\n        self.ui.itemTree.currentItemChanged.connect(self.exportItemChanged)\n        self.ui.formatList.currentItemChanged.connect(self.exportFormatChanged)\n        \n\n    def show(self, item=None):\n        if item is not None:\n            ## Select next exportable parent of the item originally clicked on\n            while not isinstance(item, ViewBox) and not isinstance(item, PlotItem) and item is not None:\n                item = item.parentItem()\n            ## if this is a ViewBox inside a PlotItem, select the parent instead.\n            if isinstance(item, ViewBox) and isinstance(item.parentItem(), PlotItem):\n                item = item.parentItem()\n            self.updateItemList(select=item)\n        self.setVisible(True)\n        self.activateWindow()\n        self.raise_()\n        self.selectBox.setVisible(True)\n        \n        if not self.shown:\n            self.shown = True\n            vcenter = self.scene.getViewWidget().geometry().center()\n            self.setGeometry(vcenter.x()-self.width()/2, vcenter.y()-self.height()/2, self.width(), self.height())\n        \n    def updateItemList(self, select=None):\n        self.ui.itemTree.clear()\n        si = QtGui.QTreeWidgetItem([\"Entire Scene\"])\n        si.gitem = self.scene\n        self.ui.itemTree.addTopLevelItem(si)\n        self.ui.itemTree.setCurrentItem(si)\n        si.setExpanded(True)\n        for child in self.scene.items():\n            if child.parentItem() is None:\n                self.updateItemTree(child, si, select=select)\n                \n    def updateItemTree(self, item, treeItem, select=None):\n        si = None\n        if isinstance(item, ViewBox):\n            si = QtGui.QTreeWidgetItem(['ViewBox'])\n        elif isinstance(item, PlotItem):\n            si = QtGui.QTreeWidgetItem(['Plot'])\n            \n        if si is not None:\n            si.gitem = item\n            treeItem.addChild(si)\n            treeItem = si\n            if si.gitem is select:\n                self.ui.itemTree.setCurrentItem(si)\n            \n        for ch in item.childItems():\n            self.updateItemTree(ch, treeItem, select=select)\n        \n            \n    def exportItemChanged(self, item, prev):\n        if item is None:\n            return\n        if item.gitem is self.scene:\n            newBounds = self.scene.views()[0].viewRect()\n        else:\n            newBounds = item.gitem.sceneBoundingRect()\n        self.selectBox.setRect(newBounds)\n        self.selectBox.show()\n        self.updateFormatList()\n        \n    def updateFormatList(self):\n        current = self.ui.formatList.currentItem()\n        if current is not None:\n            current = str(current.text())\n        self.ui.formatList.clear()\n        self.exporterClasses = {}\n        gotCurrent = False\n        for exp in exporters.listExporters():\n            self.ui.formatList.addItem(exp.Name)\n            self.exporterClasses[exp.Name] = exp\n            if exp.Name == current:\n                self.ui.formatList.setCurrentRow(self.ui.formatList.count()-1)\n                gotCurrent = True\n                \n        if not gotCurrent:\n            self.ui.formatList.setCurrentRow(0)\n        \n    def exportFormatChanged(self, item, prev):\n        if item is None:\n            self.currentExporter = None\n            self.ui.paramTree.clear()\n            return\n        expClass = self.exporterClasses[str(item.text())]\n        exp = expClass(item=self.ui.itemTree.currentItem().gitem)\n\n        if prev:\n            oldtext = str(prev.text())\n            self.exporterParameters[oldtext] = self.currentExporter.parameters()\n        newtext = str(item.text())\n        if newtext in self.exporterParameters.keys():\n            params = self.exporterParameters[newtext]\n            exp.params = params\n        else:\n            params = exp.parameters()\n            self.exporterParameters[newtext] = params\n\n        if params is None:\n            self.ui.paramTree.clear()\n        else:\n            self.ui.paramTree.setParameters(params)\n        self.currentExporter = exp\n        self.ui.copyBtn.setEnabled(exp.allowCopy)\n        \n    def exportClicked(self):\n        self.selectBox.hide()\n        self.currentExporter.export()\n        \n    def copyClicked(self):\n        self.selectBox.hide()\n        self.currentExporter.export(copy=True)\n        \n    def close(self):\n        self.selectBox.setVisible(False)\n        self.setVisible(False)\n\n    def closeEvent(self, event):\n        self.close()\n        QtGui.QWidget.closeEvent(self, event)\n", "path": "pyqtgraph/GraphicsScene/exportDialog.py"}], "after_files": [{"content": "from ..Qt import QtCore, QtGui, QT_LIB\nfrom .. import exporters as exporters\nfrom .. import functions as fn\nfrom ..graphicsItems.ViewBox import ViewBox\nfrom ..graphicsItems.PlotItem import PlotItem\n\nif QT_LIB == 'PySide':\n    from . import exportDialogTemplate_pyside as exportDialogTemplate\nelif QT_LIB == 'PySide2':\n    from . import exportDialogTemplate_pyside2 as exportDialogTemplate\nelif QT_LIB == 'PyQt5':\n    from . import exportDialogTemplate_pyqt5 as exportDialogTemplate\nelse:\n    from . import exportDialogTemplate_pyqt as exportDialogTemplate\n\n\nclass ExportDialog(QtGui.QWidget):\n    def __init__(self, scene):\n        QtGui.QWidget.__init__(self)\n        self.setVisible(False)\n        self.setWindowTitle(\"Export\")\n        self.shown = False\n        self.currentExporter = None\n        self.scene = scene\n\n        self.selectBox = QtGui.QGraphicsRectItem()\n        self.selectBox.setPen(fn.mkPen('y', width=3, style=QtCore.Qt.DashLine))\n        self.selectBox.hide()\n        self.scene.addItem(self.selectBox)\n        \n        self.ui = exportDialogTemplate.Ui_Form()\n        self.ui.setupUi(self)\n        \n        self.ui.closeBtn.clicked.connect(self.close)\n        self.ui.exportBtn.clicked.connect(self.exportClicked)\n        self.ui.copyBtn.clicked.connect(self.copyClicked)\n        self.ui.itemTree.currentItemChanged.connect(self.exportItemChanged)\n        self.ui.formatList.currentItemChanged.connect(self.exportFormatChanged)\n        \n\n    def show(self, item=None):\n        if item is not None:\n            ## Select next exportable parent of the item originally clicked on\n            while not isinstance(item, ViewBox) and not isinstance(item, PlotItem) and item is not None:\n                item = item.parentItem()\n            ## if this is a ViewBox inside a PlotItem, select the parent instead.\n            if isinstance(item, ViewBox) and isinstance(item.parentItem(), PlotItem):\n                item = item.parentItem()\n            self.updateItemList(select=item)\n        self.setVisible(True)\n        self.activateWindow()\n        self.raise_()\n        self.selectBox.setVisible(True)\n        \n        if not self.shown:\n            self.shown = True\n            vcenter = self.scene.getViewWidget().geometry().center()\n            self.setGeometry(vcenter.x()-self.width()/2, vcenter.y()-self.height()/2, self.width(), self.height())\n        \n    def updateItemList(self, select=None):\n        self.ui.itemTree.clear()\n        si = QtGui.QTreeWidgetItem([\"Entire Scene\"])\n        si.gitem = self.scene\n        self.ui.itemTree.addTopLevelItem(si)\n        self.ui.itemTree.setCurrentItem(si)\n        si.setExpanded(True)\n        for child in self.scene.items():\n            if child.parentItem() is None:\n                self.updateItemTree(child, si, select=select)\n                \n    def updateItemTree(self, item, treeItem, select=None):\n        si = None\n        if isinstance(item, ViewBox):\n            si = QtGui.QTreeWidgetItem(['ViewBox'])\n        elif isinstance(item, PlotItem):\n            si = QtGui.QTreeWidgetItem(['Plot'])\n            \n        if si is not None:\n            si.gitem = item\n            treeItem.addChild(si)\n            treeItem = si\n            if si.gitem is select:\n                self.ui.itemTree.setCurrentItem(si)\n            \n        for ch in item.childItems():\n            self.updateItemTree(ch, treeItem, select=select)\n        \n            \n    def exportItemChanged(self, item, prev):\n        if item is None:\n            return\n        if item.gitem is self.scene:\n            newBounds = self.scene.views()[0].viewRect()\n        else:\n            newBounds = item.gitem.sceneBoundingRect()\n        self.selectBox.setRect(newBounds)\n        self.selectBox.show()\n        self.updateFormatList()\n        \n    def updateFormatList(self):\n        current = self.ui.formatList.currentItem()\n        if current is not None:\n            current = str(current.text())\n        self.ui.formatList.clear()\n        self.exporterClasses = {}\n        gotCurrent = False\n        for exp in exporters.listExporters():\n            self.ui.formatList.addItem(exp.Name)\n            self.exporterClasses[exp.Name] = exp\n            if exp.Name == current:\n                self.ui.formatList.setCurrentRow(self.ui.formatList.count()-1)\n                gotCurrent = True\n                \n        if not gotCurrent:\n            self.ui.formatList.setCurrentRow(0)\n        \n    def exportFormatChanged(self, item, prev):\n        if item is None:\n            self.currentExporter = None\n            self.ui.paramTree.clear()\n            return\n        expClass = self.exporterClasses[str(item.text())]\n        exp = expClass(item=self.ui.itemTree.currentItem().gitem)\n\n        params = exp.parameters()\n\n        if params is None:\n            self.ui.paramTree.clear()\n        else:\n            self.ui.paramTree.setParameters(params)\n        self.currentExporter = exp\n        self.ui.copyBtn.setEnabled(exp.allowCopy)\n        \n    def exportClicked(self):\n        self.selectBox.hide()\n        self.currentExporter.export()\n        \n    def copyClicked(self):\n        self.selectBox.hide()\n        self.currentExporter.export(copy=True)\n        \n    def close(self):\n        self.selectBox.setVisible(False)\n        self.setVisible(False)\n\n    def closeEvent(self, event):\n        self.close()\n        QtGui.QWidget.closeEvent(self, event)\n", "path": "pyqtgraph/GraphicsScene/exportDialog.py"}]}