D29502: kwidgetsaddons: Add a named colors support in KColorCombo.

Tomaz Canabrava noreply at phabricator.kde.org
Thu May 7 15:28:02 BST 2020


tcanabrava added inline comments.

INLINE COMMENTS

> kcolorcombo.cpp:244
> +{
> +    QList<KColorCombo::KNamedColor> namedColors;
> +    for (int colorIndex = 0; colorIndex < colors.count(); colorIndex++) {

namedColors.reserve(colors.size());

> kcolorcombo.cpp:245
> +    QList<KColorCombo::KNamedColor> namedColors;
> +    for (int colorIndex = 0; colorIndex < colors.count(); colorIndex++) {
> +        namedColors.insert(colorIndex, { QString(), colors[colorIndex] });

for(auto color : colors)

> kcolorcombo.cpp:288
> +        for (int index = 0; index < STANDARD_PALETTE_SIZE; ++index) {
> +            //list += {QString(), standardColor(index)};
> +        }

why is there a for running with all code comented out?

> kcolorcombo.cpp:291
> +        return list;
>      } else {
>          return d->colorList;

remove the else, just return directly.

> araujoluis wrote in kcolorcombo.h:60
> broulik try a solution in several ways, but it looks like this was the most convenient one found so far.

QPair<QString, QColor> - no need for a struct.

REPOSITORY
  R236 KWidgetsAddons

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

To: araujoluis, tcanabrava, patrickelectric, hindenburg, ngraham
Cc: broulik, cfeck, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200507/4dcfc45e/attachment-0001.htm>


More information about the Kde-frameworks-devel mailing list