- 134 名前:デフォルトの名無しさん [2009/10/17(土) 20:14:51 ]
- ウィンドウにボタンを二つ上下に並べてみようと思ったんですが
これだとめっさ小さなボタンになってしまいます. ウィンドウ一杯に(日←みたいな感じで)二個並べたいんですが どうしたらいいんでしょう?wxPythonでサイザーをちょっと 使ったことがある程度です. import PyQt4.QtGui,PyQt4.QtCore, ys class HelloButton(PyQt4.QtGui.QPushButton): def __init__(self, parent, text): PyQt4.QtGui.QPushButton.__init__(self, parent) self.setText(text) class HelloWindow(PyQt4.QtGui.QMainWindow): def __init__(self, *args): PyQt4.QtGui.QMainWindow.__init__(self) self.hello_button_1 = HelloButton(self, "hello1") self.hello_button_2 = HelloButton(self, "hello2") self.qVBoxLayout = PyQt4.QtGui.QVBoxLayout() self.qVBoxLayout.addWidget(self.hello_button_1) self.qVBoxLayout.addWidget(self.hello_button_2) self.q_widget = PyQt4.QtGui.QWidget(self) self.q_widget.setLayout(self.qVBoxLayout) q_application = PyQt4.QtGui.QApplication(sys.argv) hello_window = HelloWindow() hello_window.show() q_application.connect(q_application, PyQt4.QtCore.SIGNAL("lastWindowClosed()"), q_application, PyQt4.QtCore.SLOT("quit()")) q_application.exec_()
|

|