focus - Qt Child Frame passing KeyEvents to Parent Frame -


i have implemented osgqt based model viewer. attempting reposition submodels changing properties in child qframe main mainwindow based viewer frame. child frame non-modal , key events being passed osg viewer based handler in mainwindow instead of child window.

what appropriate attributes child window keep keyboard focus there , allow typing new values in qlineedit based modifier qtreewidgetitem column.

model layer positioning

i have implemented working solution using custom itemdelegate follows.

class doublepositioneditdelegate: public qstyleditemdelegate {     public:       doublepositioneditdelegate(qobject* parent=0): qstyleditemdelegate(parent) {}       virtual qwidget* createeditor(qwidget *parent, const qstyleoptionviewitem &option, const qmodelindex &index) const {           qdoublespinbox* dspinbox = new qdoublespinbox(parent);           dspinbox->setmaximum(1000000.0);           dspinbox->setminimum(-1000000.0);           dspinbox->grabkeyboard();           return dspinbox;       }     }; 

a more elegant/better solution still welcome.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -