diff --git a/src/frontends/qt4/TocModel.cpp b/src/frontends/qt4/TocModel.cpp index b8da14aa22..e6d6d08b24 100644 --- a/src/frontends/qt4/TocModel.cpp +++ b/src/frontends/qt4/TocModel.cpp @@ -41,8 +41,7 @@ namespace frontend { TocTypeModel::TocTypeModel(QObject * parent) : QStandardItemModel(parent) -{ -} +{} void TocTypeModel::reset() @@ -50,6 +49,19 @@ void TocTypeModel::reset() QStandardItemModel::reset(); } +#if QT_VERSION >= 0x040600 +void TocTypeModel::beginResetModel() { + QStandardItemModel::beginResetModel(); +} + + +void TocTypeModel::endResetModel() +{ + QStandardItemModel::endResetModel(); +} +#endif + + /////////////////////////////////////////////////////////////////////////////// // @@ -338,6 +350,9 @@ void TocModels::reset(BufferView const * bv) } names_->blockSignals(true); +#if QT_VERSION >= 0x040600 + names_->beginResetModel(); +#endif names_->insertColumns(0, 1); TocList const & tocs = bv_->buffer().masterBuffer()->tocBackend().tocs(); TocList::const_iterator it = tocs.begin(); @@ -360,7 +375,11 @@ void TocModels::reset(BufferView const * bv) names_->setData(index, type, Qt::UserRole); } names_->blockSignals(false); +#if QT_VERSION >= 0x040600 + names_->endResetModel(); +#else names_->reset(); +#endif } diff --git a/src/frontends/qt4/TocModel.h b/src/frontends/qt4/TocModel.h index 7475416160..b177880878 100644 --- a/src/frontends/qt4/TocModel.h +++ b/src/frontends/qt4/TocModel.h @@ -38,6 +38,10 @@ public: TocTypeModel(QObject * parent); /// void reset(); +#if QT_VERSION >= 0x040600 + void beginResetModel(); + void endResetModel(); +#endif }; /// A class that adapt the TocBackend of a Buffer into standard Qt models for