예제 #1
0
파일: test001.py 프로젝트: oldu73/sblh
# Programme 03 - signaux et slots avec arguments
from PyQt4.QtCore import SIGNAL, SLOT
from PyQt4.QtGui import QApplication, QWidget,\
    QLineEdit, QLabel, QHBoxLayout
import sys
 
if __name__=='__main__':
    App = QApplication(sys.argv)
    Window = QWidget()
    Window.setWindowTitle("Arguments")
    Layout = QHBoxLayout(Window)
    Line = QLineEdit()
    Layout.addWidget(Line)
    Label = QLabel()
    Layout.addWidget(Label)
    Line.connect(Line, SIGNAL("textChanged(QString)"),\
        Label, SLOT("setText(QString)"))
    Window.show()
    App.exec_()
예제 #2
0
from PyQt4.QtCore import SIGNAL, SLOT
from PyQt4.QtGui import QApplication, QWidget, \
    QLineEdit, QLabel, QHBoxLayout
import sys
 
if __name__=='__main__':
 
    app = QApplication(sys.argv)
 
    window = QWidget()
    window.setWindowTitle("arguments")
    layout = QHBoxLayout(window)
    line = QLineEdit()
    layout.addWidget(line)
    label = QLabel()
    layout.addWidget(label)
    line.connect(line, SIGNAL('textChanged(QString)'),
                 label, SLOT('setText(QString)'))
    window.show()
    # Show our window.
 
    app.exec_()