As the title says.
If I enter a value into an editable combobox and then hit return, I'll looking to be able to clear the combobox, ready for the next input.
Thoughts? Suggestions?
R
As the title says.
If I enter a value into an editable combobox and then hit return, I'll looking to be able to clear the combobox, ready for the next input.
Thoughts? Suggestions?
R
Since you are using an editable combox it has a QLineEdit asociated with it. see QComboBox::lineEdit () .
QLineEdit has the editingFinished () signal.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
cnbp173 (3rd February 2011)
Hi there,
I tried this, but to no avail. I tried:
connect(comboBox,SIGNAL(editingFinished()),comboBo x,SLOT(clearEditText()));
Is this right? or is there a specific way to cast to the lineEdit functions
R
Added after 19 minutes:
OK, sorry for being blonde......
works with
connect(comboBox->lineEdit(),SIGNAL(editingFinished()),comboBox,SLO T(clearEditText()));
Last edited by cnbp173; 3rd February 2011 at 22:41.
Bookmarks