D23835: Add TabKCM

Vlad Zagorodniy noreply at phabricator.kde.org
Tue Sep 10 14:58:57 BST 2019


zzag added inline comments.

INLINE COMMENTS

> TabKCM.qml:153-160
> +        var theTabs = []
> +        var i = 0
> +
> +        for( i=0; i < tabs.length; i++) {
> +            tabs[i].delegate.createObject(sl, {})
> +            theTabs.push(tabs[i].title)
> +        }

FYI, QML has some features from ECMAScript 6, so you could make this code a bit cleaner, e.g.

  for (const tab of tabs)
      tab.delegate.createObject(sl, {});
  
  tabsRepeater.model = tabs.map(tab => tab.title);

(I didn't test whether this code actually works)

REPOSITORY
  R296 KDeclarative

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

To: nicolasfella, mart
Cc: zzag, ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190910/8b3baa44/attachment.html>


More information about the Kde-frameworks-devel mailing list