Ответы пользователя по тегу PyQt
  • Ошибка segmentation fault в PyQt4

    MYPABEU
    @MYPABEU
    #!/usr/bin/env python
    # coding: utf-8

    import sys

    from PyQt4.QtGui import *
    from PyQt4.QtCore import *

    class MainWindow(QMainWindow):

    inpEdit = None
    inpLbl = None

    outEdit = None
    outLbl = None

    quitBtn = None
    convBtn = None

    def __init__(self,parent=None):
    super(MainWindow,self).__init__(parent)

    self.setWindowTitle(u'Koнвертер')
    self.resize(800,370)

    self.inpEdit = QLineEdit(self)
    self.inpEdit.setGeometry(300, 20, 250, 70)
    QObject.connect(self.inpEdit,SIGNAL('textChanged(QString)'),self.onInpLblTextChanged)

    self.outEdit = QLineEdit(self)
    self.outEdit.setGeometry(300, 110, 250, 70)

    self.inpLbl = QLabel(u'Ввод', self)
    self.inpLbl.setGeometry(200, 20, 100, 70)

    self.outLbl = QLabel(u'Вывод', self)
    self.outLbl.setGeometry(200, 110, 100, 70)

    self.quitBtn = QPushButton(u'Закрыть', self)
    self.quitBtn.setGeometry(650, 300, 130, 70)
    QObject.connect(self.quitBtn,SIGNAL('clicked()'),self.onQuitBtnClicked)

    self.convBtn = QPushButton(u'Конвертировать', self)
    self.convBtn.setGeometry(300, 190, 250, 70)

    @pyqtSlot()
    def onQuitBtnClicked(self):
    self.close()

    @pyqtSlot(QString)
    def onInpLblTextChanged(self, string):
    print string

    if __name__ == '__main__':
    app = QApplication(sys.argv)
    mw = MainWindow()
    mw.show()
    sys.exit(app.exec_())
    Ответ написан