1
/* This file is part of the KDE project
2
Copyright (C) 2003 Alexander Dymo <cloudtemple@mksat.net>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
22
#include <kcompletion.h>
24
#include "qcomboview.h"
32
KComboView - a combo with a QListView as a popup widget.
33
KComboView provides text completion.
34
@sa QComboView for a description.
38
///This can be used to insert own KCompletion-implementations
39
class CustomCompleter : public KCompletion {
41
virtual void addItem (const QString &item) {
42
KCompletion::addItem( item );
45
virtual void removeItem (const QString &item) {
46
KCompletion::removeItem( item );
49
virtual void clear() {
55
class KComboView: public QComboView
59
///The combo-view takes the ownership of the completer and deletes it on destruction
60
KComboView( bool rw, int defaultWidth = 100, QWidget* parent=0, const char* name=0, CustomCompleter* completer = new CustomCompleter() );
61
virtual ~KComboView();
63
virtual void addItem(QListViewItem *it);
64
virtual void removeItem(QListViewItem *it);
65
virtual void renameItem(QListViewItem *it, const QString &newName);
67
virtual void setDefaultText(const QString &text);
73
virtual void setUpListView();
75
CustomCompleter* m_comp;
77
QString m_defaultText;