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 #ifndef QTXTOOLBUTTON_H
21 #define QTXTOOLBUTTON_H
25 #include <QStringList>
26 #include <QToolButton>
29 class QTX_EXPORT QtxToolButton : public QToolButton
33 enum Move { NoMove=0, MoveUp, MoveDown, MoveFirst, MoveLast };
36 QtxToolButton( QWidget* = 0 );
37 virtual ~QtxToolButton();
39 int addItem( const QString&, const QVariant& = QVariant() );
40 int addItem( const QIcon&, const QString&, const QVariant& = QVariant() );
41 void addItems( const QStringList& );
43 int addSeparator( const QString& = QString() );
44 int addSeparator( const QIcon&, const QString& );
46 void removeItem( int );
50 QVariant currentData() const;
51 int currentIndex() const;
52 QString currentText() const;
54 QVariant itemData( int ) const;
55 QIcon itemIcon( int ) const;
56 QString itemText( int ) const;
58 void setItemData( int, const QVariant& );
59 void setItemIcon( int, const QIcon& );
60 void setItemText( int, const QString& );
62 int findText( const QString& );
67 void setCurrentIndex( int );
68 void setCurrentText( const QString& );
71 void keyPressEvent( QKeyEvent* );
72 void wheelEvent( QWheelEvent* );
75 void activated( int );
76 void activated( const QString& );
77 void currentIndexChanged( int );
78 void currentIndexChanged( const QString& );
79 void currentTextChanged( const QString& );
82 void actionTriggered( QAction* );
85 void internalUpdate();
86 QAction* actionAt( int ) const;
87 void moveIndex( Move );
88 void emitCurrentChanged( bool, bool );
91 #endif // QTXTOOLBUTTON_H