File indexing completed on 2024-04-28 05:43:24

0001 /***************************************************************************
0002  *   Copyright (C) 2002 Lucijan Busch <lucijan@gmx.at>                     *
0003  *   Copyright (C) 2006 David Saxton <david@bluehaze.org>                  *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  ***************************************************************************/
0010 
0011 #ifndef PROPERTYEDITORLIST_H
0012 #define PROPERTYEDITORLIST_H
0013 
0014 #include <KComboBox>
0015 
0016 #include "propertysubeditor.h"
0017 
0018 class QStringList;
0019 class KListBox;
0020 class QToolButton;
0021 
0022 class Variant;
0023 typedef Variant Property;
0024 
0025 class PropComboBox : public KComboBox
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     PropComboBox(QWidget *parent);
0031     ~PropComboBox() override
0032     {
0033         ;
0034     }
0035 
0036     bool eventFilter(QObject *o, QEvent *e) override;
0037 
0038 public slots:
0039     void hideList();
0040 
0041 protected:
0042     bool m_eventFilterEnabled : 1;
0043 };
0044 
0045 class PropertyEditorList : public PropertySubEditor
0046 {
0047     Q_OBJECT
0048 
0049 public:
0050     PropertyEditorList(QWidget *parent, Property *property);
0051     ~PropertyEditorList() override
0052     {
0053         ;
0054     }
0055 
0056     void setList(QStringList l);
0057 
0058 protected slots:
0059     void valueChanged(const QString &text);
0060 
0061 protected:
0062     PropComboBox *m_combo;
0063     QToolButton *m_button;
0064 };
0065 
0066 #endif