本文整理汇总了Python中viewer.Viewer.create_pydot_graph方法的典型用法代码示例。如果您正苦于以下问题:Python Viewer.create_pydot_graph方法的具体用法?Python Viewer.create_pydot_graph怎么用?Python Viewer.create_pydot_graph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类viewer.Viewer
的用法示例。
在下文中一共展示了Viewer.create_pydot_graph方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StateView
# 需要导入模块: from viewer import Viewer [as 别名]
# 或者: from viewer.Viewer import create_pydot_graph [as 别名]
class StateView(QtGui.QMainWindow):
def __init__(self, window):
QtGui.QMainWindow.__init__(self)
self.ui = Ui_StateView()
self.ui.setupUi(self)
self.viewer = Viewer("pydot")
self.connect(self.ui.btShowSingleState, SIGNAL("clicked()"), self.showSingleState)
self.connect(self.ui.btShowWholeGraph, SIGNAL("clicked()"), self.showWholeGraph)
self.window = window
def showWholeGraph(self):
editor = self.window.getEditor()
self.viewer.create_pydot_graph(editor.tm.get_mainparser().graph)
self.showImage(self.ui.gvStategraph, self.viewer.image)
def showSingleState(self):
editor = self.window.getEditor()
self.viewer.show_single_state(editor.tm.get_mainparser().graph, int(self.ui.leSingleState.text()))
self.showImage(self.ui.gvStategraph, self.viewer.image)
def showImage(self, graphicsview, imagefile):
scene = QGraphicsScene()
item = QGraphicsPixmapItem(QPixmap(imagefile))
scene.addItem(item);
graphicsview.setScene(scene)
graphicsview.resetMatrix()