Hi,
I connect a slot to signal: editTextChanged(const QString&).
It is ok to receive current text by the slot each time when I key-in something.
But when I "backspace" to clear the string in QComboBox, currentText() still return "(".
Hi,
I connect a slot to signal: editTextChanged(const QString&).
It is ok to receive current text by the slot each time when I key-in something.
But when I "backspace" to clear the string in QComboBox, currentText() still return "(".
Hi all,
I found the root-cause, it was from the usage of qPrintable().
This function will convert QString to char*, and the string pointer may be freed after the calling.
So I should keep the string immediately after qPrintable(), that is it!
Bookmarks