I have a program that at one point lets the user choose between 2 values. To do this, I want to open a box with 2 Buttons ( OK, Cancel) plus a field to choose from or write in the values. Just something like a QMessageBox with the possibility to fill in/choose data. I could create a class and code everything myself but I wonder if there is a standard-dialog for that.
Does anybody know of a standard-dialog like that in QT?
Thank you
itelly
Qt provides several standard dialogues. The one for this is called QInputDialog
For easy use you can use its static functions like this.
QString text = QInputDialog::getText(parent,"Title","text");
They can be further customized and static functions for StringLists, int, double and multiline edit exist already.
You can check here for further details on this class: http://doc.qt.io/qt-5/qinputdialog.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With