0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-10-04 12:07:24 +03:00

added border for page and lrgroupbands has a sorting property

This commit is contained in:
yanis60
2024-05-25 21:10:14 +01:00
parent 9d10ad6227
commit 7b7d4add4e
78 changed files with 31670 additions and 1093 deletions

View File

@@ -22,16 +22,17 @@ QModelIndex CompleterModel::index(int row, int column, const QModelIndex &parent
return createIndex(row, column, parentItem->child(row));
}
QModelIndex CompleterModel::parent(const QModelIndex &child) const
{
if (child.isValid()){
CompleterItem *childItem = static_cast<CompleterItem*>(child.internalPointer());
CompleterItem *parentItem = childItem->parent();
if (parentItem != &m_root) {
return indexFromItem(parentItem);
}
QModelIndex CompleterModel::parent(const QModelIndex &child) const {
if(child.isValid()) {
if(CompleterItem *childItem = static_cast<CompleterItem *>(child.internalPointer());
childItem) {
CompleterItem *parentItem = childItem->parent();
if(parentItem != &m_root) {
return indexFromItem(parentItem);
}
}
return QModelIndex();
}
return QModelIndex();
}
int CompleterModel::rowCount(const QModelIndex &parent) const

View File

@@ -12,7 +12,9 @@ public:
CompleterItem(QString text, QIcon icon):m_parent(0), m_text(text), m_icon(icon), m_model(0){}
~CompleterItem();
int rowCount() const {return m_children.count();}
CompleterItem* child(int row) const {return m_children.at(row).data();}
CompleterItem *child(int row) const {
return m_children.count() > row ? m_children.at(row).data() : nullptr;
}
CompleterItem* parent() const {return m_parent;}
int row() const{
if (m_parent){
@@ -33,7 +35,7 @@ public:
void appendRow(CompleterItem* child);
void appendRows(const QList<CompleterItem *> &children);
private:
CompleterItem* m_parent;
CompleterItem* m_parent{nullptr};
QVector<QSharedPointer<CompleterItem> > m_children;
QString m_text;
QIcon m_icon;