本文整理汇总了Python中pyqtgraph.parametertree.ParameterTree.setMinimumWidth方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterTree.setMinimumWidth方法的具体用法?Python ParameterTree.setMinimumWidth怎么用?Python ParameterTree.setMinimumWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.parametertree.ParameterTree
的用法示例。
在下文中一共展示了ParameterTree.setMinimumWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GuiManager
# 需要导入模块: from pyqtgraph.parametertree import ParameterTree [as 别名]
# 或者: from pyqtgraph.parametertree.ParameterTree import setMinimumWidth [as 别名]
#.........这里部分代码省略.........
self.setWindowTitle('Interferometry Acquisition GUI')
#self.widget = QtGui.QWidget()
#self.setCentralWidget(self.widget)
self.layout = pg.LayoutWidget()
#self.widget.setLayout(self.layout)
self.setCentralWidget(self.layout)
#Create GUI
sizePolicyBt = QtGui.QSizePolicy(1, 1)
sizePolicyBt.setHorizontalStretch(0)
sizePolicyBt.setVerticalStretch(0)
self.btOpen = QtGui.QPushButton("Open\nprevious results")
sizePolicyBt.setHeightForWidth(self.btOpen.sizePolicy().hasHeightForWidth())
self.btOpen.setSizePolicy(sizePolicyBt);
self.btOpen.setStyleSheet("background-color: yellow; font-size: 16px; font: bold")
self.btStart = QtGui.QPushButton("Start\nacquisition")
sizePolicyBt.setHeightForWidth(self.btStart.sizePolicy().hasHeightForWidth())
self.btStart.setSizePolicy(sizePolicyBt);
self.btStart.setStyleSheet("background-color: green; font-size: 16px; font: bold")
self.btStart.clicked.connect(self.startAcquisition)
self.btStop = QtGui.QPushButton("Stop\nacquisition")
sizePolicyBt.setHeightForWidth(self.btStop.sizePolicy().hasHeightForWidth())
self.btStop.setSizePolicy(sizePolicyBt);
self.btStop.setStyleSheet("background-color: red; font-size: 16px; font: bold")
self.btStop.clicked.connect(self.stopAcquisition)
self.btStop.setEnabled(False)
self.paramTree = ParameterTree()
self.paramTree.setParameters(Parameters.paramObject, showTop=False)
self.paramTree.setWindowTitle('pyqtgraph example: Parameter Tree')
self.paramTree.setMinimumWidth(350)
self.paramTree.setMaximumWidth(350)
sizePolicyPt = QtGui.QSizePolicy(1,1)
sizePolicyPt.setHorizontalStretch(QtGui.QSizePolicy.Fixed)
sizePolicyPt.setVerticalStretch(1)
self.paramTree.setSizePolicy(sizePolicyPt);
## Create random 2D data
data = np.random.normal(size=(512, 512)) + pg.gaussianFilter(np.random.normal(size=(512, 512)), (5, 5)) * 20 + 100
data = data[:,:,np.newaxis]
data = data.repeat(3,2)
self.plotTl = pg.GraphicsView()
self.plotTlImage = pg.ImageItem(data[:,:,:]) #parent=self.plotTl
self.plotTlViewBox = pg.ViewBox()
self.plotTl.setCentralWidget(self.plotTlViewBox)
self.plotTlViewBox.addItem(self.plotTlImage)
self.plotTr = pg.PlotWidget(title="Interferometry", labels={'left': 'Signal amplitude (A.U.)', 'bottom': 'Distance (mm)'})
#self.plotTlViewBox2.addItem(self.plotTr)
self.plotTrCurve = self.plotTr.plot(pen=(255,0,0),name='C1') #Red
self.plotTrCurve2 = self.plotTr.plot(pen=(0,255,0),name='C2') #Green
#self.plotTlViewBox2.enableAutoRange('xy', True) ## stop auto-scaling after the first data set is plotted
#self.plotTr.addLegend('Test')
self.plotTr.setYRange(-1000, 1000)
self.plotBl = pg.PlotWidget(title="Distance", labels={'left': 'Distance (mm)', 'bottom': 'Number of acquisitions'})
self.plotBlCurve = self.plotBl.plot(pen=(255,0,0),name='C1')
self.plotBl.enableAutoRange('xy', True) ## stop auto-scaling after the first data set is plotted
self.plotBl.setMaximumWidth(3500)