[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-frameworks-devel
Subject: Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer
From: Kåre Särs <kare.sars () iki ! fi>
Date: 2016-06-16 16:50:35
Message-ID: 20160616165035.9803.3221 () mimi ! kde ! org
[Download RAW message or body]
--===============3458350923096117176==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
> On June 16, 2016, 4:47 p.m., Kåre Särs wrote:
> > I'm getting this error on Windows with MSVC 2015 after this commit.
> >
> > ...etsaddons\src\kcapacitybar.h(234): error C2668: 'KCapacityBar::KCapacityBar': \
> > ambiguous call to overloaded function
> > ...etsaddons\src\kcapacitybar.h(80): note: could be \
> > 'KCapacityBar::KCapacityBar(KCapacityBar::DrawTextMode,QWidget \
> > *)'
> > ...etsaddons\src\kcapacitybar.h(71): note: or \
> > 'KCapacityBar::KCapacityBar(QWidget *)'
> > ...etsaddons\src\kcapacitybar.h(234): note: while trying to match the argument \
> > list '()'
>
> Elvis Angelaccio wrote:
> Could this be a bug in MSVC?
Removing the default argument from the new one with only one argument could maybe \
solve the problem for all cases.
- Kåre
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128191/#review96599
-----------------------------------------------------------
On June 16, 2016, 1:10 p.m., Elvis Angelaccio wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128191/
> -----------------------------------------------------------
>
> (Updated June 16, 2016, 1:10 p.m.)
>
>
> Review request for KDE Frameworks and Christoph Feck.
>
>
> Repository: kwidgetsaddons
>
>
> Description
> -------
>
> Currently KCapacityBar doesn't seem to be usable from Qt Designer (unless I'm doing \
> something wrong). The class has only an explicit multi-argument constructor, but Qt \
> Designer generates something like:
> ```c++
> capacityBar = new KCapacityBar(widget_3);
> ```
>
> which fails to compile because there is no explicit conversion from `QWidget*` to \
> `KCapacityBar::DrawTextMode`:
> ```
> error: no matching constructor for initialization of 'KCapacityBar'
> capacityBar = new KCapacityBar(widget_3);
> ^ ~~~~~~~~
> /usr/include/KF5/KWidgetsAddons/kcapacitybar.h:44:29: note: candidate constructor \
> (the implicit copy constructor) not viable: no known conversion from 'QWidget *' to \
> 'const KCapacityBar' for 1st argument class KWIDGETSADDONS_EXPORT KCapacityBar
> ^
> /usr/include/KF5/KWidgetsAddons/kcapacitybar.h:72:14: note: candidate constructor \
> not viable: no known conversion from 'QWidget *' to 'KCapacityBar::DrawTextMode' \
> for 1st argument explicit KCapacityBar(DrawTextMode drawTextMode = DrawTextOutline, \
> QWidget *parent = 0); ```
>
> This patch simply adds another constructor with a single argument (the pointer to \
> the parent).
>
> Diffs
> -----
>
> src/kcapacitybar.h 1a1f2e60f415904d6cf603a4b4e0cae1c543169a
> src/kcapacitybar.cpp ecd2c13feb88f5c9e92086639bff48c6d0527779
> src/kmultitabbar.h 068f0980827e6806d7cb2a17e8b261f7e1620204
> src/kmultitabbar.cpp bc58b81cbe4d98043762a36a43b4777ada30734f
>
> Diff: https://git.reviewboard.kde.org/r/128191/diff/
>
>
> Testing
> -------
>
> KCapacityBar can now be used in a Qt Designer custom widget.
>
>
> Thanks,
>
> Elvis Angelaccio
>
>
--===============3458350923096117176==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;"> \
<tr> <td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/128191/">https://git.reviewboard.kde.org/r/128191/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On June 16th, 2016, 4:47 p.m. UTC, <b>Kåre \
Särs</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;"> <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">I'm getting this error on Windows with MSVC 2015 after this commit.
...etsaddons\src\kcapacitybar.h(234): error C2668: \
'KCapacityBar::KCapacityBar': ambiguous call to overloaded \
function
...etsaddons\src\kcapacitybar.h(80): note: could be \
'KCapacityBar::KCapacityBar(KCapacityBar::DrawTextMode,QWidget \
*)'
...etsaddons\src\kcapacitybar.h(71): note: or \
'KCapacityBar::KCapacityBar(QWidget *)'
...etsaddons\src\kcapacitybar.h(234): note: while trying to match the argument list \
'()'</pre> </blockquote>
<p>On June 16th, 2016, 4:49 p.m. UTC, <b>Elvis Angelaccio</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Could \
this be a bug in MSVC?</p></pre> </blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Removing the default \
argument from the new one with only one argument could maybe solve the problem for \
all cases.</pre> <br />
<p>- Kåre</p>
<br />
<p>On June 16th, 2016, 1:10 p.m. UTC, Elvis Angelaccio wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;"> <tr>
<td>
<div>Review request for KDE Frameworks and Christoph Feck.</div>
<div>By Elvis Angelaccio.</div>
<p style="color: grey;"><i>Updated June 16, 2016, 1:10 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kwidgetsaddons
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Currently KCapacityBar doesn't seem to be usable from \
Qt Designer (unless I'm doing something wrong). The class has only an explicit \
multi-argument constructor, but Qt Designer generates something like:</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;"><div class="codehilite" style="background: #f8f8f8"><pre \
style="line-height: 125%">capacityBar <span style="color: #666666">=</span> <span \
style="color: #008000; font-weight: bold">new</span> KCapacityBar(widget_3); \
</pre></div> </p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">which fails to compile because there is no explicit \
conversion from <code style="text-rendering: inherit;color: #4444cc;padding: \
0;white-space: normal;margin: 0;line-height: inherit;">QWidget*</code> to <code \
style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: \
0;line-height: inherit;">KCapacityBar::DrawTextMode</code>:</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div \
class="codehilite" style="background: #f8f8f8"><pre style="line-height: \
125%">error<span style="color: #666666">:</span> no matching constructor <span \
style="color: #008000; font-weight: bold">for</span> initialization of <span \
style="color: #BA2121">'KCapacityBar'</span> capacityBar <span style="color: \
#666666">=</span> <span style="color: #008000; font-weight: bold">new</span> <span \
style="color: #B00040">KCapacityBar</span><span style="color: \
#666666">(</span>widget_3<span style="color: #666666">);</span>
<span style="color: #666666">^</span> <span \
style="color: #666666">~~~~~~~~</span> <span style="color: \
#BB6688">/usr/include/KF5/KWidgetsAddons/</span>kcapacitybar<span style="color: \
#666666">.</span><span style="color: #7D9029">h</span><span style="color: \
#666666">:44:29:</span> note<span style="color: #666666">:</span> candidate \
constructor <span style="color: #666666">(</span>the implicit copy constructor<span \
style="color: #666666">)</span> not viable<span style="color: #666666">:</span> no \
known conversion from <span style="color: #BA2121">'QWidget *'</span> to \
<span style="color: #BA2121">'const KCapacityBar'</span> <span style="color: \
#008000; font-weight: bold">for</span> <span style="color: #666666">1</span>st \
argument <span style="color: #008000; font-weight: bold">class</span> \
KWIDGETSADDONS_EXPORT KCapacityBar <span style="color: #666666">^</span>
<span style="color: #BB6688">/usr/include/KF5/KWidgetsAddons/</span>kcapacitybar<span \
style="color: #666666">.</span><span style="color: #7D9029">h</span><span \
style="color: #666666">:72:14:</span> note<span style="color: #666666">:</span> \
candidate constructor not viable<span style="color: #666666">:</span> no known \
conversion from <span style="color: #BA2121">'QWidget *'</span> to <span \
style="color: #BA2121">'KCapacityBar::DrawTextMode'</span> <span \
style="color: #008000; font-weight: bold">for</span> <span style="color: \
#666666">1</span>st argument explicit KCapacityBar<span style="color: \
#666666">(</span>DrawTextMode drawTextMode <span style="color: #666666">=</span> \
DrawTextOutline<span style="color: #666666">,</span> QWidget <span style="color: \
#666666">*</span>parent <span style="color: #666666">=</span> <span style="color: \
#666666">0);</span> </pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">This patch simply adds another constructor with a \
single argument (the pointer to the parent).</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">KCapacityBar can now be used in a Qt Designer custom \
widget.</p></pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/kcapacitybar.h <span style="color: \
grey">(1a1f2e60f415904d6cf603a4b4e0cae1c543169a)</span></li>
<li>src/kcapacitybar.cpp <span style="color: \
grey">(ecd2c13feb88f5c9e92086639bff48c6d0527779)</span></li>
<li>src/kmultitabbar.h <span style="color: \
grey">(068f0980827e6806d7cb2a17e8b261f7e1620204)</span></li>
<li>src/kmultitabbar.cpp <span style="color: \
grey">(bc58b81cbe4d98043762a36a43b4777ada30734f)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/128191/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============3458350923096117176==--
[Attachment #3 (text/plain)]
_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic