Utils: Introduce CompletingLineEdit

* Works around QTCREATORBUG-9453
* Triggers completion on Key_Down with empty prefix
* Replace current filters in HistoryCompleter and FancyLineEdit

Change-Id: I56bfd4e0ee969c5ae674de2f2de1081fcf6dc176
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Orgad Shaneh
2013-12-13 14:34:28 +02:00
committed by Orgad Shaneh
parent 77b766400e
commit 6c78cb303e
8 changed files with 142 additions and 39 deletions

View File

@@ -31,8 +31,8 @@
#define FANCYLINEEDIT_H
#include "utils_global.h"
#include "completinglineedit.h"
#include <QLineEdit>
#include <QAbstractButton>
QT_BEGIN_NAMESPACE
@@ -66,7 +66,7 @@ private:
QPixmap m_pixmap;
};
class QTCREATOR_UTILS_EXPORT FancyLineEdit : public QLineEdit
class QTCREATOR_UTILS_EXPORT FancyLineEdit : public CompletingLineEdit
{
Q_OBJECT
Q_ENUMS(Side)
@@ -114,11 +114,10 @@ private slots:
protected:
void resizeEvent(QResizeEvent *e);
bool event(QEvent *e);
private:
// Unimplemented, to force the user to make a decision on
// whether to use setHistoryKey() or setSpecialCompleter().
// whether to use setHistoryCompleter() or setSpecialCompleter().
void setCompleter(QCompleter *);
void updateMargins();