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


Python TaurusWidget.getModelName方法代码示例

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


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

示例1: called

# 需要导入模块: from taurus.qt.qtgui.container import TaurusWidget [as 别名]
# 或者: from taurus.qt.qtgui.container.TaurusWidget import getModelName [as 别名]
# Now, by adding the widgets to the layout we are actually reparenting them.
# The order in which we reparent determines success/failure:
# if we do m-->p and then c-->m, it works, but if we do it in the opposite
# order, we trigger the error.
# (i.e., if we had called "p.layout().addWidget(m)" it would work work)
m.layout().addWidget(c)
p.layout().addWidget(m)

# the problem arises because the Taurus ancestry of c is only checked when:
# a) c.setUseParentModel() is called (and it effectively changes something) or
# b) when c is Qt-reparented
##
# In this example, c is reparented before m, so when it checks for a Taurus
# ancestor, none is found. Then m is reparented and c now would find its right
# Taurus ancestor (p)... but c never gets notified!

# Manually calling c.recheckTaurusParent() after the parenting has changed is
# another way to work around this issue (you can test by uncommenting
# the following line):

# c.recheckTaurusParent()

p.setModel('sys/tg_test/1/state')
print 'p model:', p.getModelName()
print 'c model:', c.getModelName()


p.show()
sys.exit(app.exec_())
开发者ID:cmft,项目名称:taurus,代码行数:31,代码来源:parentmodel_issue_demo.py


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