<table><tr><td style="">aacid added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D16137">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #8C98B8;
          color: #6B748C;
          font-style: italic;
          margin: 4px 0 12px 0;
          padding: 8px 12px;
          background-color: #F8F9FC;">
<div style="font-style: normal;
          padding-bottom: 4px;">In <a href="https://phabricator.kde.org/D16137#341984" style="background-color: #e7e7e7;
          border-color: #e7e7e7;
          border-radius: 3px;
          padding: 0 4px;
          font-weight: bold;
          color: black;text-decoration: none;">D16137#341984</a>, <a href="https://phabricator.kde.org/p/kadabash/" style="
              border-color: #f1f7ff;
              color: #19558d;
              background-color: #f1f7ff;
                border: 1px solid transparent;
                border-radius: 3px;
                font-weight: bold;
                padding: 0 4px;">@kadabash</a> wrote:</div>
<div style="margin: 0;
          padding: 0;
          border: 0;
          color: rgb(107, 116, 140);"><p>I have to admit, I don't know how to implement a version with flags correctly.</p></div>
</blockquote>

<p>Look at kcmodule.h for example you'll see some flags defined there, then there's a setButtons function, this would be the same but to the addPage function</p>

<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>Did I understand you correctly in that an overload with signature</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">addPage(QWidget *page, const QString &itemName, const QString &pixmapName = QString(), const QString &header = QString(), bool manage = true, bool fitContentHorizontally = false)</pre></div>

<p>would be ok as well? This would then be called by the overload without the last option (i.e. the <tt style="background: #ebebeb; font-size: 13px;">addPage</tt> that existed before this diff).</p></blockquote>

<p>I'm not really the kconfigwidgets maintainer so i can't say if that would be acceptable API wise, but it would be ok binary compatibility wise, yes.</p>

<p>It would though not compile because would mean you have two functions</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">addPage(QWidget *page, const QString &itemName, const QString &pixmapName = QString(), const QString &header = QString(), bool manage = true)
addPage(QWidget *page, const QString &itemName, const QString &pixmapName = QString(), const QString &header = QString(), bool manage = true, bool fitContentHorizontally = false)</pre></div>

<p>which one would be called when i call</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">addPage(someWidget, "myItemName")</pre></div>

<p>the first or the second?</p>

<p>To solve that you need to make your new function not have default values, but as said i'm not sure if that's ok API wise, personally i think using flags is nicer</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R265 KConfigWidgets</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D16137">https://phabricator.kde.org/D16137</a></div></div><br /><div><strong>To: </strong>kadabash<br /><strong>Cc: </strong>aacid, kde-frameworks-devel, michaelh, ngraham, bruns<br /></div>