2012-08-23 2 views
0

qt 디자이너와 함께 gui를 만들고 pyqt를 사용했습니다. python (x, y) 패키지와 함께 제공되는 matplotlibwidget을 추가했습니다. GUI에서 버튼을 클릭하여 그래프를 표시하려면 어떻게합니까? 감사!pyqt와 python (x, y)에서 버튼 클릭으로 그래프를 표시합니다. matplotlibwidget

+2

당신은 이미 무슨 짓을했는지, 예를 들어,의 예를 추가하려고한다 데이터를 정의하는 방법, 원하는 종류의 음모, 일어날 일 등 ... –

답변

0

은 내가 당신을 도울 것입니다 희망 :

class MyClass(QtGui.QMainWindow): 
    def __init__(self,parent = None): 
     QtGui.QWidget.__init__(self, parent) 
     self.ui = PYQTMainWindow.Ui_MainWindow() 
     self.ui.setupUi(self) 
     ... 
     self.connect(self.ui.myButton, QtCore.SIGNAL('clicked()'), self.DisplayGraph) 
     #next line will work too: 
     #self.ui.myButton.clicked(self.DisplayGraph) 

    def DisplayGraph(self): 
     #... set your graph here the way you want