On 03/08/2010 08:52 PM, [email protected] wrote:
Author: rgheck Date: Mon Mar 8 20:52:48 2010 New Revision: 33680 URL: http://www.lyx.org/trac/changeset/33680Log: Revert r33630 and do something more sensible. I don't think this fixes the underlying problem, but I think that problem is very extensive. Fixing it would involve a re-thinking of where and how we call updateBuffer()---the old updateLabels(). This fix also reveals another problem with the TOC, again due to the early call of on_typeCO_currentIndexChanged(). But that problem is a slightly different one, I think. Modified: lyx-devel/trunk/src/frontends/qt4/TocModel.cpp lyx-devel/trunk/src/frontends/qt4/TocWidget.cpp Modified: lyx-devel/trunk/src/frontends/qt4/TocModel.cpp ============================================================================== --- lyx-devel/trunk/src/frontends/qt4/TocModel.cpp Mon Mar 8 20:07:05 2010 (r33679) +++ lyx-devel/trunk/src/frontends/qt4/TocModel.cpp Mon Mar 8 20:52:48 2010 (r33680) @@ -359,8 +359,8 @@ names_->setData(index, gui_name, Qt::DisplayRole); names_->setData(index, type, Qt::UserRole); } - names_->reset(); names_->blockSignals(false); + names_->reset(); } Modified: lyx-devel/trunk/src/frontends/qt4/TocWidget.cpp ============================================================================== --- lyx-devel/trunk/src/frontends/qt4/TocWidget.cpp Mon Mar 8 20:07:05 2010 (r33679) +++ lyx-devel/trunk/src/frontends/qt4/TocWidget.cpp Mon Mar 8 20:52:48 2010 (r33680) @@ -315,7 +315,13 @@ { current_type_ = typeCO->itemData(index).toString(); updateView(); - gui_view_.setFocus(); + // In Qt 4.6.x, we can end up here programmatically, when the + // model is rebuilt. But the Buffer may not be ready for us to + // reset focus, start the cursor, etc. So we check to see if the + // combo box has focus. It will, if the user has changed the + // value. + if (typeCO->hasFocus()) + gui_view_.setFocus();
That's a good work-around. Abdel.
