diff options
author | Eike Ziller <eike.ziller@digia.com> | 2013-12-03 14:17:03 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2013-12-10 13:31:48 +0100 |
commit | deb43b4c8a261855252aeee09fd6df283576932e (patch) | |
tree | a844379f47974fd681b86aa2187735e03639b567 /src/plugins/qmljseditor/quicktoolbarsettingspage.cpp | |
parent | ea1a92484ac99057b06130a012164bf9788650e9 (diff) | |
download | qt-creator-deb43b4c8a261855252aeee09fd6df283576932e.tar.gz |
Preferences: Add default implementation for filtering
The default "matches" method now takes the widget and looks for all
child labels, checkboxes, push buttons and group boxes.
Because of that, the former "createWidget" method
can be called multiple times without creating a new widget
(-->widget()), and the "finished" method must ensure that the created
widget gets deleted, since not all widgets that were created are added
to the UI anymore.
Change-Id: Ia231c7c78dd8819146668e6447d36d22e7836904
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/plugins/qmljseditor/quicktoolbarsettingspage.cpp')
-rw-r--r-- | src/plugins/qmljseditor/quicktoolbarsettingspage.cpp | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/plugins/qmljseditor/quicktoolbarsettingspage.cpp b/src/plugins/qmljseditor/quicktoolbarsettingspage.cpp index 59d0b858ea..c79be8a96f 100644 --- a/src/plugins/qmljseditor/quicktoolbarsettingspage.cpp +++ b/src/plugins/qmljseditor/quicktoolbarsettingspage.cpp @@ -101,16 +101,6 @@ void QuickToolBarSettingsPageWidget::setSettings(const QuickToolBarSettings &s) m_ui.textEditHelperCheckBoxPin->setChecked(s.pinContextPane); } -QString QuickToolBarSettingsPageWidget::searchKeywords() const -{ - QString rc; - QTextStream(&rc) - << ' ' << m_ui.textEditHelperCheckBox->text() - << ' ' << m_ui.textEditHelperCheckBoxPin->text(); - rc.remove(QLatin1Char('&')); - return rc; -} - QuickToolBarSettings QuickToolBarSettings::get() { QuickToolBarSettings settings; @@ -129,12 +119,12 @@ QuickToolBarSettingsPage::QuickToolBarSettingsPage() : setCategoryIcon(QLatin1String(QmlDesigner::Constants::SETTINGS_CATEGORY_QML_ICON)); } -QWidget *QuickToolBarSettingsPage::createPage(QWidget *parent) +QWidget *QuickToolBarSettingsPage::widget() { - m_widget = new QuickToolBarSettingsPageWidget(parent); - m_widget->setSettings(QuickToolBarSettings::get()); - if (m_searchKeywords.isEmpty()) - m_searchKeywords = m_widget->searchKeywords(); + if (!m_widget) { + m_widget = new QuickToolBarSettingsPageWidget; + m_widget->setSettings(QuickToolBarSettings::get()); + } return m_widget; } @@ -145,7 +135,7 @@ void QuickToolBarSettingsPage::apply() m_widget->settings().set(); } -bool QuickToolBarSettingsPage::matches(const QString &s) const +void QuickToolBarSettingsPage::finish() { - return m_searchKeywords.contains(s, Qt::CaseInsensitive); + delete m_widget; } |