D25000: Do not assign combobox currentIndex as it breaks binding.

Cyril Rossi noreply at phabricator.kde.org
Thu Oct 31 08:50:00 GMT 2019


crossi added inline comments.

INLINE COMMENTS

> davidedmundson wrote in kpropertywriter_p.h:26
> Throwing out another option
> 
>   class KPropertyWriter : public QObject, public QQmlPropertyValueSource
>   {
>       Q_INVOKABLE bool writeProperty(QVariant value);
>   }
>   
>   writeProperty(QVariant) {
>     object()->setProperty(name(), value());
>     // we can't use property().write() as that'll break the binding
>   }
>   
>   
>   PropertyWriter on currentIndex {
>      id: controlRootWriter
>   }
> 
> Though it's basically the same thing, so don't feel you have to, just wanted to share the suggestion as it reduces two properties.

Thank you for sharing other option, I didn't know this one.

REPOSITORY
  R858 Qt Quick Controls 2: Desktop Style

REVISION DETAIL
  https://phabricator.kde.org/D25000

To: crossi, #plasma, ervin, mart, bport, broulik
Cc: davidedmundson, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191031/19024d16/attachment-0001.html>


More information about the Plasma-devel mailing list