commontk/CTK — comment on commit 4314c15836b87f2946665bda7e442ecd4593cb16
File: Libs/Widgets/ctkToolTipTrapper.h line 67
By jcfr:

When I initially design the class, I considered the word "trap" having
meaning similar to "hide".
Looking at the first commit, it mentions "used to prevent tooltips from
appearing"

Considering this last statement, I am not sure that mixing the idea of
enabling wrapping (richtext) and hiding tooltips is valid.

Thinking more about, it seems what motivated the integration of the "text
wrap" functionality with the "trapping" one is the fact the underlying
implementation deals with event filter. If the "eventfilter" capabilities
are in common, we should factor it out and still create a "wrapping" and a
"trapping" class.

To push further the analysis, the concept of "RichText" should be used
instead of "Wrap".

To conclude, what about having two classes: "ctkToolTipRichTextDecorator"
and "ctkToolTipTrapper" :)

Thanks
Jc

On Thu, Mar 8, 2012 at 10:15 AM, Julien Finet <
reply@reply.github.com
> wrote:

> The more I think about it, the more I think toolTipsWordWrapped is
> dangerous and not scalable. It has a side effect of "trapping" the tooltips.
> and the following is odd:
> setToolTipsWrapped(true)
> // here tooltips are trapped (installEventFilter), but toolTipsTrapped()
> return false
> setToolTipsWrapped(true) should internally call setToolTipsTrapped(true)
> then.
> Code is duplicated, the installEventFitler and removeEventFitler are in 2
> locations.
> but the following would be counter intuitive:
> setToolTipsTrapped(false)
> setToolTipsWrapped(true)
> -> now toolTipsTrapped() returns true, having the order of calls
> Trapped/Wrapped being important is a risk.
>
> Also what happens when we'll add more features to the tooltiptrapper ?
> each option would have to install the event filter ? does not seem scalable.
> So I would prevent toolTipsWordWrapped from installing the event filter,
> and let that work to toolTipsTrapped.
>
> Jc, I wouldn't split the class in 2 . I believe the "wrap" feature is
> generic enough to be part of the "base" tooltip class.
>
> Danielle, if you don't have time to work on the cleanup I can do it, let
> me know.
>
> ---
> Reply to this email directly or view it on GitHub:
>
> https://github.com/commontk/CTK/commit/4314c15836b87f2946665bda7e442ecd4593cb16#commitcomment-1058722
>

--
+1 919 869 8849