1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: QtxPathListEdit.h
21 // Author: Sergey TELKOV
23 #ifndef QTXPATHLISTEDIT_H
24 #define QTXPATHLISTEDIT_H
36 class QStringListModel;
39 #pragma warning( disable:4251 )
42 class QTX_EXPORT QtxPathListEdit : public QFrame
50 QtxPathListEdit( const Qtx::PathType, QWidget* = 0 );
51 QtxPathListEdit( QWidget* = 0 );
52 virtual ~QtxPathListEdit();
54 Qtx::PathType pathType() const;
55 void setPathType( const Qtx::PathType );
57 QStringList pathList() const;
58 void setPathList( const QStringList& );
60 bool isDuplicateEnabled() const;
61 void setDuplicateEnabled( const bool );
64 bool contains( const QString& ) const;
67 void remove( const int );
68 void remove( const QString& );
69 void insert( const QString&, const int = -1 );
71 bool eventFilter( QObject*, QEvent* );
74 void onUp( bool = false );
75 void onDown( bool = false );
76 void onInsert( bool = false );
77 void onDelete( bool = false );
81 QWidget* createEditor( QWidget* );
82 void setModelData( QWidget*, const QModelIndex& );
83 void setEditorData( QWidget*, const QModelIndex& );
85 bool checkExistance( const QString&, const bool = true );
86 bool checkDuplicate( const QString&, const int, const bool = true );
91 QStringListModel* myModel;
92 QCompleter* myCompleter;
95 friend class QtxPathListEdit::Delegate;