I'm trying to get some text input for the user for further use. For this, I used a QInputDialog:
bool ok;
QString text = QInputDialog::getText(this, tr("QInputDialog::getText()"),
tr("Your input:"), QLineEdit::Normal,
QDir::home().dirName(), &ok);
if (ok && !text.isEmpty()) {
textLabel->setText(text);
}
This crahses my program at the line textLabel->setText(text);
. If I comment it out, it does not crash, but the text
variable stays empty. What am I missing?
Thank you!