fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / kdeui / util / kwhatsthismanager_p.h
blob689dfa54abef84ca2de92e624e1a0a8d608d3949
1 /* This file is part of the KDE Libraries
2 * Copyright (C) 2004 Peter Rockai (mornfall) <mornfall@danill.sk>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
19 #ifndef KWHATSTHISMANAGER_P_H
20 #define KWHATSTHISMANAGER_P_H
22 #include <kdeui_export.h>
23 #include <QEvent>
24 #include <QWidget>
26 /**
27 * This class is used automatically by KMainWindow and KDialog to attach a
28 * What's This templates to all new widgets. If you don't use either of those
29 * classes and want this functionality, call KWhatsThisManager::init () before
30 * creating any widgets.
32 * It works by watching for child creation events and if the new objects are
33 * widgets, it attachs the whatsthis template to them (unless there already is
34 * What's This defined). This template will be overridden by any custom What's
35 * This info.
37 * @see QWhatsThis
38 * @author Peter Rockai (mornfall) <mornfall@danill.sk>
39 **/
40 class KDEUI_EXPORT KWhatsThisManager : public QObject
42 Q_OBJECT
44 public:
45 static void init();
46 bool eventFilter( QObject *object, QEvent *event );
48 protected:
49 static KWhatsThisManager *s_instance;
51 private:
52 QString text() const;
53 void clicked( const QString&, QWidget* );
55 KWhatsThisManager();
58 #endif