Merge branch 'master' into editbubble
This commit is contained in:
commit
a82d043931
@ -123,6 +123,18 @@ void SortFilterModel::setSortOrder(const Qt::SortOrder order)
|
|||||||
sort(0, order);
|
sort(0, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVariantHash SortFilterModel::get(int row) const
|
||||||
|
{
|
||||||
|
QModelIndex idx = index(row, 0);
|
||||||
|
QVariantHash hash;
|
||||||
|
|
||||||
|
QHash<int, QByteArray>::const_iterator i;
|
||||||
|
for (i = roleNames().constBegin(); i != roleNames().constEnd(); ++i) {
|
||||||
|
hash[i.value()] = data(idx, i.key());
|
||||||
|
}
|
||||||
|
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -423,6 +435,19 @@ int DataModel::columnCount(const QModelIndex &parent) const
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QVariantHash DataModel::get(int row) const
|
||||||
|
{
|
||||||
|
QModelIndex idx = index(row, 0);
|
||||||
|
QVariantHash hash;
|
||||||
|
|
||||||
|
QHash<int, QByteArray>::const_iterator i;
|
||||||
|
for (i = roleNames().constBegin(); i != roleNames().constEnd(); ++i) {
|
||||||
|
hash[i.value()] = data(idx, i.key());
|
||||||
|
}
|
||||||
|
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
int DataModel::roleNameToId(const QString &name)
|
int DataModel::roleNameToId(const QString &name)
|
||||||
{
|
{
|
||||||
if (!m_roleIds.contains(name)) {
|
if (!m_roleIds.contains(name)) {
|
||||||
|
@ -68,6 +68,8 @@ public:
|
|||||||
|
|
||||||
int count() const {return QSortFilterProxyModel::rowCount();}
|
int count() const {return QSortFilterProxyModel::rowCount();}
|
||||||
|
|
||||||
|
Q_INVOKABLE QVariantHash get(int i) const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void countChanged();
|
void countChanged();
|
||||||
|
|
||||||
@ -124,6 +126,8 @@ public:
|
|||||||
|
|
||||||
int count() const {return countItems();}
|
int count() const {return countItems();}
|
||||||
|
|
||||||
|
Q_INVOKABLE QVariantHash get(int i) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setItems(const QString &sourceName, const QVariantList &list);
|
void setItems(const QString &sourceName, const QVariantList &list);
|
||||||
inline int countItems() const;
|
inline int countItems() const;
|
||||||
|
@ -190,7 +190,7 @@ Item {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
id: dragArea
|
id: dragArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
enabled: scrollbar.enabled
|
//enabled: scrollbar.enabled
|
||||||
drag {
|
drag {
|
||||||
target: handle
|
target: handle
|
||||||
axis: Drag.YAxis
|
axis: Drag.YAxis
|
||||||
|
Loading…
x
Reference in New Issue
Block a user