W
W
Wet_Dumplings2018-10-02 18:10:04
Python
Wet_Dumplings, 2018-10-02 18:10:04

How to grab input values ​​in showDialog()?

Hello!
There are fields where the user enters numbers and the sign of the action, as well as a fourth field where the result of the action is shown. How to pull out value that is entered?
initUI(self)

self.btn = QPushButton('Dialog', self)
        self.btn.move(20, 20)
        self.btn.clicked.connect(self.showDialog)

        self.value_a = QLineEdit(self)
        self.value_a.move(150, 22)

showDialog(self)
int, oka = QInputDialog.getInt(self, 'Input Dialog','ввести значение A:')

        if oka:
            self.value_a.setText(str(int)) #<= на экране в полосочке выводит а вот выхватить значение не могу

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2018-10-02
@Wet_Dumplings

Check out the documentation: doc.qt.io/qt-5/qlineedit.html#text-prop
text = self.value_a.text()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question