diff options
author | hjk <hjk121@nokiamail.com> | 2014-02-13 13:54:39 +0100 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-02-14 16:58:43 +0100 |
commit | a74de6af81b659ef0dcbbbe25f94d9b527c2be98 (patch) | |
tree | 79c7d50c5afb664ec392a016b1abee178d528d2d /src/shared/help | |
parent | 5fd7c0bceceae795125ae32429365b021cd05e4b (diff) | |
download | qt-creator-a74de6af81b659ef0dcbbbe25f94d9b527c2be98.tar.gz |
Utils: Merge FilterLineEdit into FancyLineEdit
Change-Id: Ic53836dade3985c36b0f6767e43b5af0ddb80d72
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/shared/help')
-rw-r--r-- | src/shared/help/bookmarkmanager.cpp | 5 | ||||
-rw-r--r-- | src/shared/help/bookmarkmanager.h | 6 | ||||
-rw-r--r-- | src/shared/help/indexwindow.cpp | 10 | ||||
-rw-r--r-- | src/shared/help/indexwindow.h | 12 | ||||
-rw-r--r-- | src/shared/help/topicchooser.ui | 6 |
5 files changed, 21 insertions, 18 deletions
diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp index ff1170ce5a..5089cf09bf 100644 --- a/src/shared/help/bookmarkmanager.cpp +++ b/src/shared/help/bookmarkmanager.cpp @@ -31,7 +31,7 @@ #include <localhelpmanager.h> -#include <utils/filterlineedit.h> +#include <utils/fancylineedit.h> #include <utils/styledbar.h> #include <QMenu> @@ -424,7 +424,8 @@ void BookmarkWidget::setup(bool showButtons) vlayout->setMargin(0); vlayout->setSpacing(0); - searchField = new Utils::FilterLineEdit(this); + searchField = new Utils::FancyLineEdit(this); + searchField->setFiltering(true); setFocusProxy(searchField); Utils::StyledBar *toolbar = new Utils::StyledBar(this); diff --git a/src/shared/help/bookmarkmanager.h b/src/shared/help/bookmarkmanager.h index f069a9d021..d2e5424940 100644 --- a/src/shared/help/bookmarkmanager.h +++ b/src/shared/help/bookmarkmanager.h @@ -45,7 +45,6 @@ #include <QStandardItemModel> QT_BEGIN_NAMESPACE - class QEvent; class QLineEdit; class QTreeView; @@ -53,9 +52,10 @@ class QToolButton; class QStandardItem; class QAbstractItemModel; class QSortFilterProxyModel; - QT_END_NAMESPACE +namespace Utils { class FancyLineEdit; } + class BookmarkManager; class BookmarkDialog : public QDialog @@ -133,7 +133,7 @@ private: private: QRegExp regExp; TreeView *treeView; - QLineEdit *searchField; + Utils::FancyLineEdit *searchField; QToolButton *addButton; QToolButton *removeButton; BookmarkManager *bookmarkManager; diff --git a/src/shared/help/indexwindow.cpp b/src/shared/help/indexwindow.cpp index 39ead89708..529bfb2e83 100644 --- a/src/shared/help/indexwindow.cpp +++ b/src/shared/help/indexwindow.cpp @@ -36,7 +36,7 @@ #include <localhelpmanager.h> #include <openpagesmanager.h> -#include <utils/filterlineedit.h> +#include <utils/fancylineedit.h> #include <utils/hostosinfo.h> #include <utils/styledbar.h> @@ -59,8 +59,9 @@ IndexWindow::IndexWindow() { QVBoxLayout *layout = new QVBoxLayout(this); - m_searchLineEdit = new Utils::FilterLineEdit(); + m_searchLineEdit = new Utils::FancyLineEdit(); m_searchLineEdit->setPlaceholderText(QString()); + m_searchLineEdit->setFiltering(true); setFocusProxy(m_searchLineEdit); connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterIndices(QString))); @@ -191,6 +192,11 @@ void IndexWindow::setSearchLineEditText(const QString &text) m_searchLineEdit->setText(text); } +QString IndexWindow::searchLineEditText() const +{ + return m_searchLineEdit->text(); +} + void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index) { QHelpIndexModel *model = qobject_cast<QHelpIndexModel*>(indexWidget->model()); diff --git a/src/shared/help/indexwindow.h b/src/shared/help/indexwindow.h index 3ca0686895..1e5f17d53b 100644 --- a/src/shared/help/indexwindow.h +++ b/src/shared/help/indexwindow.h @@ -32,15 +32,14 @@ #include <QUrl> #include <QWidget> -#include <QLineEdit> QT_BEGIN_NAMESPACE - class QHelpIndexWidget; class QModelIndex; - QT_END_NAMESPACE +namespace Utils { class FancyLineEdit; } + class IndexWindow : public QWidget { Q_OBJECT @@ -50,10 +49,7 @@ public: ~IndexWindow(); void setSearchLineEditText(const QString &text); - QString searchLineEditText() const - { - return m_searchLineEdit->text(); - } + QString searchLineEditText() const; signals: void linkActivated(const QUrl &link); @@ -69,7 +65,7 @@ private: bool eventFilter(QObject *obj, QEvent *e); void open(QHelpIndexWidget* indexWidget, const QModelIndex &index); - QLineEdit *m_searchLineEdit; + Utils::FancyLineEdit *m_searchLineEdit; QHelpIndexWidget *m_indexWidget; }; diff --git a/src/shared/help/topicchooser.ui b/src/shared/help/topicchooser.ui index 120cb2ee34..57ab39b394 100644 --- a/src/shared/help/topicchooser.ui +++ b/src/shared/help/topicchooser.ui @@ -28,7 +28,7 @@ </widget> </item> <item> - <widget class="Utils::FilterLineEdit" name="lineEdit"/> + <widget class="Utils::FancyLineEdit" name="lineEdit"/> </item> <item> <widget class="QListView" name="listWidget"/> @@ -86,9 +86,9 @@ </widget> <customwidgets> <customwidget> - <class>Utils::FilterLineEdit</class> + <class>Utils::FancyLineEdit</class> <extends>QLineEdit</extends> - <header location="global">utils/filterlineedit.h</header> + <header location="global">utils/fancylineedit.h</header> </customwidget> </customwidgets> <resources/> |