42 #ifndef QCOMPLETER_P_H 43 #define QCOMPLETER_P_H 57 #include "private/qobject_p.h" 59 #ifndef QT_NO_COMPLETER 61 #include "QtGui/qtreeview.h" 62 #include "QtGui/qabstractproxymodel.h" 64 #include "QtGui/qitemdelegate.h" 65 #include "QtGui/qpainter.h" 66 #include "private/qabstractproxymodel_p.h" 113 inline int count()
const {
return v ? vector.count() : t - f + 1; }
115 inline int indexOf(
int x)
const {
return v ? vector.indexOf(x) : ((t < f) ? -1 : x - f); }
117 inline bool isEmpty()
const {
return v ? vector.isEmpty() : (t < f); }
119 inline int first()
const {
return v ? vector.first() : f; }
120 inline int last()
const {
return v ? vector.last() : t; }
123 inline int cost()
const {
return vector.count()+2; }
134 indices(indices), exactMatchIndex(em), partial(p) { }
161 int matchCount()
const {
return curMatch.indices.count() + historyMatch.indices.count(); }
187 void filterOnDemand(
int);
202 if (view->currentIndex() == idx)
221 void setFiltered(
bool);
223 int completionCount()
const;
225 bool setCurrentRow(
int row);
252 void modelDestroyed();
262 #endif // QT_NO_COMPLETER 264 #endif // QCOMPLETER_P_H The QVariant class acts like a union for the most common Qt data types.
QMatchData(const QIndexMapper &indices, int em, bool p)
The QPainter class performs low-level painting on widgets and other paint devices.
CompletionMode
This enum specifies how completions are provided to the user.
#define QT_END_NAMESPACE
This macro expands to.
QIndexMapper(QVector< int > vec)
void setCurrentIndex(QModelIndex, bool=true)
QStyle::State state
the style flags that are used when drawing the control
QCompleter::CompletionMode mode
QPointer< QWidget > widget
virtual ~QCompletionEngine()
The QCompleter class provides completions based on an item model.
void paint(QPainter *p, const QStyleOptionViewItem &opt, const QModelIndex &idx) const
Renders the delegate using the given painter and style option for the item specified by index...
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
void _q_fileSystemModelDirectoryLoaded(const QString &path)
ModelSorting
This enum specifies how the items in the model are sorted.
QCompletionEngine(QCompleterPrivate *c)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
virtual void filterOnDemand(int)
QMap< QString, QMatchData > CacheItem
void _q_complete(QModelIndex, bool=false)
The QStringList class provides a list of strings.
bool showDecorationSelected
whether the decoration should be highlighted on selected items
static const char * data(const QByteArray &arr)
void init(QAbstractItemModel *model=0)
QAbstractItemView * popup
The QAbstractItemModel class provides the abstract interface for item model classes.
The QAbstractProxyModel class provides a base class for proxy item models that can do sorting...
QIndexMapper(int f, int t)
The QAbstractItemView class provides the basic functionality for item view classes.
#define Q_DECLARE_PUBLIC(Class)
The QItemSelection class manages information about selected items in a model.
QMap< QModelIndex, CacheItem > Cache
QCompleterItemDelegate(QAbstractItemView *view)
The QItemDelegate class provides display and editing facilities for data items from a model...
The QModelIndex class is used to locate data in a data model.
void showPopup(const QRect &)
The QRect class defines a rectangle in the plane using integer precision.
QFuture< void > filter(Sequence &sequence, FilterFunction filterFunction)
void _q_autoResizePopup()
QUnsortedModelEngine(QCompleterPrivate *c)
#define Q_DECLARE_PRIVATE(Class)
QScopedPointer< QCompletionEngine > engine
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
void _q_completionSelected(const QItemSelection &)
QCompleter::ModelSorting sorting
bool hiddenBecauseNoMatch
QModelIndex parent(const QModelIndex &=QModelIndex()) const
Returns the parent of the model item with the given index.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Renders the delegate using the given painter and style option for the item specified by index...
The QMap class is a template class that provides a skip-list-based dictionary.
QSortedModelEngine(QCompleterPrivate *c)