Add overload of flags() function
parent
82c2a1d86f
commit
badea81a87
|
@ -1,92 +0,0 @@
|
|||
{
|
||||
"cppFile": "src/Bindings.cpp",
|
||||
"rust": {
|
||||
"dir": "rust",
|
||||
"interfaceModule": "testinterface",
|
||||
"implementationModule": "testimplementation",
|
||||
"typesModule": "types"
|
||||
},
|
||||
"objects": [{
|
||||
"name": "Directory",
|
||||
"type": "List",
|
||||
"properties": [{
|
||||
"name": "path",
|
||||
"type": "QString",
|
||||
"write": true
|
||||
}],
|
||||
"roles": [
|
||||
[{
|
||||
"name": "fileName",
|
||||
"value": "Qt::DisplayRole",
|
||||
"type": "QString"
|
||||
}, {
|
||||
"name": "fileIcon",
|
||||
"value": "Qt::DecorationRole",
|
||||
"type": "QByteArray"
|
||||
}, {
|
||||
"name": "filePath",
|
||||
"value": "Qt::UserRole + 1",
|
||||
"type": "QString"
|
||||
}, {
|
||||
"name": "fileName",
|
||||
"value": "Qt::UserRole + 2",
|
||||
"type": "QString"
|
||||
}, {
|
||||
"name": "filePermissions",
|
||||
"value": "Qt::UserRole + 3",
|
||||
"type": "qint32"
|
||||
}],
|
||||
[{
|
||||
"name": "filePath",
|
||||
"value": "Qt::DisplayRole",
|
||||
"type": "QString"
|
||||
}],
|
||||
[{
|
||||
"name": "filePermissions",
|
||||
"value": "Qt::DisplayRole",
|
||||
"type": "qint32"
|
||||
}]
|
||||
]
|
||||
}, {
|
||||
"name": "TestTree",
|
||||
"type": "UniformTree",
|
||||
"properties": [{
|
||||
"name": "path",
|
||||
"type": "QString",
|
||||
"write": true
|
||||
}],
|
||||
"roles": [
|
||||
[{
|
||||
"name": "fileName",
|
||||
"value": "Qt::DisplayRole",
|
||||
"type": "QString"
|
||||
}, {
|
||||
"name": "fileIcon",
|
||||
"value": "Qt::DecorationRole",
|
||||
"type": "QByteArray"
|
||||
}, {
|
||||
"name": "filePath",
|
||||
"value": "Qt::UserRole + 1",
|
||||
"type": "QString"
|
||||
}, {
|
||||
"name": "fileName",
|
||||
"value": "Qt::UserRole + 2",
|
||||
"type": "QString"
|
||||
}, {
|
||||
"name": "filePermissions",
|
||||
"value": "Qt::UserRole + 3",
|
||||
"type": "qint32"
|
||||
}],
|
||||
[{
|
||||
"name": "filePath",
|
||||
"value": "Qt::DisplayRole",
|
||||
"type": "QString"
|
||||
}],
|
||||
[{
|
||||
"name": "filePermissions",
|
||||
"value": "Qt::DisplayRole",
|
||||
"type": "qint32"
|
||||
}]
|
||||
]
|
||||
}]
|
||||
}
|
|
@ -164,6 +164,10 @@ void FibonacciList::sort(int column, Qt::SortOrder order)
|
|||
{
|
||||
fibonacci_list_sort(d, column, order);
|
||||
}
|
||||
Qt::ItemFlags FibonacciList::flags(const QModelIndex &i) const
|
||||
{
|
||||
return QAbstractItemModel::flags(i);
|
||||
}
|
||||
QVariant FibonacciList::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
QVariant v;
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
bool canFetchMore(const QModelIndex &parent) const override;
|
||||
void fetchMore(const QModelIndex &parent) override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
signals:
|
||||
|
|
|
@ -170,6 +170,10 @@ void Tree::sort(int column, Qt::SortOrder order)
|
|||
{
|
||||
tree_sort(d, column, order);
|
||||
}
|
||||
Qt::ItemFlags Tree::flags(const QModelIndex &i) const
|
||||
{
|
||||
return QAbstractItemModel::flags(i);
|
||||
}
|
||||
QVariant Tree::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
QVariant v;
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
bool canFetchMore(const QModelIndex &parent) const override;
|
||||
void fetchMore(const QModelIndex &parent) override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
signals:
|
||||
|
|
|
@ -283,6 +283,7 @@ void writeHeaderItemModel(QTextStream& h) {
|
|||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
bool canFetchMore(const QModelIndex &parent) const override;
|
||||
void fetchMore(const QModelIndex &parent) override;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
signals:
|
||||
|
@ -424,6 +425,10 @@ void %1::sort(int column, Qt::SortOrder order)
|
|||
{
|
||||
%2_sort(d, column, order);
|
||||
}
|
||||
Qt::ItemFlags %1::flags(const QModelIndex &i) const
|
||||
{
|
||||
return QAbstractItemModel::flags(i);
|
||||
}
|
||||
QVariant %1::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
QVariant v;
|
||||
|
|
Loading…
Reference in New Issue