|
|
|
@@ -16,7 +16,8 @@
|
|
|
|
|
#include <xqitem.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! firz
|
|
|
|
|
//! kontstruktor. übergibt den start-index und einen model-knoten mit der beschreibung
|
|
|
|
|
//! der datenknoten.
|
|
|
|
|
|
|
|
|
|
XQModelSection::XQModelSection(const QModelIndex& aModelIndex, XQNodePtr aSheetNode)
|
|
|
|
|
: modelIndex{ aModelIndex }, sheetRootNode{ aSheetNode }
|
|
|
|
@@ -25,7 +26,7 @@ XQModelSection::XQModelSection(const QModelIndex& aModelIndex, XQNodePtr aSheetN
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! firz
|
|
|
|
|
//! elementvergleich.
|
|
|
|
|
|
|
|
|
|
bool XQModelSection::operator==(const XQModelSection& other) const
|
|
|
|
|
{
|
|
|
|
@@ -33,7 +34,7 @@ bool XQModelSection::operator==(const XQModelSection& other) const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! firz
|
|
|
|
|
//! true wenn der start-index valide und ein model-knoten vorhanden.
|
|
|
|
|
|
|
|
|
|
bool XQModelSection::isValid() const
|
|
|
|
|
{
|
|
|
|
@@ -41,7 +42,7 @@ bool XQModelSection::isValid() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! firz
|
|
|
|
|
//! gibt die zeile des start-index zurück.
|
|
|
|
|
|
|
|
|
|
int XQModelSection::XQModelSection::row() const
|
|
|
|
|
{
|
|
|
|
@@ -49,7 +50,7 @@ int XQModelSection::XQModelSection::row() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! firz
|
|
|
|
|
//! gibt das dieser section entsprechende header-item zurück.
|
|
|
|
|
|
|
|
|
|
XQItem& XQModelSection::XQModelSection::headerItem() const
|
|
|
|
|
{
|
|
|
|
@@ -57,20 +58,14 @@ XQItem& XQModelSection::XQModelSection::headerItem() const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void XQModelSections::addSectionEntry(const QModelIndex& idx, XQNodePtr sheetNode)
|
|
|
|
|
void XQModelSectionList::addSectionEntry(const QModelIndex& idx, XQNodePtr sheetNode)
|
|
|
|
|
{
|
|
|
|
|
XQModelSection section(idx, sheetNode);
|
|
|
|
|
addAtKey(sheetNode->tag_name(), section);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool XQModelSections::hasValidSection(const QString& sectionKey) const
|
|
|
|
|
bool XQModelSectionList::hasValidSection(const QString& sectionKey) const
|
|
|
|
|
{
|
|
|
|
|
if (!contains(sectionKey) )
|
|
|
|
|
return false;
|
|
|
|
@@ -78,13 +73,13 @@ bool XQModelSections::hasValidSection(const QString& sectionKey) const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const XQModelSection& XQModelSections::sectionxqItemFromIndex( const QModelIndex& index ) const
|
|
|
|
|
const XQModelSection& XQModelSectionList::sectionxqItemFromIndex( const QModelIndex& index ) const
|
|
|
|
|
{
|
|
|
|
|
return sectionFromRow( index.row() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const XQModelSection& XQModelSections::sectionFromRow(int itemRow ) const
|
|
|
|
|
const XQModelSection& XQModelSectionList::sectionFromRow(int itemRow ) const
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int i = size() - 1;
|
|
|
|
@@ -100,19 +95,19 @@ const XQModelSection& XQModelSections::sectionFromRow(int itemRow ) const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int XQModelSections::firstRow(const QModelIndex& idx) const
|
|
|
|
|
int XQModelSectionList::firstRow(const QModelIndex& idx) const
|
|
|
|
|
{
|
|
|
|
|
return sectionFromRow(idx.row() ).row();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int XQModelSections::lastRow(const QModelIndex& idx) const
|
|
|
|
|
int XQModelSectionList::lastRow(const QModelIndex& idx) const
|
|
|
|
|
{
|
|
|
|
|
return lastRow(sectionFromRow(idx.row()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int XQModelSections::lastRow(const XQModelSection& section ) const
|
|
|
|
|
int XQModelSectionList::lastRow(const XQModelSection& section ) const
|
|
|
|
|
{
|
|
|
|
|
//qDebug() << " -- last row in section: " << section.modelIndex.data().toString() << " --> " << section.modelIndex.row();
|
|
|
|
|
// row() der section unterhalb dieser
|
|
|
|
@@ -130,7 +125,7 @@ int XQModelSections::lastRow(const XQModelSection& section ) const
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void XQModelSections::dump() const
|
|
|
|
|
void XQModelSectionList::dump() const
|
|
|
|
|
{
|
|
|
|
|
qDebug() << " --- sections dump(): " <<size() << " entries.";
|
|
|
|
|
for( int i = 0; i<size(); ++i )
|
|
|
|
|