Python#!/usr/bin/python import sysfrom PyQt4 import QtGui, QtCore class GridNetCgf(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setWindowTitle("Окно") """Поля для правки адресов""" ipEdit = QtGui.QLineEdit() """Кнопки""" ok = QtGui.QPushButton("ok") """Расстановка элементов""" hbox = QtGui.QHBoxLayout() hbox.addWidget(ok) hbox.addWidget(ipEdit) self.setLayout(hbox) self.resize(300,200) """Сигналы и слоты""" self.connect(ok, QtCore.SIGNAL('clicked()'), ipEdit, QtCore.SLOT('setDisabled()')) app = QtGui.QApplication(sys.argv)qb = GridNetCgf()qb.show()sys.exit(app.exec_())
public slots: void setDisabled();