Solved setPlaceholderText segmentation fault for Qt 5.9
-
Hi. About differences QComboBox 5.9 and 5.15.
QComboBox *cb = new QComboBox(this); cb->setPlaceholderText("something");
When I compiled it for 5.15 - no problems. But setPlaceholderText's property was introduced in Qt 5.15. I need 5.9!
I tried use it for QLineEdit, because QLineEnit has this property from 4.7 version:QComboBox *cb = new QComboBox(this); cb->lineEdit()->setPlaceholderText("something");
But when I open my QDialog with this QComboBox (5.9 version!) I get "segmentation fault". Why ? What's a problem?
-
is your combobox set to editable ?
-
-
I used debugger. And it breaked in this line
cb->lineEdit()->setPlaceholderText("something");
it the same result as Q_ASSERT.
Fatal: ASSERT: "_cb->lineEdit()" in file...
I have not information about the current problem. Why I can't use setPlaceholderText? -
@Evgeny-Siberia
Yes, itQ_ASSERT()
s, that's the whole point of what I was showing you it would do! It has nothing to do with placeholder text. You need to understand this else you won't get far in C++.... -
of course I understand, that QLineEnit no memory allocated. But why?)
-
is your combobox set to editable ?
-
@J-Hilk said in setPlaceholderText segmentation fault for Qt 5.9:
is your combobox set to editable ?
I am sorry for that kid question. I read doc... but didn't see "only editable combo boxes have a line edit"