Fix crash when filtering in the preferences.

Need to ensure creation of all tabs before even the proxy model is
informed.

Task-number: QTCREATORBUG-4272
Reviewed-by: Robert Loehning
This commit is contained in:
con
2011-03-29 17:54:15 +02:00
parent 530e7494dd
commit ebed1ef306
2 changed files with 3 additions and 1 deletions

View File

@@ -318,6 +318,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
// The order of the slot connection matters here, the filter slot // The order of the slot connection matters here, the filter slot
// opens the matching page after the model has filtered. // opens the matching page after the model has filtered.
connect(m_filterLineEdit, SIGNAL(filterChanged(QString)),
this, SLOT(ensureAllCategoryWidgets()));
connect(m_filterLineEdit, SIGNAL(filterChanged(QString)), connect(m_filterLineEdit, SIGNAL(filterChanged(QString)),
m_proxyModel, SLOT(setFilterFixedString(QString))); m_proxyModel, SLOT(setFilterFixedString(QString)));
connect(m_filterLineEdit, SIGNAL(filterChanged(QString)), this, SLOT(filter(QString))); connect(m_filterLineEdit, SIGNAL(filterChanged(QString)), this, SLOT(filter(QString)));

View File

@@ -88,6 +88,7 @@ private slots:
void currentChanged(const QModelIndex &current); void currentChanged(const QModelIndex &current);
void currentTabChanged(int); void currentTabChanged(int);
void filter(const QString &text); void filter(const QString &text);
void ensureAllCategoryWidgets();
private: private:
SettingsDialog(QWidget *parent); SettingsDialog(QWidget *parent);
@@ -98,7 +99,6 @@ private:
void showPage(const QString &categoryId, const QString &pageId); void showPage(const QString &categoryId, const QString &pageId);
void updateEnabledTabs(Category *category, const QString &searchText); void updateEnabledTabs(Category *category, const QString &searchText);
void ensureCategoryWidget(Category *category); void ensureCategoryWidget(Category *category);
void ensureAllCategoryWidgets();
void disconnectTabWidgets(); void disconnectTabWidgets();
const QList<Core::IOptionsPage*> m_pages; const QList<Core::IOptionsPage*> m_pages;