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

David Edmundson noreply at phabricator.kde.org
Wed Oct 30 15:14:39 GMT 2019


davidedmundson added inline comments.

INLINE COMMENTS

> kpropertywriter_p.h:26
> +
> +class KPropertyWriter : public QObject
> +{

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.

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/20191030/fec5f9b2/attachment.html>


More information about the Plasma-devel mailing list