forked from qt-creator/qt-creator
Remove one hack of the QTipLabel hack.
This code used two hacks: it created a class with metaObject()->className() == "QTipLabel" to fool the code in Qt into applying the style properly to this class. But it did that by creating a class called QTipLabel. This works as long as the class in Qt is hidden by symbol visibility. When symbol visibility is disabled (for whatever reason), then Creator simply crashes due to size mismatches and memory corruptions (virtual tables, etc.) This patch makes the class be called TextEditor::Internal::QTipLabel, but fools moc into thinking it isn't. A proper solution would be to simply override the meta object. Signed-off-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
committed by
Leandro Melo
parent
67d0ab3fac
commit
7e48b8e5be
@@ -41,8 +41,8 @@
|
||||
#include <QtGui/QStylePainter>
|
||||
#include <QtGui/QStyleOptionFrame>
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user