From: Peter Kümmel Date: Sat, 30 Dec 2006 21:51:05 +0000 (+0000) Subject: disable editing in the toc dialog X-Git-Tag: 1.6.10~11406 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=c845e5968fe153e3a22053ebf2542986daaf265f;p=lyx.git disable editing in the toc dialog git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16447 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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