KItemViews
klistwidgetsearchline.cpp
110 connect(d->listWidget->model(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(_k_rowsInserted(QModelIndex,int,int)));
111 connect(d->listWidget->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(_k_dataChanged(QModelIndex,QModelIndex)));
132 return (item->text().indexOf(s, 0, caseSensitive() ? Qt::CaseSensitive : Qt::CaseInsensitive) >= 0);
144 QObject::connect(listWidget->model(), SIGNAL(rowsInserted(QModelIndex,int,int)), q, SLOT(_k_rowsInserted(QModelIndex,int,int)));
145 QObject::connect(listWidget->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), q, SLOT(_k_dataChanged(QModelIndex,QModelIndex)));
189 if (keyEvent->matches(QKeySequence::MoveToNextLine) || keyEvent->matches(QKeySequence::SelectNextLine)
190 || keyEvent->matches(QKeySequence::MoveToPreviousLine) || keyEvent->matches(QKeySequence::SelectPreviousLine)
191 || keyEvent->matches(QKeySequence::MoveToNextPage) || keyEvent->matches(QKeySequence::SelectNextPage)
192 || keyEvent->matches(QKeySequence::MoveToPreviousPage) || keyEvent->matches(QKeySequence::SelectPreviousPage)) {
235void KListWidgetSearchLinePrivate::_k_rowsInserted(const QModelIndex &parent, int start, int end)
244void KListWidgetSearchLinePrivate::_k_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
This class makes it easy to add a search line for filtering the items in a listwidget based on a simp...
Definition klistwidgetsearchline.h:31
bool event(QEvent *event) override
Re-implemented for internal reasons.
Definition klistwidgetsearchline.cpp:185
~KListWidgetSearchLine() override
Destroys the KListWidgetSearchLine.
Definition klistwidgetsearchline.cpp:53
void clear()
Clear line edit and empty hiddenItems, returning elements to listWidget.
Definition klistwidgetsearchline.cpp:79
virtual void updateSearch(const QString &s=QString())
Updates search to only make visible the items that match s.
Definition klistwidgetsearchline.cpp:71
void setCaseSensitivity(Qt::CaseSensitivity cs)
Make the search case sensitive or case insensitive.
Definition klistwidgetsearchline.cpp:93
KListWidgetSearchLine(QWidget *parent=nullptr, QListWidget *listWidget=nullptr)
Constructs a KListWidgetSearchLine with listWidget being the QListWidget to be filtered.
Definition klistwidgetsearchline.cpp:45
QListWidget * listWidget() const
Returns the listWidget that is currently filtered by the search.
Definition klistwidgetsearchline.cpp:63
Qt::CaseSensitivity caseSensitive() const
Returns if the search is case sensitive.
Definition klistwidgetsearchline.cpp:58
virtual bool itemMatches(const QListWidgetItem *item, const QString &s) const
Returns true if item matches the search s.
Definition klistwidgetsearchline.cpp:122
void setListWidget(QListWidget *lv)
Sets the QListWidget that is filtered by this search line.
Definition klistwidgetsearchline.cpp:98
Q_SCRIPTABLE Q_NOREPLY void start()
const QList< QKeySequence > & end()
QAbstractItemModel * model() const const
bool sendEvent(QObject *receiver, QEvent *event)
KeyPress
MoveToNextLine
void clear()
void setClearButtonEnabled(bool enable)
virtual bool event(QEvent *e) override
text
QListWidgetItem * currentItem() const const
QListWidgetItem * item(int row) const const
void scrollToItem(const QListWidgetItem *item, QAbstractItemView::ScrollHint hint)
void sortItems(Qt::SortOrder order)
bool isSortingEnabled() const const
bool isHidden() const const
void setHidden(bool hide)
QString text() const const
bool isValid() const const
QModelIndex parent() const const
int row() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
bool disconnect(const QMetaObject::Connection &connection)
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
bool isNull() const const
CaseSensitivity
Key_Enter
singleShot
void setEnabled(bool)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:14:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.