From c845e5968fe153e3a22053ebf2542986daaf265f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Sat, 30 Dec 2006 21:51:05 +0000 Subject: [PATCH] disable editing in the toc dialog git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16447 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QTocDialog.C | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/QTocDialog.C b/src/frontends/qt4/QTocDialog.C index 639cd21bcc..8f05af4fce 100644 --- a/src/frontends/qt4/QTocDialog.C +++ b/src/frontends/qt4/QTocDialog.C @@ -88,7 +88,8 @@ opinion, somebody should derive a new qvariant class for tocModelItem which saves the string data and depth information. that will save the depth calculation. */ -int QTocDialog::getIndexDepth(QModelIndex const & index, int depth){ +int QTocDialog::getIndexDepth(QModelIndex const & index, int depth) +{ ++depth; return (index.parent() == QModelIndex())? depth : getIndexDepth(index.parent(),depth); } @@ -219,6 +220,7 @@ void QTocDialog::updateGui() enableButtons(); typeCO->setModel(type_model); tocTV->setModel(new QStandardItemModel); + tocTV->setEditTriggers(QAbstractItemView::NoEditTriggers); return; } @@ -226,7 +228,10 @@ void QTocDialog::updateGui() typeCO->setCurrentIndex(form_->getType()); if (form_->tocModel()) + { tocTV->setModel(form_->tocModel()); + tocTV->setEditTriggers(QAbstractItemView::NoEditTriggers); + } tocTV->showColumn(0); // hide the pointless QHeader for now // in the future, new columns may appear