Originally posted by boyadg
Then I supposed that maybe I had to add the string manually, which I find a bit strange, because if the Widget is called a KHistoryCombo I think it should handle adding the strings to the history itself.
It can, if you allow it.
See setHandleSignals(bool)
As an application might want to check the input before adding it to the history (in order to have only vaild input in the history), the default behaviour is to let the application handle history adds.
(1) subclass the widget to capture when the user leaves the KHistoryCombo
No, QLineEdit has a signal focusLost()
(2) then add the string "manually" with the addToHistory() function
No, see above
when the app is closed, write the code to save the list of strings in the config
Yes, you get a QStringList containing all items, which you can write easily using KConfig::writeEntry, or any other configuration backend you might want to use.
Cheers,
_