Review Request 128191: Let KCapacityBar be usable in Qt Designer

Elvis Angelaccio elvis.angelaccio at kdemail.net
Thu Jun 16 17:02:12 UTC 2016



> On June 16, 2016, 4:52 p.m., David Faure wrote:
> > src/kcapacitybar.h, line 80
> > <https://git.reviewboard.kde.org/r/128191/diff/2/?file=468842#file468842line80>
> >
> >     I didn't see the default value here. This makes new KCapacityBar() ambiguous indeed.
> >     
> >     The default value for drawTextMode should be removed. This is BC and SC since you added the other ctor.

Fixed in commit 3c0041cd49


- Elvis


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128191/#review96603
-----------------------------------------------------------


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
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20160616/2199e1f6/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list