Files
Jungfraujoch/viewer/widgets/NumericComboBox.h
2025-05-12 14:17:24 +02:00

30 lines
732 B
C++

// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
// SPDX-License-Identifier: GPL-3.0-only
#ifndef JFJOCH_NUMERICCOMBOBOX_H
#define JFJOCH_NUMERICCOMBOBOX_H
#include <QComboBox>
class NumericComboBox : public QComboBox {
Q_OBJECT
QIntValidator *validator;
public:
NumericComboBox(std::vector<int> options,
int min = 0,
int max = 100,
QWidget *parent = nullptr);
int getValue() const;
void setValue(int value);
signals:
void valueChanged(int value);
private slots:
void onCurrentIndexChanged(int index);
void onEditTextChanged(const QString &text);
};
#endif //JFJOCH_NUMERICCOMBOBOX_H