summaryrefslogtreecommitdiffstats
path: root/src/render/framegraph/sortpolicy.cpp
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2016-05-19 11:29:50 +0200
committerSean Harmer <sean.harmer@kdab.com>2016-05-23 11:57:42 +0000
commit6682a119b4fad6edc0f1b4b0e1613227ff916bae (patch)
tree67b7ab21f08328e74aa84c0cb567ab1224ce6f62 /src/render/framegraph/sortpolicy.cpp
parent4e047448f42fe89c44bebe29c58532c48b5ab18a (diff)
Use QVector instead of QVariantList properties
Change-Id: If7b2688c6032132cfabe5ff02ecbbcf3efbb29d0 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/framegraph/sortpolicy.cpp')
-rw-r--r--src/render/framegraph/sortpolicy.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/render/framegraph/sortpolicy.cpp b/src/render/framegraph/sortpolicy.cpp
index e5e0c40d2..628fa75e4 100644
--- a/src/render/framegraph/sortpolicy.cpp
+++ b/src/render/framegraph/sortpolicy.cpp
@@ -55,14 +55,12 @@ SortPolicy::SortPolicy()
void SortPolicy::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
{
- QPropertyUpdatedChangePtr propertyChange = qSharedPointerCast<QPropertyUpdatedChange>(e);
- if (propertyChange->propertyName() == QByteArrayLiteral("sortType")) {
- const QSortPolicy::SortType cId = propertyChange->value().value<QSortPolicy::SortType>();
- if (cId == QSortPolicy::StateChangeCost || cId == QSortPolicy::BackToFront || cId == QSortPolicy::Material) {
- if (e->type() == PropertyValueAdded)
- m_sortTypes.append(cId);
- else if (e->type() == PropertyValueRemoved)
- m_sortTypes.removeAll(cId);
+ if (e->type() == Qt3DCore::PropertyUpdated) {
+ Qt3DCore::QPropertyUpdatedChangePtr propertyChange = qSharedPointerCast<Qt3DCore::QPropertyUpdatedChange>(e);
+ if (propertyChange->propertyName() == QByteArrayLiteral("sortTypes")) {
+ auto sortTypesInt = propertyChange->value().value<QVector<int>>();
+ m_sortTypes.clear();
+ transformVector(sortTypesInt, m_sortTypes);
}
}
markDirty(AbstractRenderer::AllDirty);