mirror of
https://invent.kde.org/plasma/plasma-desktop.git
synced 2026-11-03 22:59:45 -09:00
Pager's WindowModel adds a StackingOrder role (with rolename StackingOrder), but the source model already has this role with the same rolename. When we try to get the new property from qml for a delegate, we get many warnings of the type: qt.qml.propertyCache.append: Final member StackingOrder is overridden in class QQmlDMAbstractItemModelData. The override won't be used. The two properties (AbstractTaskModel's StackingOrder and pager's StackingOrder) usually give the same result, so there doesn't seem to break anything badly, but we can get rid of the warnings (and get the value as originally inteded) by giving the WindowModel role a unique name (PagerStackingOrder).
37 lines
710 B
C++
37 lines
710 B
C++
/*
|
|
SPDX-FileCopyrightText: 2016 Eike Hein <hein.org>
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "taskfilterproxymodel.h"
|
|
|
|
#include <memory>
|
|
|
|
class PagerModel;
|
|
|
|
class WindowModel : public TaskManager::TaskFilterProxyModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum WindowModelRoles {
|
|
PagerStackingOrder = Qt::UserRole + 1,
|
|
};
|
|
Q_ENUM(WindowModelRoles)
|
|
|
|
explicit WindowModel(PagerModel *parent);
|
|
~WindowModel() override;
|
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
|
|
private Q_SLOTS:
|
|
void onPagerItemSizeChanged();
|
|
|
|
private:
|
|
class Private;
|
|
std::unique_ptr<Private> d;
|
|
};
|