[Interest] suppressing tooltips of all widgets

william.crocker at analog.com william.crocker at analog.com
Thu Jan 12 01:13:15 CET 2017


On 01/11/2017 06:37 PM, Frank Rueter | OHUfx wrote:
> Thanks Giuseppe,
> I will check out both those options and report back.
>
> On 12/01/17 12:15 PM, Giuseppe D'Angelo wrote:
>> Il 12/01/2017 00:02, Frank Rueter | OHUfx ha scritto:
>>> Is there any way to intercept a any tool tip even from anywhere in the app?
>> Install a global event filter on QApplication, and filter out all
>> QEvent::ToolTip events? (Never tried myself, so take it with a grain of
>> salt.)
>>

Yes. That is how I have been doing it for years.

class GlobalEventFilter : public QObject {
     Q_OBJECT
     typedef QObject BaseClass;
   public:
     GlobalEventFilter( QObject *parent ) : BaseClass(parent) { }
   protected:
     bool eventFilter(QObject*,QEvent*);
};

bool
GlobalEventFilter::eventFilter( QObject *op, QEvent *ep ) {
     if( ep->type() == QEvent::ToolTip && !CommandLineArg::s_DoToolTips )
         return true;    // Filter out.
     return BaseClass::eventFilter(op,ep);
}

...
GlobalEventFilter *mp = new GlobalEventFilter(s_QtApp);
my_qt_app->installEventFilter(mp);
...

Bill

>> Another option: install a QProxyStyle and return a wait period for
>> showing tooltips ridiculously high (INT_MAX).
>>
>> HTH,
>>
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



More information about the Interest mailing list