summary refs log tree commit diff
path: root/src/timeline/DelegateChooser.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 22:46:04 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-29 22:46:04 +0100
commitb847623fbe2e33e228e4744e5fb4a2bde903397d (patch)
tree6030050ba142b1ff8d0223d60d69f4e49e5a2a21 /src/timeline/DelegateChooser.h
parentReduce allocations for presence states a bit (diff)
downloadnheko-b847623fbe2e33e228e4744e5fb4a2bde903397d.tar.xz
Reduce allocations and time spent creating delegates by half
Diffstat (limited to 'src/timeline/DelegateChooser.h')
-rw-r--r--src/timeline/DelegateChooser.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/timeline/DelegateChooser.h b/src/timeline/DelegateChooser.h

index 3e4b16d7..4e83fce1 100644 --- a/src/timeline/DelegateChooser.h +++ b/src/timeline/DelegateChooser.h
@@ -25,10 +25,11 @@ public: Q_PROPERTY(QVariant roleValue READ roleValue WRITE setRoleValue NOTIFY roleValueChanged) Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged) - QQmlComponent *delegate() const; + [[nodiscard]] QQmlComponent *delegate() const; void setDelegate(QQmlComponent *delegate); - QVariant roleValue() const; + [[nodiscard]] QVariant roleValue() const; + [[nodiscard]] const QVariant &roleValueRef() const { return roleValue_; } void setRoleValue(const QVariant &value); signals: @@ -53,10 +54,10 @@ public: QQmlListProperty<DelegateChoice> choices(); - QVariant roleValue() const; + [[nodiscard]] QVariant roleValue() const; void setRoleValue(const QVariant &value); - QQuickItem *child() const { return child_; } + [[nodiscard]] QQuickItem *child() const { return child_; } void recalcChild(); void componentComplete() override;