File indexing completed on 2024-04-21 05:51:35

0001 /*
0002  *  SPDX-FileCopyrightText: 2002-2003 Jesper K. Pedersen <blackie@kde.org>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.0-only
0005  **/
0006 
0007 #ifndef CHARSELECTOR_H
0008 #define CHARSELECTOR_H
0009 
0010 #include <QWidget>
0011 
0012 class QComboBox;
0013 class QStackedWidget;
0014 class LimitedCharLineEdit;
0015 
0016 class CharSelector : public QWidget
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     explicit CharSelector(QWidget *parent);
0022     QString text() const;
0023     void setText(const QString &text);
0024     bool isEmpty() const;
0025 
0026 protected:
0027     void fillComboBox();
0028 
0029 private Q_SLOTS:
0030     void slotNewItem(int which);
0031 
0032 private:
0033     QComboBox *_type = nullptr;
0034     QStackedWidget *_stack = nullptr;
0035     LimitedCharLineEdit *_normal = nullptr;
0036     LimitedCharLineEdit *_hex = nullptr;
0037     LimitedCharLineEdit *_oct = nullptr;
0038     int _oldIndex = 0;
0039 };
0040 
0041 #endif // CHARSELECTOR_H