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/qnx | |
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/qnx')
-rw-r--r-- | src/plugins/qnx/blackberrykeyspage.cpp | 6 | ||||
-rw-r--r-- | src/plugins/qnx/blackberrykeyspage.h | 6 | ||||
-rw-r--r-- | src/plugins/qnx/blackberryndksettingspage.cpp | 6 | ||||
-rw-r--r-- | src/plugins/qnx/blackberryndksettingspage.h | 6 |
4 files changed, 16 insertions, 8 deletions
diff --git a/src/plugins/qnx/blackberrykeyspage.cpp b/src/plugins/qnx/blackberrykeyspage.cpp index 39493bf5a0..37d5f7c2d0 100644 --- a/src/plugins/qnx/blackberrykeyspage.cpp +++ b/src/plugins/qnx/blackberrykeyspage.cpp @@ -51,9 +51,10 @@ BlackBerryKeysPage::BlackBerryKeysPage(QObject *parent) : Constants::QNX_BB_CATEGORY_TR)); } -QWidget *BlackBerryKeysPage::createPage(QWidget *parent) +QWidget *BlackBerryKeysPage::widget() { - m_widget = new BlackBerryKeysWidget(parent); + if (!m_widget) + m_widget = new BlackBerryKeysWidget; return m_widget; } @@ -63,6 +64,7 @@ void BlackBerryKeysPage::apply() void BlackBerryKeysPage::finish() { + delete m_widget; } } // namespace Internal diff --git a/src/plugins/qnx/blackberrykeyspage.h b/src/plugins/qnx/blackberrykeyspage.h index 27e4423305..945ed46f9a 100644 --- a/src/plugins/qnx/blackberrykeyspage.h +++ b/src/plugins/qnx/blackberrykeyspage.h @@ -34,6 +34,8 @@ #include <coreplugin/dialogs/ioptionspage.h> +#include <QPointer> + namespace Qnx { namespace Internal { @@ -44,12 +46,12 @@ class BlackBerryKeysPage : public Core::IOptionsPage Q_OBJECT public: explicit BlackBerryKeysPage(QObject *parent = 0); - QWidget *createPage(QWidget *parent); + QWidget *widget(); void apply(); void finish(); private: - BlackBerryKeysWidget *m_widget; + QPointer<BlackBerryKeysWidget> m_widget; }; } // namespace Internal diff --git a/src/plugins/qnx/blackberryndksettingspage.cpp b/src/plugins/qnx/blackberryndksettingspage.cpp index 5a98414d72..d43758f669 100644 --- a/src/plugins/qnx/blackberryndksettingspage.cpp +++ b/src/plugins/qnx/blackberryndksettingspage.cpp @@ -52,9 +52,10 @@ BlackBerryNDKSettingsPage::BlackBerryNDKSettingsPage(QObject *parent) : setCategoryIcon(QLatin1String(Constants::QNX_BB_CATEGORY_ICON)); } -QWidget *BlackBerryNDKSettingsPage::createPage(QWidget *parent) +QWidget *BlackBerryNDKSettingsPage::widget() { - m_widget = new BlackBerryNDKSettingsWidget(parent); + if (!m_widget) + m_widget = new BlackBerryNDKSettingsWidget; return m_widget; } @@ -73,6 +74,7 @@ void BlackBerryNDKSettingsPage::apply() void BlackBerryNDKSettingsPage::finish() { + delete m_widget; } } // namespace Internal diff --git a/src/plugins/qnx/blackberryndksettingspage.h b/src/plugins/qnx/blackberryndksettingspage.h index 4e2de119e1..0f82480f5a 100644 --- a/src/plugins/qnx/blackberryndksettingspage.h +++ b/src/plugins/qnx/blackberryndksettingspage.h @@ -34,6 +34,8 @@ #include <coreplugin/dialogs/ioptionspage.h> +#include <QPointer> + namespace Qnx { namespace Internal { @@ -44,12 +46,12 @@ class BlackBerryNDKSettingsPage : public Core::IOptionsPage Q_OBJECT public: explicit BlackBerryNDKSettingsPage(QObject *parent = 0); - QWidget *createPage(QWidget *parent); + QWidget *widget(); void apply(); void finish(); private: - BlackBerryNDKSettingsWidget *m_widget; + QPointer<BlackBerryNDKSettingsWidget> m_widget; }; } // namespace Internal |