diff --git a/src/plugins/texteditor/tooltip/tipfactory.cpp b/src/plugins/texteditor/tooltip/tipfactory.cpp index ceeebe46cfb..435abbe6a91 100644 --- a/src/plugins/texteditor/tooltip/tipfactory.cpp +++ b/src/plugins/texteditor/tooltip/tipfactory.cpp @@ -40,7 +40,7 @@ TipFactory::TipFactory() TipFactory::~TipFactory() {} -QTipLabel *TipFactory::createTip(const TipContent &content, QWidget *w) +Internal::QTipLabel *TipFactory::createTip(const TipContent &content, QWidget *w) { QTipLabel *tip = 0; if (content.typeId() == TextContent::TEXT_CONTENT_ID) diff --git a/src/plugins/texteditor/tooltip/tipfactory.h b/src/plugins/texteditor/tooltip/tipfactory.h index 09710873a1e..ccd1d5d45a6 100644 --- a/src/plugins/texteditor/tooltip/tipfactory.h +++ b/src/plugins/texteditor/tooltip/tipfactory.h @@ -32,15 +32,12 @@ #include -QT_BEGIN_NAMESPACE -class QTipLabel; -QT_END_NAMESPACE - namespace TextEditor { class TipContent; namespace Internal { +class QTipLabel; class TipFactory { diff --git a/src/plugins/texteditor/tooltip/tips.cpp b/src/plugins/texteditor/tooltip/tips.cpp index 606d622590b..3492e5a2022 100644 --- a/src/plugins/texteditor/tooltip/tips.cpp +++ b/src/plugins/texteditor/tooltip/tips.cpp @@ -41,8 +41,8 @@ #include #include -using namespace TextEditor; -using namespace Internal; +namespace TextEditor { + namespace Internal { namespace { // @todo: Reuse... @@ -59,8 +59,6 @@ namespace { } } -QT_BEGIN_NAMESPACE - QTipLabel::QTipLabel(QWidget *parent) : QLabel(parent, Qt::ToolTip | Qt::BypassGraphicsProxyWidget), m_tipContent(0) @@ -83,8 +81,6 @@ void QTipLabel::setContent(const TipContent &content) const TipContent &QTipLabel::content() const { return *m_tipContent; } -QT_END_NAMESPACE - ColorTip::ColorTip(QWidget *parent) : QTipLabel(parent) { resize(QSize(40, 40)); @@ -183,3 +179,9 @@ void TextTip::resizeEvent(QResizeEvent *event) QLabel::resizeEvent(event); } + +// need to include it here to force it to be inside the namespaces +#include "moc_tips.cpp" + +} // namespace Internal +} // namespace TextEditor diff --git a/src/plugins/texteditor/tooltip/tips.h b/src/plugins/texteditor/tooltip/tips.h index 38f73bc5cac..806124be306 100644 --- a/src/plugins/texteditor/tooltip/tips.h +++ b/src/plugins/texteditor/tooltip/tips.h @@ -38,7 +38,10 @@ namespace TextEditor { class TipContent; } -QT_BEGIN_NAMESPACE +#ifndef Q_MOC_RUN +namespace TextEditor { +namespace Internal { +#endif // Please do not change the name of this class. Detailed comments in tooltip.h. class QTipLabel : public QLabel @@ -60,11 +63,6 @@ private: TextEditor::TipContent *m_tipContent; }; -QT_END_NAMESPACE - -namespace TextEditor { -namespace Internal { - class ColorTip : public QTipLabel { Q_OBJECT @@ -96,7 +94,9 @@ private: virtual void resizeEvent(QResizeEvent *event); }; +#ifndef Q_MOC_RUN } // namespace Internal } // namespace TextEditor +#endif #endif // TIPS_H diff --git a/src/plugins/texteditor/tooltip/tooltip.h b/src/plugins/texteditor/tooltip/tooltip.h index def3bc7fc55..512ba610cf1 100644 --- a/src/plugins/texteditor/tooltip/tooltip.h +++ b/src/plugins/texteditor/tooltip/tooltip.h @@ -49,13 +49,13 @@ QT_BEGIN_NAMESPACE class QPoint; class QWidget; -class QTipLabel; QT_END_NAMESPACE namespace TextEditor { namespace Internal { class TipFactory; +class QTipLabel; } class TipContent; @@ -93,7 +93,7 @@ private: void hideTipWithDelay(); Internal::TipFactory *m_tipFactory; - QTipLabel *m_tip; + Internal::QTipLabel *m_tip; QWidget *m_widget; QRect m_rect; QTimer m_showTimer;