Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
QmitkComboBoxStepThrough.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkComboBoxStepThrough_H
14 #define QmitkComboBoxStepThrough_H
15 
16 #include <QComboBox>
17 
24 class QmitkComboBoxStepThrough : public QComboBox
25 {
26  Q_OBJECT
27 
28 signals:
33  void SignalReachedEnd(bool);
34 
39  void SignalReachedBegin(bool);
40 
41 public slots:
46  void OnSetPreviousIndex();
47 
52  void OnSetNextIndex();
53 
54 private slots:
58  void OnCurrentIndexChanged(int);
59 
60 public:
61  QmitkComboBoxStepThrough(QWidget* parent = nullptr);
62  ~QmitkComboBoxStepThrough() override;
63 
64  // --> Overwritten superclass methods
65  void addItem( const QString & text, const QVariant & userData = QVariant() );
66  void addItem( const QIcon & icon, const QString & text, const QVariant & userData = QVariant() );
67  void addItems( const QStringList & texts );
68 
69  void insertItem( int index, const QString & text, const QVariant & userData = QVariant() );
70  void insertItem( int index, const QIcon & icon, const QString & text, const QVariant & userData = QVariant() );
71  void insertItems( int index, const QStringList & list );
72  // Overwritten superclass methods <--
73 
74 private:
75  int m_LastMaxIndex;
76  int m_LastIndex;
77 };
78 
79 #endif // QmitkComboBoxStepThrough_H
void addItem(const QString &text, const QVariant &userData=QVariant())
Extension of QComboBox which offers stepping through the values.
void insertItems(int index, const QStringList &list)
void addItems(const QStringList &texts)
QmitkComboBoxStepThrough(QWidget *parent=nullptr)
void insertItem(int index, const QString &text, const QVariant &userData=QVariant())