from Qt.Gui import QApplication, QPushButton
from sys import argv

app = QApplication('t1')
hello = QPushButton("Hello world!", None)
hello.resize(100, 30)
hello.show()
app.run()

Beispiel #2
0
# parent test

from Qt.Gui import QApplication, QPushButton, QWidget
app = QApplication()
form = QWidget()
okButton = QPushButton('Push me', form)
cancelButton = QPushButton('Push me', form)

okButton.show()
cancelButton.show()
form.show()

app.run()
Beispiel #3
0
# simple push button

from Qt.Gui import QApplication, QPushButton

app = QApplication()
button = QPushButton('Push me', None)
button.show()
print (button.x, button.y)
app.run()

from Qt.Gui import QApplication, QFont, QPushButton
from sys import argv

app = QApplication('t2')
quit = QPushButton("Quit", None)
quit.resize(100, 30)
quit.setFont(QFont('Times', 18, QFont.Bold));
quit.connect('clicked()', app.quit);
quit.show()
app.run()
from Qt.Gui import QApplication, QPushButton

class MyButton(QPushButton):
    def on_clicked(self):
        print 'on_clicked'

app = QApplication('test')

a = QPushButton('A', None)
b = MyButton('B', None)

a.connect('clicked()', b.clicked)
b.connect('clicked()', b.on_clicked)

a.show()
b.show()

app.run()