pyqtgraph/examples/ScatterPlotSpeedTestTemplat...

50 lines
2.1 KiB
Python
Raw Normal View History

2012-05-31 20:05:19 +00:00
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './examples/ScatterPlotSpeedTestTemplate.ui'
2012-05-31 20:05:19 +00:00
#
# Created: Fri Sep 21 15:39:09 2012
# by: PyQt4 UI code generator 4.9.1
2012-05-31 20:05:19 +00:00
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(400, 300)
self.gridLayout = QtGui.QGridLayout(Form)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.sizeSpin = QtGui.QSpinBox(Form)
self.sizeSpin.setProperty("value", 10)
self.sizeSpin.setObjectName(_fromUtf8("sizeSpin"))
self.gridLayout.addWidget(self.sizeSpin, 1, 1, 1, 1)
2012-05-31 20:05:19 +00:00
self.pixelModeCheck = QtGui.QCheckBox(Form)
self.pixelModeCheck.setObjectName(_fromUtf8("pixelModeCheck"))
self.gridLayout.addWidget(self.pixelModeCheck, 1, 3, 1, 1)
self.label = QtGui.QLabel(Form)
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
self.plot = PlotWidget(Form)
self.plot.setObjectName(_fromUtf8("plot"))
self.gridLayout.addWidget(self.plot, 0, 0, 1, 4)
self.randCheck = QtGui.QCheckBox(Form)
self.randCheck.setObjectName(_fromUtf8("randCheck"))
self.gridLayout.addWidget(self.randCheck, 1, 2, 1, 1)
2012-05-31 20:05:19 +00:00
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Patch/window handling (#468) * 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>
2020-06-01 18:23:18 +00:00
Form.setWindowTitle(QtGui.QApplication.translate("Form", "PyQtGraph", None, QtGui.QApplication.UnicodeUTF8))
self.pixelModeCheck.setText(QtGui.QApplication.translate("Form", "pixel mode", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Form", "Size", None, QtGui.QApplication.UnicodeUTF8))
self.randCheck.setText(QtGui.QApplication.translate("Form", "Randomize", None, QtGui.QApplication.UnicodeUTF8))
2012-05-31 20:05:19 +00:00
from pyqtgraph import PlotWidget