///////////////////////////////////////////////////////////////////////////////
//
-// TocModels
+// TocTypeModel
//
///////////////////////////////////////////////////////////////////////////////
}
+///////////////////////////////////////////////////////////////////////////////
+//
+// TocModel
+//
+///////////////////////////////////////////////////////////////////////////////
+
TocModel::TocModel(QObject * parent)
: model_(new TocTypeModel(parent)),
sorted_model_(new QSortFilterProxyModel(parent)),
sorted_model_->sort(0);
}
+
TocItem const & TocModel::tocItem(QModelIndex const & index) const
{
return (*toc_)[model()->data(index, Qt::UserRole).toUInt()];
int TocModel::modelDepth() const
{
int const d = maxdepth_ - mindepth_;
- LASSERT(d >= 0 && d <= 100, /* */);
+ LASSERT(d >= 0 && d <= 100, return 0);
return d;
}
namespace frontend {
+/// A QStandardItemModel that gives access to the reset method.
+/// This is needed in order to fix http://bugzilla.lyx.org/show_bug.cgi?id=3740
class TocTypeModel : public QStandardItemModel
{
public:
void reset();
};
-
+/// A class that adapt the TocBackend of a Buffer into standard Qt models for
+/// GUI visualisation.
+/// There is one TocModel per list in the TocBackend.
class TocModel
{
public:
};
+/// A container for the different TocModels.
class TocModels : public QObject
{
Q_OBJECT