私はqtデザイナーでGUIを作成し、pyqtを使用しています。python(x,y) パッケージで提供される matplotlibwidget を追加しました。GUI のボタンをクリックしてグラフを表示するにはどうすればよいですか? ありがとう!
1209 次
1 に答える
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
于 2013-07-11T08:35:07.217 に答える