HistoryCompleter: Accept parent

Change-Id: Ifbbd2b7af06eec620a765614792547fff6303f06
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Orgad Shaneh
2012-08-27 15:49:08 +03:00
committed by hjk
parent 09d173b188
commit 81b431cdca
3 changed files with 5 additions and 4 deletions

View File

@@ -305,7 +305,7 @@ bool FancyLineEdit::hasAutoHideButton(Side side) const
void FancyLineEdit::setHistoryCompleter(const QString &historyKey) void FancyLineEdit::setHistoryCompleter(const QString &historyKey)
{ {
QTC_ASSERT(!d->m_historyCompleter, return); QTC_ASSERT(!d->m_historyCompleter, return);
d->m_historyCompleter = new HistoryCompleter(this, historyKey); d->m_historyCompleter = new HistoryCompleter(this, historyKey, this);
QLineEdit::setCompleter(d->m_historyCompleter); QLineEdit::setCompleter(d->m_historyCompleter);
} }

View File

@@ -156,8 +156,9 @@ void HistoryCompleterPrivate::saveEntry(const QString &str)
theSettings->setValue(historyKey, list); theSettings->setValue(historyKey, list);
} }
HistoryCompleter::HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey) HistoryCompleter::HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey, QObject *parent)
: d(new HistoryCompleterPrivate) : QCompleter(parent),
d(new HistoryCompleterPrivate)
{ {
QTC_ASSERT(lineEdit, return); QTC_ASSERT(lineEdit, return);
QTC_ASSERT(!historyKey.isEmpty(), return); QTC_ASSERT(!historyKey.isEmpty(), return);

View File

@@ -49,7 +49,7 @@ class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter
public: public:
static void setSettings(QSettings *settings); static void setSettings(QSettings *settings);
HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey); HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey, QObject *parent = 0);
private: private:
~HistoryCompleter(); ~HistoryCompleter();