Hostel
13th September 2011, 00:32
I'm making a widget for mapping a QRecord to input widgets. I want to that this new class will be similar in use with QDataWidgetMapper. I create a method
addMapping( QWidget* _widget, int _field );
In this method I want to set a value from record to input control(_widget). How can I do this in right way? My only thing is to make in method a series of dynamic_cast's to discover what a input widget is under _widget pointer. The same issue I have with reading values from input widgets to record - there again I need to know of type widget because I need read value. How to resolve this situation in elegant way?
addMapping( QWidget* _widget, int _field );
In this method I want to set a value from record to input control(_widget). How can I do this in right way? My only thing is to make in method a series of dynamic_cast's to discover what a input widget is under _widget pointer. The same issue I have with reading values from input widgets to record - there again I need to know of type widget because I need read value. How to resolve this situation in elegant way?