From 99af2f9ccad09726b25c8223d9723cae8ff54698 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Wed, 17 Feb 2010 15:18:36 +0100
Subject: [PATCH] Fixed the border of the completion widget

Broke in f14c50dabc28962548f1debfb28a62ed125ccb73
---
 src/plugins/texteditor/completionwidget.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/plugins/texteditor/completionwidget.cpp b/src/plugins/texteditor/completionwidget.cpp
index 891563881bc..8a22d41b462 100644
--- a/src/plugins/texteditor/completionwidget.cpp
+++ b/src/plugins/texteditor/completionwidget.cpp
@@ -107,13 +107,15 @@ QVariant AutoCompletionModel::data(const QModelIndex &index, int role) const
 CompletionWidget::CompletionWidget(CompletionSupport *support, ITextEditable *editor)
     : QFrame(0, Qt::Popup),
       m_support(support),
-      m_editor(editor)
+      m_editor(editor),
+      m_completionListView(new CompletionListView(support, editor, this))
 {
     // We disable the frame on this list view and use a QFrame around it instead.
     // This improves the look with QGTKStyle.
 #ifndef Q_WS_MAC
-    setFrameStyle(frameStyle());
+    setFrameStyle(m_completionListView->frameStyle());
 #endif
+    m_completionListView->setFrameStyle(QFrame::NoFrame);
 
     setObjectName(QLatin1String("m_popupFrame"));
     setAttribute(Qt::WA_DeleteOnClose);
@@ -122,7 +124,6 @@ CompletionWidget::CompletionWidget(CompletionSupport *support, ITextEditable *ed
     QVBoxLayout *layout = new QVBoxLayout(this);
     layout->setMargin(0);
 
-    m_completionListView = new CompletionListView(support, editor, this);
     layout->addWidget(m_completionListView);
     setFocusProxy(m_completionListView);
 
@@ -132,7 +133,6 @@ CompletionWidget::CompletionWidget(CompletionSupport *support, ITextEditable *ed
             this, SIGNAL(completionListClosed()));
     connect(m_completionListView, SIGNAL(activated(QModelIndex)),
             SLOT(closeList(QModelIndex)));
-
 }
 
 CompletionWidget::~CompletionWidget()
@@ -224,7 +224,6 @@ CompletionListView::CompletionListView(CompletionSupport *support, ITextEditable
     setUniformItemSizes(true);
     setSelectionBehavior(QAbstractItemView::SelectItems);
     setSelectionMode(QAbstractItemView::SingleSelection);
-    setFrameStyle(QFrame::NoFrame);
     setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     setMinimumSize(1, 1);
     setModel(m_model);
-- 
GitLab