]> git.lyx.org Git - lyx.git/commitdiff
disable editing in the toc dialog
authorPeter Kümmel <syntheticpp@gmx.net>
Sat, 30 Dec 2006 21:51:05 +0000 (21:51 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sat, 30 Dec 2006 21:51:05 +0000 (21:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16447 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/QTocDialog.C

index 639cd21bcc92bb63f7ebfe2b6f593c7066991fc6..8f05af4fceffb3d885b818a7800e6ec72c396c15 100644 (file)
@@ -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