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);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (!m_roleIds.contains(name)) {
|
||||
|
@ -68,6 +68,8 @@ public:
|
||||
|
||||
int count() const {return QSortFilterProxyModel::rowCount();}
|
||||
|
||||
Q_INVOKABLE QVariantHash get(int i) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void countChanged();
|
||||
|
||||
@ -124,6 +126,8 @@ public:
|
||||
|
||||
int count() const {return countItems();}
|
||||
|
||||
Q_INVOKABLE QVariantHash get(int i) const;
|
||||
|
||||
protected:
|
||||
void setItems(const QString &sourceName, const QVariantList &list);
|
||||
inline int countItems() const;
|
||||
|
@ -190,7 +190,7 @@ Item {
|
||||
MouseArea {
|
||||
id: dragArea
|
||||
anchors.fill: parent
|
||||
enabled: scrollbar.enabled
|
||||
//enabled: scrollbar.enabled
|
||||
drag {
|
||||
target: handle
|
||||
axis: Drag.YAxis
|
||||
|
Loading…
x
Reference in New Issue
Block a user