KDEUI
klistwidgetsearchline.h
Go to the documentation of this file.
00001 /* 00002 This file is part of the KDE libraries 00003 Copyright (c) 2003 Scott Wheeler <wheeler@kde.org> 00004 Copyright (c) 2004 Gustavo Sverzut Barbieri <gsbarbieri@users.sourceforge.net> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2 as published by the Free Software Foundation. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef KLISTWIDGETSEARCHLINE_H 00022 #define KLISTWIDGETSEARCHLINE_H 00023 00024 #include <klineedit.h> 00025 00026 class QListWidget; 00027 class QListWidgetItem; 00028 class QModelIndex; 00029 00037 class KDEUI_EXPORT KListWidgetSearchLine : public KLineEdit 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 00050 explicit KListWidgetSearchLine( QWidget *parent = 0, 00051 QListWidget *listWidget = 0 ); 00052 00056 virtual ~KListWidgetSearchLine(); 00057 00063 Qt::CaseSensitivity caseSensitive() const; 00064 00070 QListWidget *listWidget() const; 00071 00072 00073 public Q_SLOTS: 00078 virtual void updateSearch( const QString &s = QString() ); 00079 00085 void setCaseSensitivity( Qt::CaseSensitivity cs ); 00086 00093 void setListWidget( QListWidget *lv ); 00094 00095 00099 void clear(); 00100 00101 protected: 00107 virtual bool itemMatches( const QListWidgetItem *item, 00108 const QString &s ) const; 00112 virtual bool event(QEvent *event); 00113 00114 private: 00115 class KListWidgetSearchLinePrivate; 00116 KListWidgetSearchLinePrivate * const d; 00117 00118 Q_PRIVATE_SLOT(d, void _k_listWidgetDeleted()) 00119 Q_PRIVATE_SLOT(d, void _k_queueSearch(const QString&)) 00120 Q_PRIVATE_SLOT(d, void _k_activateSearch()) 00121 Q_PRIVATE_SLOT(d, void _k_rowsInserted(const QModelIndex&, int, int)) 00122 Q_PRIVATE_SLOT(d, void _k_dataChanged(const QModelIndex&, const QModelIndex&)) 00123 }; 00124 00125 00126 #endif /* KLISTWIDGETSEARCHLINE_H */
KDE 4.6 API Reference