当前位置: 首页>>代码示例>>Python>>正文


Python ParameterTree.resize方法代码示例

本文整理汇总了Python中pyqtgraph.parametertree.ParameterTree.resize方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterTree.resize方法的具体用法?Python ParameterTree.resize怎么用?Python ParameterTree.resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyqtgraph.parametertree.ParameterTree的用法示例。


在下文中一共展示了ParameterTree.resize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: QtMav

# 需要导入模块: from pyqtgraph.parametertree import ParameterTree [as 别名]
# 或者: from pyqtgraph.parametertree.ParameterTree import resize [as 别名]
qt_mav = QtMav(outdevice, indevice)

# create gui
app = QtGui.QApplication(sys.argv)

f = open("tuner_ui.py.tmp", "w")
uic.compileUi("tuner.ui", f)
tuner = uic.loadUi("tuner.ui")


params = []
parameter = Parameter(name='params', type='group', children=params)
parameter_tree = ParameterTree(parent=tuner.tabTime)
parameter_tree.setParameters(parameter, showTop=False)
parameter_tree.resize(300, 500)

def get_group_index(params, gname):#{{{
    """
    recursive group refreshing/adding
    params -- parameters structure
    gname -- string representing name
    return:
        index in params structure
        -1 if not found
    """
    i = 0
    for g in params:
        if g['name'] == gname:
            return i
        i += 1
开发者ID:barthess,项目名称:volat3,代码行数:32,代码来源:main.py

示例2: restore

# 需要导入模块: from pyqtgraph.parametertree import ParameterTree [as 别名]
# 或者: from pyqtgraph.parametertree.ParameterTree import resize [as 别名]
    state = p.saveState()
    
def restore():
    global state
    add = p['Save/Restore functionality', 'Restore State', 'Add missing items']
    rem = p['Save/Restore functionality', 'Restore State', 'Remove extra items']
    p.restoreState(state, addChildren=add, removeChildren=rem)
p.param('Save/Restore functionality', 'Save State').sigActivated.connect(save)
p.param('Save/Restore functionality', 'Restore State').sigActivated.connect(restore)


## Create two ParameterTree widgets, both accessing the same data
t = ParameterTree()
t.setParameters(p, showTop=False)
t.show()
t.resize(400,800)
t2 = ParameterTree()
t2.setParameters(p, showTop=False)
t2.show()
t2.resize(400,800)
    
## test save/restore
s = p.saveState()
p.restoreState(s)


## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
    import sys
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
        QtGui.QApplication.instance().exec_()
开发者ID:fivejjs,项目名称:pyqtgraph,代码行数:33,代码来源:parametertree.py

示例3: Parameter

# 需要导入模块: from pyqtgraph.parametertree import ParameterTree [as 别名]
# 或者: from pyqtgraph.parametertree.ParameterTree import resize [as 别名]
            
        ])
    ]},
    {'name': 'Param 5', 'type': 'bool', 'value': True, 'tip': "This is a checkbox"},
    {'name': 'Param 6', 'type': 'color', 'value': "FF0", 'tip': "This is a color button. It cam be renamed.", 'renamable': True},
    {'name': 'TextParam', 'type': 'text', 'value': 'Some text...'},
]

#p = pTypes.ParameterSet("params", params)
p = Parameter(name='params', type='group', children=params)
def change(param, changes):
    print "tree changes:"
    for param, change, data in changes:
        print "  [" + '.'.join(p.childPath(param))+ "]   ", change, data
    
p.sigTreeStateChanged.connect(change)


t = ParameterTree()
t.setParameters(p, showTop=False)
t.show()
t.resize(400,600)
t2 = ParameterTree()
t2.setParameters(p, showTop=False)
t2.show()
t2.resize(400,600)
    
import sys
if sys.flags.interactive == 0:
    app.exec_()
开发者ID:calanoue,项目名称:pyqtgraph,代码行数:32,代码来源:__main__.py


注:本文中的pyqtgraph.parametertree.ParameterTree.resize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。