Review Request 129833: KToolTipWidget: hide immediately if content gets destroyed
Christoph Feck
cfeck at kde.org
Tue Jan 17 18:37:01 UTC 2017
> On Jan. 15, 2017, 3:32 a.m., Christoph Feck wrote:
> > From what I see, the content widget is not owned by the tool tip widget. What happens if I delete the tool tip widget first, then delete the content widget? Does deleting automatically break the connections to the now non-existing target?
>
> Elvis Angelaccio wrote:
> Good point. Actually I just realized that the tooltip does take ownership, so what happens is a double delete :/
> However, this is unrelated from this patch (it crashes even if I remove the new connect()).
>
> We could fix this with another patch or maybe we could just warn in the apidox to not delete the content after deleting the tooltip...
>
> Christoph Feck wrote:
> Hm, from looking at the API, you would not assume transferring of ownership. It is the adding to the layout that transfers?
>
> Anyone who already uses the class probably has noticed this, so I would suggest to keep the behavior and document it. Later we could add a call that allows to cancel the ownership. Maybe this might sense for widgets that need to be shown often, but are complex to reinitialize.
>
> Elvis Angelaccio wrote:
> Yes, it's because of the layout.
>
> What we could also do is storing the old parent (before adding to the layout) and restoring it later. lxr says no one is using this class yet, so we might be still in time...
lxr only scans KDE sources, so theoretically, someone else could already use the class. Practically, you are right, and I will accept either solution you propose.
- Christoph
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129833/#review102031
-----------------------------------------------------------
On Jan. 14, 2017, 7:54 p.m., Elvis Angelaccio wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/129833/
> -----------------------------------------------------------
>
> (Updated Jan. 14, 2017, 7:54 p.m.)
>
>
> Review request for KDE Frameworks and Christoph Feck.
>
>
> Repository: kwidgetsaddons
>
>
> Description
> -------
>
> Otherwise the tooltip will be visible but empty.
>
>
> Diffs
> -----
>
> autotests/ktooltipwidgettest.h 556d93edd7792736bb7b41761f2d8934395d2f3c
> autotests/ktooltipwidgettest.cpp 89124c6b3f16b76a346a8c9c74ff2f9efe0c9e83
> src/ktooltipwidget.cpp 979d4f71b5ebf9d0716e12453ecbfc88e48be72d
>
> Diff: https://git.reviewboard.kde.org/r/129833/diff/
>
>
> Testing
> -------
>
> The new test case reproduces this issue.
>
>
> Thanks,
>
> Elvis Angelaccio
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170117/d24c5b06/attachment-0001.html>
More information about the Kde-frameworks-devel
mailing list