summaryrefslogtreecommitdiff
path: root/src/searchbar.cpp
diff options
context:
space:
mode:
authoradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-14 10:28:37 +0000
committeradjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-05-14 10:28:37 +0000
commitad61438a123423ce83aeecf42607244c4c1ca1a3 (patch)
tree88084ae3d4ab5e7d12d689c92a9adf9f151cec4b /src/searchbar.cpp
parentstrings fix (diff)
parentupdated TODO (diff)
downloadrekonq-ad61438a123423ce83aeecf42607244c4c1ca1a3.tar.xz
Merge branch 'master' into local-svn
git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@967887 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/searchbar.cpp')
-rw-r--r--src/searchbar.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/searchbar.cpp b/src/searchbar.cpp
index 9f6b306d..48e9290a 100644
--- a/src/searchbar.cpp
+++ b/src/searchbar.cpp
@@ -28,6 +28,7 @@
// KDE Includes
#include <KUrl>
+#include <KCompletionBox>
// Qt Includes
#include <QtCore/QString>
@@ -38,19 +39,16 @@
#include <QtXml/QXmlStreamReader>
-SearchBar::SearchBar(QWidget *parent) :
- KLineEdit(parent)
- , m_networkAccessManager(new QNetworkAccessManager(this))
- , m_timer(new QTimer(this))
+SearchBar::SearchBar(QWidget *parent)
+ : LineEdit(parent)
+ , m_networkAccessManager(new QNetworkAccessManager(this))
+ , m_timer(new QTimer(this))
{
- setMinimumWidth(180);
-
setFocusPolicy(Qt::WheelFocus);
setMouseTracking(true);
setAcceptDrops(true);
- QSizePolicy policy = sizePolicy();
- setSizePolicy(QSizePolicy::Preferred, policy.verticalPolicy());
+ setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
setClearButtonShown(true);
@@ -80,6 +78,7 @@ void SearchBar::searchNow()
{
m_timer->stop();
QString searchText = text();
+ completionBox()->hide();
KUrl url(QLatin1String("http://www.google.com/search"));
url.addQueryItem(QLatin1String("q"), searchText);
@@ -92,8 +91,8 @@ void SearchBar::searchNow()
void SearchBar::focusInEvent(QFocusEvent *event)
{
- KLineEdit::focusInEvent(event);
- clear();
+ selectAll();
+ LineEdit::focusInEvent(event);
}