#ifndef CUSTOM_COMBO_BOX_H
#define CUSTOM_COMBO_BOX_H

#include <QComboBox>
#include <QString>

class CustomComboBox : public QComboBox
{
    Q_OBJECT
public:
    explicit CustomComboBox(QWidget *parent = nullptr);
    void setDefaultPreItem(const QString &text, bool isDefaultItem = false);
    void setDefaultAfterItem(const QString &text, bool isDefaultItem = false);
    void addItem(const QString &text);
    void addItems(const QStringList &texts);
    void setCurrentIndexToDefault();
    void clear();
    bool isEmpty();

private:
    int m_preItemSize{0};
    int m_tailItemSize{0};
    int m_defaultItem{-1};
};
#endif // CUSTOM_COMBO_BOX_H

