Some more interesting information...
My function call is in a slot that is called in response to a drag-and-drop event. If I call the slot from the constructor function (i.e., after everything is initialized), it doesn't crash.
I can also call getText one time from the slot when the slot is triggered by a signal. In the code block below, the program crashes on the second call to getText. I've got the debug lines in there to check if something is happening to the this pointer. In both cases it prints the appropriate window name.
bool ok;
qDebug() << "Check this:" << this->windowTitle();
"test", &ok);
qDebug() << "Check this:" << this->windowTitle();
"test", &ok);
bool ok;
qDebug() << "Check this:" << this->windowTitle();
QInputDialog::getText(this, tr("Enter a new label"),
tr("Enter a new label"), QLineEdit::Normal,
"test", &ok);
qDebug() << "Check this:" << this->windowTitle();
QInputDialog::getText(this, tr("Enter a new label"),
tr("Enter a new label"), QLineEdit::Normal,
"test", &ok);
To copy to clipboard, switch view to plain text mode
Bookmarks