983cc1695e
* 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>
95 lines
5.1 KiB
Python
95 lines
5.1 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
# Form implementation generated from reading ui file 'examples/exampleLoaderTemplate.ui'
|
|
#
|
|
# Created: Fri Feb 16 20:29:46 2018
|
|
# by: pyside-uic 0.2.15 running on PySide 1.2.4
|
|
#
|
|
# WARNING! All changes made in this file will be lost!
|
|
|
|
from PySide import QtCore, QtGui
|
|
|
|
class Ui_Form(object):
|
|
def setupUi(self, Form):
|
|
Form.setObjectName("Form")
|
|
Form.resize(846, 552)
|
|
self.gridLayout_2 = QtGui.QGridLayout(Form)
|
|
self.gridLayout_2.setObjectName("gridLayout_2")
|
|
self.splitter = QtGui.QSplitter(Form)
|
|
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
|
self.splitter.setObjectName("splitter")
|
|
self.widget = QtGui.QWidget(self.splitter)
|
|
self.widget.setObjectName("widget")
|
|
self.gridLayout = QtGui.QGridLayout(self.widget)
|
|
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
|
self.gridLayout.setObjectName("gridLayout")
|
|
self.exampleTree = QtGui.QTreeWidget(self.widget)
|
|
self.exampleTree.setObjectName("exampleTree")
|
|
self.exampleTree.headerItem().setText(0, "1")
|
|
self.exampleTree.header().setVisible(False)
|
|
self.gridLayout.addWidget(self.exampleTree, 0, 0, 1, 2)
|
|
self.graphicsSystemCombo = QtGui.QComboBox(self.widget)
|
|
self.graphicsSystemCombo.setObjectName("graphicsSystemCombo")
|
|
self.graphicsSystemCombo.addItem("")
|
|
self.graphicsSystemCombo.addItem("")
|
|
self.graphicsSystemCombo.addItem("")
|
|
self.graphicsSystemCombo.addItem("")
|
|
self.gridLayout.addWidget(self.graphicsSystemCombo, 2, 1, 1, 1)
|
|
self.qtLibCombo = QtGui.QComboBox(self.widget)
|
|
self.qtLibCombo.setObjectName("qtLibCombo")
|
|
self.qtLibCombo.addItem("")
|
|
self.qtLibCombo.addItem("")
|
|
self.qtLibCombo.addItem("")
|
|
self.qtLibCombo.addItem("")
|
|
self.qtLibCombo.addItem("")
|
|
self.gridLayout.addWidget(self.qtLibCombo, 1, 1, 1, 1)
|
|
self.label_2 = QtGui.QLabel(self.widget)
|
|
self.label_2.setObjectName("label_2")
|
|
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
|
|
self.label = QtGui.QLabel(self.widget)
|
|
self.label.setObjectName("label")
|
|
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
|
|
self.loadBtn = QtGui.QPushButton(self.widget)
|
|
self.loadBtn.setObjectName("loadBtn")
|
|
self.gridLayout.addWidget(self.loadBtn, 3, 1, 1, 1)
|
|
self.widget1 = QtGui.QWidget(self.splitter)
|
|
self.widget1.setObjectName("widget1")
|
|
self.verticalLayout = QtGui.QVBoxLayout(self.widget1)
|
|
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
|
|
self.verticalLayout.setObjectName("verticalLayout")
|
|
self.loadedFileLabel = QtGui.QLabel(self.widget1)
|
|
font = QtGui.QFont()
|
|
font.setWeight(75)
|
|
font.setBold(True)
|
|
self.loadedFileLabel.setFont(font)
|
|
self.loadedFileLabel.setText("")
|
|
self.loadedFileLabel.setAlignment(QtCore.Qt.AlignCenter)
|
|
self.loadedFileLabel.setObjectName("loadedFileLabel")
|
|
self.verticalLayout.addWidget(self.loadedFileLabel)
|
|
self.codeView = QtGui.QPlainTextEdit(self.widget1)
|
|
font = QtGui.QFont()
|
|
font.setFamily("FreeMono")
|
|
self.codeView.setFont(font)
|
|
self.codeView.setObjectName("codeView")
|
|
self.verticalLayout.addWidget(self.codeView)
|
|
self.gridLayout_2.addWidget(self.splitter, 0, 0, 1, 1)
|
|
|
|
self.retranslateUi(Form)
|
|
QtCore.QMetaObject.connectSlotsByName(Form)
|
|
|
|
def retranslateUi(self, Form):
|
|
Form.setWindowTitle(QtGui.QApplication.translate("Form", "PyQtGraph", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.graphicsSystemCombo.setItemText(0, QtGui.QApplication.translate("Form", "default", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.graphicsSystemCombo.setItemText(1, QtGui.QApplication.translate("Form", "native", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.graphicsSystemCombo.setItemText(2, QtGui.QApplication.translate("Form", "raster", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.graphicsSystemCombo.setItemText(3, QtGui.QApplication.translate("Form", "opengl", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.qtLibCombo.setItemText(0, QtGui.QApplication.translate("Form", "default", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.qtLibCombo.setItemText(1, QtGui.QApplication.translate("Form", "PyQt4", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.qtLibCombo.setItemText(2, QtGui.QApplication.translate("Form", "PySide", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.qtLibCombo.setItemText(3, QtGui.QApplication.translate("Form", "PyQt5", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.qtLibCombo.setItemText(4, QtGui.QApplication.translate("Form", "PySide2", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.label_2.setText(QtGui.QApplication.translate("Form", "Graphics System:", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.label.setText(QtGui.QApplication.translate("Form", "Qt Library:", None, QtGui.QApplication.UnicodeUTF8))
|
|
self.loadBtn.setText(QtGui.QApplication.translate("Form", "Run Example", None, QtGui.QApplication.UnicodeUTF8))
|
|
|