diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp
index c61dbbbe3e13e08d907af3ebd135523fe0376b89..2bd86a6888877a67b0a77fd4c82985c4cf1b4d9c 100644
--- a/src/plugins/coreplugin/manhattanstyle.cpp
+++ b/src/plugins/coreplugin/manhattanstyle.cpp
@@ -871,10 +871,11 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
             painter->setPen(StyleHelper::borderColor());
 
             if (horizontal) {
-                // Note: This is a hack to determine if we are the topmost
-                // toolbar and menu bar should draw the outline
+                // Note: This is a hack to determine if the
+                // toolbar should draw the top or bottom outline
+                // (needed for the find toolbar for instance)
                 QColor lighter(255, 255, 255, 40);
-                if (widget->mapToParent(rect.topLeft()).y()) {
+                if (widget && widget->property("topBorder").toBool()) {
                     p->drawLine(rect.topLeft(), rect.topRight());
                     p->setPen(lighter);
                     p->drawLine(rect.topLeft() + QPoint(0, 1), rect.topRight() + QPoint(0, 1));
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 82c48f37fb4d57d4eea92e869af0ad5fd851472a..b8bffaa14eba8f3de58ca7fb4bb7a6dd3f52287a 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -620,6 +620,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
     m_debugMode->setWidget(splitter2);
 
     QToolBar *debugToolBar = new QToolBar;
+    debugToolBar->setProperty("topBorder", true);
     debugToolBar->addAction(am->command(ProjectExplorer::Constants::DEBUG)->action());
     debugToolBar->addAction(am->command(Constants::INTERRUPT)->action());
     debugToolBar->addAction(am->command(Constants::NEXT)->action());
diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp
index 7d8072b7ac3650487ea2828a877ecf154fde1aa9..e4bb642a48cc3a25f47322d40df050f7fdddd4e6 100644
--- a/src/plugins/find/findtoolbar.cpp
+++ b/src/plugins/find/findtoolbar.cpp
@@ -78,6 +78,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
     m_ui.setupUi(m_widget);
     addWidget(m_widget);
     setFocusProxy(m_ui.findEdit);
+    setProperty("topBorder", true);
 
     connect(m_ui.findEdit, SIGNAL(editingFinished()), this, SLOT(invokeResetIncrementalSearch()));
 
@@ -225,16 +226,6 @@ FindToolBar::~FindToolBar()
 {
 }
 
-void FindToolBar::paintEvent(QPaintEvent *event)
-{
-    QToolBar::paintEvent(event);
-
-    QPainter p(this);
-    const QRect r = rect();
-    p.setPen(StyleHelper::borderColor());
-    p.drawLine(r.topLeft(), r.topRight());
-}
-
 bool FindToolBar::eventFilter(QObject *obj, QEvent *event)
 {
     if ((obj == m_ui.findEdit || obj == m_findCompleter->popup())
diff --git a/src/plugins/find/findtoolbar.h b/src/plugins/find/findtoolbar.h
index ce3dfdd74490cfdd7da7c2ddfac66c10da54b961..030a57876a38adde52cad9308cb804fb634141af 100644
--- a/src/plugins/find/findtoolbar.h
+++ b/src/plugins/find/findtoolbar.h
@@ -58,8 +58,6 @@ public:
 
     void invokeClearResults();
 
-    void paintEvent(QPaintEvent *event);
-
 private slots:
     void invokeFindNext();
     void invokeFindPrevious();