Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-25 Thread Elvis Angelaccio

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

(Updated June 25, 2016, 9:10 a.m.)


Status
--

This change has been marked as submitted.


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

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-16 Thread Elvis Angelaccio


> On June 16, 2016, 4:52 p.m., David Faure wrote:
> > src/kcapacitybar.h, line 80
> > 
> >
> > 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
> 
>

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-16 Thread David Faure

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




src/kcapacitybar.h (line 80)


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.


- David Faure


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

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-16 Thread Christoph Cullmann


> 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?
> 
> Kåre Särs wrote:
> Removing the default argument from the new one with only one argument 
> could maybe solve the problem for all cases.

No, you have now the problem, what to call for:

KCapacityBar()

I think just removing the default value for the new constructor with only the 
QWidget * will solve the issue and perhaps design can still use that, or?


- Christoph


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

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-16 Thread Kåre Särs


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

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-16 Thread Elvis Angelaccio


> 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 '()'

Could this be a bug in MSVC?


- Elvis


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

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-16 Thread Kåre Särs

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



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 '()'

- Kåre Särs


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

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-16 Thread Elvis Angelaccio

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


Status
--

This change has been marked as submitted.


Review request for KDE Frameworks and Christoph Feck.


Changes
---

Submitted with commit dd28889f34dc174e66a887722786dbe9c4f6834b by Elvis 
Angelaccio to branch master.


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

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-16 Thread David Faure

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


Ship it!




Ship It!

- David Faure


On June 15, 2016, 5:44 p.m., Elvis Angelaccio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128191/
> ---
> 
> (Updated June 15, 2016, 5:44 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
> 
>

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-15 Thread Elvis Angelaccio

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

(Updated June 15, 2016, 5:44 p.m.)


Review request for KDE Frameworks and Christoph Feck.


Changes
---

Fix also KMultiTabBar.


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 (updated)
-

  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

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-15 Thread Elvis Angelaccio


> On June 15, 2016, 11:59 a.m., Christoph Feck wrote:
> > Does it also need updates to KF5::DesignerPlugin?
> 
> Elvis Angelaccio wrote:
> Hmm, I didn't even know about this plugin when I did my test. In 
> `kde.widgets` I see:
> 
> ```ini
> # KWidgetsAddons
> [KCapacityBar]
> IncludeFile=kcapacitybar.h
> ToolTip=Capacity Bar (KDE)
> ConstructorArgs=(KCapacityBar::DrawTextOutline, parent)
> Group=Display (KDE)
> ```
> 
> and now I'm wondering why Qt Designer ignores the first argument when it 
> generates the constructor call...

I investigated a bit more and the `uic` tool always creates custom widgets 
using [a single-argument 
constructor](https://code.woboq.org/qt5/qtbase/src/tools/uic/cpp/cppwriteinitialization.cpp.html#626)
 (with the widget's parent):

```cpp
m_output << m_indent << varName << " = new " << 
m_uic->customWidgetsInfo()->realClassName(className) << '(' << parentWidget << 
");\n";
```

In fact, there are multiple widgets affected by this problem (for example 
KMultiTabBar)...


- Elvis


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


On June 15, 2016, 10:19 a.m., Elvis Angelaccio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128191/
> ---
> 
> (Updated June 15, 2016, 10:19 a.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 
> 
> Diff: https://git.reviewboard.kde.org/r/128191/diff/
> 
> 
> Testing
> ---
> 
> KCapacityBar can now be used in a Qt Designer custom widget.
> 
> 
> Thanks,
> 
> Elvis Angelaccio
> 
>

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-15 Thread Elvis Angelaccio


> On June 15, 2016, 11:59 a.m., Christoph Feck wrote:
> > Does it also need updates to KF5::DesignerPlugin?

Hmm, I didn't even know about this plugin when I did my test. In `kde.widgets` 
I see:

```ini
# KWidgetsAddons
[KCapacityBar]
IncludeFile=kcapacitybar.h
ToolTip=Capacity Bar (KDE)
ConstructorArgs=(KCapacityBar::DrawTextOutline, parent)
Group=Display (KDE)
```

and now I'm wondering why Qt Designer ignores the first argument when it 
generates the constructor call...


- Elvis


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


On June 15, 2016, 10:19 a.m., Elvis Angelaccio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128191/
> ---
> 
> (Updated June 15, 2016, 10:19 a.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 
> 
> Diff: https://git.reviewboard.kde.org/r/128191/diff/
> 
> 
> Testing
> ---
> 
> KCapacityBar can now be used in a Qt Designer custom widget.
> 
> 
> Thanks,
> 
> Elvis Angelaccio
> 
>

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 128191: Let KCapacityBar be usable in Qt Designer

2016-06-15 Thread Christoph Feck

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



Does it also need updates to KF5::DesignerPlugin?


src/kcapacitybar.h (line 69)


@since 5.24


- Christoph Feck


On June 15, 2016, 10:19 a.m., Elvis Angelaccio wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128191/
> ---
> 
> (Updated June 15, 2016, 10:19 a.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 
> 
> Diff: https://git.reviewboard.kde.org/r/128191/diff/
> 
> 
> Testing
> ---
> 
> KCapacityBar can now be used in a Qt Designer custom widget.
> 
> 
> Thanks,
> 
> Elvis Angelaccio
> 
>

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel