Utils: Replace Tooltip hack with another tooltip hack

Instead of fooling moc into believing it operates on a class called
QTipLabel and create a "QTipLabel" class name from that, create a
metaobject with the "QTipLabel" class name directly.

This trades messing around with namespaces for assumptions on
the stability of QMetaObject class layout. Given that this is an
exported class in Qt Core, that's unlikely to break soon.

Change-Id: Iad24dd2a8a7f492e4b238d390888f89c6dd29ea9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2018-11-21 10:17:25 +01:00
parent b25ad292d3
commit aa07505f3a
3 changed files with 35 additions and 24 deletions

View File

@@ -50,7 +50,7 @@ class QWidget;
QT_END_NAMESPACE
namespace Utils {
namespace Internal { class QTipLabel; }
namespace Internal { class TipLabel; }
class QTCREATOR_UTILS_EXPORT ToolTip : public QObject
{
@@ -110,7 +110,7 @@ private:
void showTip();
void hideTipWithDelay();
QPointer<Internal::QTipLabel> m_tip;
QPointer<Internal::TipLabel> m_tip;
QWidget *m_widget;
QRect m_rect;
QTimer m_showTimer;