forked from qt-creator/qt-creator
HistoryCompleter: Accept parent
Change-Id: Ifbbd2b7af06eec620a765614792547fff6303f06 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -305,7 +305,7 @@ bool FancyLineEdit::hasAutoHideButton(Side side) const
|
||||
void FancyLineEdit::setHistoryCompleter(const QString &historyKey)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
@@ -156,8 +156,9 @@ void HistoryCompleterPrivate::saveEntry(const QString &str)
|
||||
theSettings->setValue(historyKey, list);
|
||||
}
|
||||
|
||||
HistoryCompleter::HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey)
|
||||
: d(new HistoryCompleterPrivate)
|
||||
HistoryCompleter::HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey, QObject *parent)
|
||||
: QCompleter(parent),
|
||||
d(new HistoryCompleterPrivate)
|
||||
{
|
||||
QTC_ASSERT(lineEdit, return);
|
||||
QTC_ASSERT(!historyKey.isEmpty(), return);
|
||||
|
@@ -49,7 +49,7 @@ class QTCREATOR_UTILS_EXPORT HistoryCompleter : public QCompleter
|
||||
|
||||
public:
|
||||
static void setSettings(QSettings *settings);
|
||||
HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey);
|
||||
HistoryCompleter(QLineEdit *lineEdit, const QString &historyKey, QObject *parent = 0);
|
||||
|
||||
private:
|
||||
~HistoryCompleter();
|
||||
|
Reference in New Issue
Block a user