KItemViews
ktreewidgetsearchline.cpp
64void KTreeWidgetSearchLinePrivate::_k_rowsInserted(const QModelIndex &parentIndex, int start, int end) const
120 if (searchColumns.count() == treeWidgets.first()->header()->count() - treeWidgets.first()->header()->hiddenSectionCount()) {
177/** Check whether \p item, its siblings and their descendants should be shown. Show or hide the items as necessary.
179 * \p item The list view item to start showing / hiding items at. Typically, this is the first child of another item, or
181 * \return \c true if an item which should be visible is found, \c false if all items found should be hidden. If this function
220KTreeWidgetSearchLine::KTreeWidgetSearchLine(QWidget *q, const QList<QTreeWidget *> &treeWidgets)
384bool KTreeWidgetSearchLine::itemMatches(const QTreeWidgetItem *item, const QString &pattern) const
421 QAction *allVisibleColumnsAction = subMenu->addAction(tr("All Visible Columns", "@optipn:check"), this, SLOT(_k_slotAllVisibleColumns()));
470 connect(treeWidget->model(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(_k_rowsInserted(QModelIndex, int, int)));
475 disconnect(treeWidget, SIGNAL(destroyed(QObject *)), this, SLOT(_k_treeWidgetDeleted(QObject *)));
477 disconnect(treeWidget->model(), SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(_k_rowsInserted(QModelIndex, int, int)));
529 if (keyEvent->matches(QKeySequence::MoveToNextLine) || keyEvent->matches(QKeySequence::SelectNextLine)
530 || keyEvent->matches(QKeySequence::MoveToPreviousLine) || keyEvent->matches(QKeySequence::SelectPreviousLine)
531 || keyEvent->matches(QKeySequence::MoveToNextPage) || keyEvent->matches(QKeySequence::SelectNextPage)
532 || keyEvent->matches(QKeySequence::MoveToPreviousPage) || keyEvent->matches(QKeySequence::SelectPreviousPage) || keyEvent->key() == Qt::Key_Enter
This class makes it easy to add a search line for filtering the items in listviews based on a simple ...
Definition ktreewidgetsearchline.h:32
virtual void disconnectTreeWidget(QTreeWidget *)
Disconnects signals of a listviews from the search line.
Definition ktreewidgetsearchline.cpp:473
virtual bool canChooseColumnsCheck()
Checks columns in all listviews and decides whether choosing columns to filter on makes any sense.
Definition ktreewidgetsearchline.cpp:480
void searchUpdated(const QString &searchString)
This signal is emitted when user finished entering filter text or when he made a pause long enough,...
KTreeWidgetSearchLine(QWidget *parent=nullptr, QTreeWidget *treeWidget=nullptr)
Constructs a KTreeWidgetSearchLine with treeWidget being the QTreeWidget to be filtered.
Definition ktreewidgetsearchline.cpp:205
void removeTreeWidget(QTreeWidget *treeWidget)
Removes a QTreeWidget from the list of listviews filtered by this search line.
Definition ktreewidgetsearchline.cpp:281
void setTreeWidgets(const QList< QTreeWidget * > &treeWidgets)
Sets QTreeWidgets that are filtered by this search line, replacing any previously filtered listviews.
Definition ktreewidgetsearchline.cpp:363
~KTreeWidgetSearchLine() override
Destroys the KTreeWidgetSearchLine.
virtual void updateSearch(const QString &pattern=QString())
Updates search to only make visible the items that match pattern.
Definition ktreewidgetsearchline.cpp:297
void addTreeWidget(QTreeWidget *treeWidget)
Adds a QTreeWidget to the list of listviews filtered by this search line.
Definition ktreewidgetsearchline.cpp:269
void setCaseSensitivity(Qt::CaseSensitivity caseSensitivity)
Make the search case sensitive or case insensitive.
Definition ktreewidgetsearchline.cpp:332
virtual bool itemMatches(const QTreeWidgetItem *item, const QString &pattern) const
Returns true if item matches the search pattern.
Definition ktreewidgetsearchline.cpp:384
void contextMenuEvent(QContextMenuEvent *) override
Re-implemented for internal reasons.
Definition ktreewidgetsearchline.cpp:413
bool event(QEvent *event) override
Re-implemented for internal reasons.
Definition ktreewidgetsearchline.cpp:525
QList< QTreeWidget * > treeWidgets() const
Returns the list of pointers to listviews that are currently filtered by the search.
Definition ktreewidgetsearchline.cpp:260
QList< int > searchColumns() const
Returns the current list of columns that will be searched.
Definition ktreewidgetsearchline.cpp:237
void hiddenChanged(QTreeWidgetItem *, bool)
This signal is emitted whenever an item gets hidden or unhidden due to it not matching or matching th...
virtual void connectTreeWidget(QTreeWidget *)
Connects signals of this listview to the appropriate slots of the search line.
Definition ktreewidgetsearchline.cpp:466
void setSearchColumns(const QList< int > &columns)
Sets the list of columns to be searched.
Definition ktreewidgetsearchline.cpp:350
void setTreeWidget(QTreeWidget *treeWidget)
Sets the QTreeWidget that is filtered by this search line, replacing any previously filtered listview...
Definition ktreewidgetsearchline.cpp:357
void setKeepParentsVisible(bool value)
When a search is active on a list that's organized into a tree view if a parent or ancesestor of an i...
Definition ktreewidgetsearchline.cpp:341
Qt::CaseSensitivity caseSensitivity() const
Returns true if the search is case sensitive.
Definition ktreewidgetsearchline.cpp:232
QTreeWidget * treeWidget() const
Returns the listview that is currently filtered by the search.
Definition ktreewidgetsearchline.cpp:251
Q_SCRIPTABLE Q_NOREPLY void start()
KGuiItem ok()
const QList< QKeySequence > & end()
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
QAbstractItemModel * model() const const
void setCheckable(bool)
bool isChecked() const const
QVariant data() const const
void setActionGroup(QActionGroup *group)
void setData(const QVariant &data)
void setExclusive(bool b)
bool sendEvent(QObject *receiver, QEvent *event)
KeyPress
int count() const const
bool isSectionHidden(int logicalIndex) const const
int logicalIndex(int visualIndex) const const
MoveToNextLine
void setClearButtonEnabled(bool enable)
QMenu * createStandardContextMenu()
virtual bool event(QEvent *e) override
void setPlaceholderText(const QString &)
text
void textChanged(const QString &text)
ConstIterator
void append(QList< T > &&value)
void clear()
const_iterator constBegin() const const
const_iterator constEnd() const const
bool contains(const AT &value) const const
qsizetype count() const const
T & first()
bool isEmpty() const const
qsizetype removeAll(const AT &t)
void reserve(qsizetype size)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void destroyed(QObject *obj)
bool disconnect(const QMetaObject::Connection &connection)
QObject * sender() const const
QString tr(const char *sourceText, const char *disambiguation, int n)
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
bool isNull() const const
CaseSensitivity
Key_Enter
singleShot
int columnWidth(int column) const const
columnCount
QTreeWidgetItem * currentItem() const const
QTreeWidgetItem * headerItem() const const
QTreeWidgetItem * itemFromIndex(const QModelIndex &index) const const
void scrollToItem(const QTreeWidgetItem *item, QAbstractItemView::ScrollHint hint)
QTreeWidgetItem * topLevelItem(int index) const const
topLevelItemCount
QTreeWidgetItem * child(int index) const const
int childCount() const const
bool isHidden() const const
void setHidden(bool hide)
QString text(int column) const const
QTreeWidget * treeWidget() const const
int toInt(bool *ok) const const
void setEnabled(bool)
visible
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.