File indexing completed on 2024-12-22 03:46:48

0001 /*
0002   This file is part of the KTextTemplate library
0003 
0004   SPDX-FileCopyrightText: 2010 Stephen Kelly <steveire@gmail.com>
0005 
0006   SPDX-License-Identifier: LGPL-2.1-or-later
0007 
0008 */
0009 
0010 #ifndef COMBOBOX_DELEGATE_P_H
0011 #define COMBOBOX_DELEGATE_P_H
0012 
0013 #include "comboboxdelegate.h"
0014 
0015 #include <QComboBox>
0016 #include <QItemEditorCreatorBase>
0017 #include <QItemEditorFactory>
0018 
0019 class ComboBoxEditorCreator : public QItemEditorCreatorBase
0020 {
0021 public:
0022     explicit ComboBoxEditorCreator(const QStringList &data, ComboBoxDelegate::Type type);
0023     virtual ~ComboBoxEditorCreator();
0024 
0025     /* reimp */ QWidget *createWidget(QWidget *parent) const;
0026 
0027     /* reimp */ QByteArray valuePropertyName() const;
0028 
0029 private:
0030     QStringList m_data;
0031     ComboBoxDelegate::Type m_type;
0032 };
0033 
0034 class ViewComboBox : public QComboBox
0035 {
0036     Q_OBJECT
0037     Q_PROPERTY(QString choice READ choice WRITE setChoice)
0038 public:
0039     explicit ViewComboBox(QWidget *parent = 0);
0040 
0041     QString choice() const;
0042     void setChoice(const QString &choice);
0043 };
0044 
0045 #endif