PDA

View Full Version : QComboBox and QValidator



mrandreas
22nd September 2010, 14:52
I want to use the QValidator of the QComboBox, but I don't want the QCombobox to be editable and I dont want to keep the QValidator. I want to set the validator to the combobox and use it later on. However if the QComboBox is not editable the getValidator returns null. Why don't I just insert valid data to the combobox? tell it to the customers!!

Thanks Andreas

wysota
22nd September 2010, 17:31
Is there a question here somewhere or did you just want to complain? If the latter then I can understand how you feel, if the former then you have to be more specific.

mrandreas
27th September 2010, 15:04
Yes I wanted to complain. However, it was suppose to be a question too: Is there a way of setting a qvalidator to the qcombobox and retreving it when the qcombobox is not editable?

wysota
27th September 2010, 18:29
Yes I wanted to complain. However, it was suppose to be a question too: Is there a way of setting a qvalidator to the qcombobox and retreving it when the qcombobox is not editable?
If it is just about attaching one object to another then you can make the validator a child of the combobox and then query the combobox for its children inheriting QValidator interface (using QObject::findChild).