I have a class inherited from ListBox which is used to select items in a database.
The properties for the items are displayed in a TextEditor which has a lambda function for onFocusLost (and onReturnKey) so that values get updated in the database.
When a row in the ListBox is clicked, the selected row is changed BEFORE the onFocusLost function is called and so the database gets the entry associated with the new row modified.
Have I missed something out or is this a bug?
This appears to be by design. If you need the focusLost handling to be synchronous, I’d recommend overriding TextEditor::focusLost
and doing any necessary handling there. Don’t forget to call the base class implementation of focusLost
in your overriding function!