user1744052
user1744052

Reputation: 21

PyQt + changing widget

Consider following code:

    app = QApplication(sys.argv)

    mainWindow = MainWindow() # window created with Designer
    mainWindow.ui.output = Output() # "Output" is a subclass of QPlainTextEdit
    preparePropertiesTabs(mainWindow)
    mainWindow.show()

    mainWindow.ui.output.appendPlainText('test')

    exit(app.exec_())

What I expect is to have word 'test' in my 'output' widget, but it's empty. Anyway, when I show only 'output' (mainWindow.ui.output.show() instead of mainWindow.show()), text is present.

Do I not know about something? :|

Upvotes: 0

Views: 109

Answers (1)

Junuxx
Junuxx

Reputation: 14251

Your Output doesn't have a parent. Try mainWindow.ui.output = Output(mainWindow)

Upvotes: 1

Related Questions