summaryrefslogtreecommitdiff
path: root/src/searchbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/searchbar.cpp')
-rw-r--r--src/searchbar.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/searchbar.cpp b/src/searchbar.cpp
index 134b5f33..a48803b3 100644
--- a/src/searchbar.cpp
+++ b/src/searchbar.cpp
@@ -23,6 +23,7 @@
// Qt Includes
#include <QVBoxLayout>
+#include <QPalette>
SearchBar::SearchBar(QWidget *parent) :
QWidget(parent),
@@ -31,6 +32,11 @@ SearchBar::SearchBar(QWidget *parent) :
m_lineEdit = new KLineEdit(this);
m_lineEdit->setClearButtonShown( true );
+ QPalette palette;
+ palette.setColor( QPalette::Text, Qt::gray );
+ m_lineEdit->setPalette( palette );
+ m_lineEdit->setText( "Search.." );
+
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(m_lineEdit);
setLayout(layout);
@@ -38,10 +44,12 @@ SearchBar::SearchBar(QWidget *parent) :
connect( lineEdit() , SIGNAL( returnPressed() ) , this , SLOT( searchNow() ) );
}
+
SearchBar::~SearchBar()
{
}
+
void SearchBar::searchNow()
{
QString searchText = m_lineEdit->text();
@@ -50,10 +58,11 @@ void SearchBar::searchNow()
url.addQueryItem(QLatin1String("q"), searchText);
url.addQueryItem(QLatin1String("ie"), QLatin1String("UTF-8"));
url.addQueryItem(QLatin1String("oe"), QLatin1String("UTF-8"));
- url.addQueryItem(QLatin1String("client"), QLatin1String("reKonq"));
+ url.addQueryItem(QLatin1String("client"), QLatin1String("rekonq"));
emit search(url);
}
+
KLineEdit *SearchBar::lineEdit()
{
return m_lineEdit;