1 /***************************************************************************
2 * Copyright 2008 Aleix Pol <aleixpol@gmail.com> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU Library General Public License as *
6 * published by the Free Software Foundation; either version 2 of the *
7 * License, or (at your option) any later version. *
9 * This program 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 *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU Library General Public *
15 * License along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef PROJECTITEMLINEEDIT_H
21 #define PROJECTITEMLINEEDIT_H
24 #include <QStringList>
27 class ProjectItemCompleter
: public QCompleter
31 ProjectItemCompleter(QAbstractItemModel
* model
, QObject
* parent
=0);
33 QString
pathFromIndex(const QModelIndex
& index
) const;
34 QString
separator() const { return sep
; }
35 QStringList
splitPath(const QString
&path
) const { return path
.split(sep
); }
38 QAbstractItemModel
*mModel
;
42 class ProjectItemLineEdit
: public KLineEdit
46 ProjectItemLineEdit(QWidget
* parent
=0);
49 void updated(const QString
& newText
);
50 void correctnessChange(bool correct
);
53 void correctnessChanged(bool isCorrect
);