View Full Version : QtPropertyBrowser-2.5_1 CheckBox not receiving FocusOut events upon deselection

3rd May 2013, 17:53
Greetings Qt People,

I am using the QtPropertyBrowser-2.5_1 code from qt-labs and am having a problem with the QtCheckBoxFactory / QtBoolPropertyManager code. My searches indicate that there is precious little information about this code. I'm hoping someone here can offer some insight on a solution to my problem.

Short background:
I’m using a QAbstractTableModel being viewed by a QTableView and the QtTreePropertyBrowser. When an item in the table is selected its corresponding properties are displayed in the property browser. This all works fine.

The property browser contains several properties each of the following types: strings, ints, enumerations, checkboxes which use the QtPropertyBrowser classes- QtStringPropertyManager/QtLineEditFactory, QtIntPropertyManager/QtSpinBoxFactory, QtEnumPropertyManager/QtEnumEditorFactory, QtBoolPropertyManager/QtCheckBoxFactory.

The Problem:
When editing properties and then changing selection via the table, the editors for each of the types, EXCEPT the checkBox, are destroyed. After a selection change, the QOject::event() function receives QEvent::FocusOut and DeferredDelete events for each type of editor except for the checkBox editor (QtBoolEdit) which receives only a QEvent::Paint event. Therefore, the checkBox does not go out of focus for any subsequent selections until another property editor is invoked. The checkBox is the only editor to exhibit this behavior.

I put the event() function in the QtBoolEdit code to verify that the FocusOut and DeferredDelete events are not getting to it- they are not. What is so special about the checkBox/QtBoolEdit that it acts differently than all the other editors?

Does anyone know why this is happening or how it can be fixed?