1 // Copyright (C) 2007-2008 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.
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
23 // Author: Sergey TELKOV
30 // This file isn't yet ported to Qt4 => there are some corrections for OCCViewer porting -->
31 //#include <qlistbox.h>
32 #include <QListWidget>
33 #include <QListWidgetItem>
37 #pragma warning( disable:4251 )
43 class QTX_EXPORT QtxListBox : public QListWidget//QListBox // This file isn't yet ported to Qt4 => there are some corrections for OCCViewer porting
48 QtxListBox( QWidget* = 0, const char* = 0, Qt::WindowFlags = 0 );
49 virtual ~QtxListBox();
51 bool isEditEnabled() const;
52 bool defaultEditAction() const;
53 bool isModificationEnabled() const;
55 QListWidgetItem* editedItem() const;
56 int editedIndex() const;
58 void startEdition( const int );
59 void startEdition( const QListWidgetItem* );
60 void endEdition( const bool );
62 void ensureItemVisible( const int );
63 void ensureItemVisible( const QListWidgetItem* );
65 virtual bool eventFilter( QObject*, QEvent* );
67 const QValidator* validator() const;
69 void moveItemToTop( const int );
70 void moveItemToBottom( const int );
71 void moveItem( const int, const int );
73 void createItem( const int = -1 );
74 void deleteItem( const int = -1 );
77 void itemEdited( int );
78 void itemEdited( QListWidgetItem* );
79 void itemMoved( int, int );
82 virtual void setEditEnabled( bool );
83 virtual void setDefaultEditAction( bool );
84 virtual void setModificationEnabled( bool );
86 virtual void clearValidator();
87 virtual void setValidator( const QValidator* );
88 virtual void setContentsPos( int, int );
91 void onContentsMoving( int, int );
94 virtual void keyPressEvent( QKeyEvent* );
95 virtual void viewportResizeEvent( QResizeEvent* );
96 virtual void mouseDoubleClickEvent( QMouseEvent* );
99 QLineEdit* editor() const;
112 #pragma warning( default:4251 )