Re: Editing in a QComboBox
Quote:
Originally Posted by
sterling
How to I activate this control (focus in the edit field) so I can edit the information in the field?
Setting it to editable should have done that. What happens if you click into the line edit?
Quote:
Originally Posted by
sterling
How do I select a portion of the string in the edit field?
Get the line edit and call its setSelection() method.
Cheers,
_
Re: Editing in a QComboBox
If I click into the line edit, the cursor does not show up anywhere. It's like the box never gets keyboard focus. If I set the cursor into an edit field, the vertical bar cursor shows up and I can type and navigate in the line. None of that behavior show up in the QComboBox. Typing does nothing when there is a blank selected or when there is actual text selected.
S
Re: Editing in a QComboBox
Very strange.
Does this also happen if you take a normal QComboBox and set editable to true from outside?
Cheers,
_
Re: Editing in a QComboBox
The combo box works just as expected.
This is the definition of the derived class
class ListSelect : public QComboBox
{
Q_OBJECT
public:
ListSelect(QWidget *parent = 0);
ListSelect( void );
~ListSelect();
};
Re: Editing in a QComboBox
Is this complete code? Didn't you by any chance reimplement any code responsible for handling mouse events? How are you using the class? What properties do you set on the widget?
Re: Editing in a QComboBox
Found it. This was built from a custom widget that was put into design. I had set the focusPolicy to keyboard. Changing it to StrongFocus fixed the problem. I compared the ui_file entry for a ComboBox with mine and commented out properties until it worked. There are still other problems but those for later posts.