• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • sources
  • kde-4.12
  • kdelibs
  • kdeui
  • itemviews
ktreewidgetsearchline.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (c) 2003 Scott Wheeler <wheeler@kde.org>
3  Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
4  Copyright (c) 2006 Hamish Rodda <rodda@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KTREEWIDGETSEARCHLINE_H
22 #define KTREEWIDGETSEARCHLINE_H
23 
24 #include <klineedit.h>
25 
26 class QModelIndex;
27 class QTreeWidget;
28 class QTreeWidgetItem;
29 
38 class KDEUI_EXPORT KTreeWidgetSearchLine : public KLineEdit
39 {
40  Q_OBJECT
41 
42  Q_PROPERTY( Qt::CaseSensitivity caseSensitity READ caseSensitivity WRITE setCaseSensitivity )
43  Q_PROPERTY( bool keepParentsVisible READ keepParentsVisible WRITE setKeepParentsVisible )
44 
45 
46  public:
54  explicit KTreeWidgetSearchLine( QWidget *parent = 0, QTreeWidget *treeWidget = 0 );
55 
63  KTreeWidgetSearchLine( QWidget *parent, const QList<QTreeWidget *> &treeWidgets );
64 
65 
69  virtual ~KTreeWidgetSearchLine();
70 
76  Qt::CaseSensitivity caseSensitivity() const;
77 
84  QList<int> searchColumns() const;
85 
92  bool keepParentsVisible() const;
93 
100  QTreeWidget *treeWidget() const;
101 
108  QList<QTreeWidget *> treeWidgets() const;
109 
110 Q_SIGNALS:
115  void hiddenChanged(QTreeWidgetItem *, bool);
116 
117  public Q_SLOTS:
124  void addTreeWidget( QTreeWidget *treeWidget );
125 
133  void removeTreeWidget( QTreeWidget *treeWidget );
134 
139  virtual void updateSearch( const QString &pattern = QString() );
140 
146  void setCaseSensitivity( Qt::CaseSensitivity caseSensitivity );
147 
162  void setKeepParentsVisible( bool value );
163 
173  void setSearchColumns( const QList<int> &columns );
174 
182  void setTreeWidget( QTreeWidget *treeWidget );
183 
191  void setTreeWidgets( const QList<QTreeWidget *> &treeWidgets );
192 
193 
194  protected:
200  virtual bool itemMatches( const QTreeWidgetItem *item, const QString &pattern ) const;
201 
205  virtual void contextMenuEvent( QContextMenuEvent* );
206 
211  virtual void updateSearch( QTreeWidget *treeWidget );
212 
217  virtual void connectTreeWidget( QTreeWidget* );
218 
222  virtual void disconnectTreeWidget( QTreeWidget* );
223 
238  virtual bool canChooseColumnsCheck();
239 
243  virtual bool event(QEvent *event);
244  private:
245  class Private;
246  Private* const d;
247 
248  Q_PRIVATE_SLOT(d, void _k_rowsInserted(const QModelIndex&, int, int) const)
249  Q_PRIVATE_SLOT(d, void _k_treeWidgetDeleted(QObject*))
250  Q_PRIVATE_SLOT(d, void _k_slotColumnActivated(QAction*))
251  Q_PRIVATE_SLOT(d, void _k_slotAllVisibleColumns())
252  Q_PRIVATE_SLOT(d, void _k_queueSearch(const QString&))
253  Q_PRIVATE_SLOT(d, void _k_activateSearch())
254 };
255 
260 class KDEUI_EXPORT KTreeWidgetSearchLineWidget : public QWidget
261 {
262  Q_OBJECT
263 
264  public:
269  explicit KTreeWidgetSearchLineWidget( QWidget *parent = 0, QTreeWidget *treeWidget = 0 );
270 
274  ~KTreeWidgetSearchLineWidget();
275 
279  KTreeWidgetSearchLine *searchLine() const;
280 
281  protected Q_SLOTS:
288  virtual void createWidgets();
289 
290  protected:
298  virtual KTreeWidgetSearchLine *createSearchLine( QTreeWidget *treeWidget ) const;
299 
300  private:
301  class Private;
302  Private* const d;
303 };
304 
305 #endif
KTreeWidgetSearchLine
This class makes it easy to add a search line for filtering the items in listviews based on a simple ...
Definition: ktreewidgetsearchline.h:38
QTreeWidget
QWidget
QString
QObject
KLineEdit
An enhanced QLineEdit widget for inputting text.
Definition: klineedit.h:149
KTreeWidgetSearchLineWidget
Creates a widget featuring a KTreeWidgetSearchLine, a label with the text "Search" and a button to cl...
Definition: ktreewidgetsearchline.h:260
klineedit.h
QAction
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:16 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal