aboutsummaryrefslogtreecommitdiff
path: root/src/qt/guiutil.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-05-10 23:54:53 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2012-05-10 23:54:53 -0700
commitb8a5e30d9136673163555615e17098c07b4c821f (patch)
treeffcb6685a887564859e1deae822af46f6b30c5d2 /src/qt/guiutil.h
parentf93727aa56d9c38fdaebe7caa227188772ba4ac5 (diff)
parent3793fa09ff920fc720dfad3738f105d2c9563662 (diff)
downloadbitcoin-b8a5e30d9136673163555615e17098c07b4c821f.tar.xz
Merge pull request #1090 from laanwj/2012_04_wraptooltips
Allow Qt to wrap long tooltips (fixes #1063)
Diffstat (limited to 'src/qt/guiutil.h')
-rw-r--r--src/qt/guiutil.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h
index ea1a4795c0..8e9aae1cb0 100644
--- a/src/qt/guiutil.h
+++ b/src/qt/guiutil.h
@@ -2,6 +2,7 @@
#define GUIUTIL_H
#include <QString>
+#include <QObject>
QT_BEGIN_NAMESPACE
class QFont;
@@ -69,6 +70,23 @@ namespace GUIUtil
// Determine whether a widget is hidden behind other windows
bool isObscured(QWidget *w);
+ /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text
+ representation if needed. This assures that Qt can word-wrap long tooltip messages.
+ Tooltips longer than the provided size threshold (in characters) are wrapped.
+ */
+ class ToolTipToRichTextFilter: public QObject
+ {
+ Q_OBJECT
+ public:
+ ToolTipToRichTextFilter(int size_threshold, QObject *parent);
+
+ protected:
+ bool eventFilter(QObject *obj, QEvent *evt);
+
+ private:
+ int size_threshold;
+ };
+
} // namespace GUIUtil
#endif // GUIUTIL_H