1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // Author: Sergey TELKOV
31 // This file isn't yet ported to Qt4 => there are some corrections for OCCViewer porting -->
32 //#include <qlistbox.h>
33 #include <QListWidget>
34 #include <QListWidgetItem>
38 #pragma warning( disable:4251 )
44 class QTX_EXPORT QtxListBox : public QListWidget//QListBox // This file isn't yet ported to Qt4 => there are some corrections for OCCViewer porting
49 QtxListBox( QWidget* = 0, const char* = 0, Qt::WindowFlags = 0 );
50 virtual ~QtxListBox();
52 bool isEditEnabled() const;
53 bool defaultEditAction() const;
54 bool isModificationEnabled() const;
56 QListWidgetItem* editedItem() const;
57 int editedIndex() const;
59 void startEdition( const int );
60 void startEdition( const QListWidgetItem* );
61 void endEdition( const bool );
63 void ensureItemVisible( const int );
64 void ensureItemVisible( const QListWidgetItem* );
66 virtual bool eventFilter( QObject*, QEvent* );
68 const QValidator* validator() const;
70 void moveItemToTop( const int );
71 void moveItemToBottom( const int );
72 void moveItem( const int, const int );
74 void createItem( const int = -1 );
75 void deleteItem( const int = -1 );
78 void itemEdited( int );
79 void itemEdited( QListWidgetItem* );
80 void itemMoved( int, int );
83 virtual void setEditEnabled( bool );
84 virtual void setDefaultEditAction( bool );
85 virtual void setModificationEnabled( bool );
87 virtual void clearValidator();
88 virtual void setValidator( const QValidator* );
89 virtual void setContentsPos( int, int );
92 void onContentsMoving( int, int );
95 virtual void keyPressEvent( QKeyEvent* );
96 virtual void viewportResizeEvent( QResizeEvent* );
97 virtual void mouseDoubleClickEvent( QMouseEvent* );
100 QLineEdit* editor() const;
113 #pragma warning( default:4251 )