!XT (BREAK-16) (Sandbox) Remove double-newlines at the end of files.
[CRYENGINE.git] / Code / Sandbox / Plugins / EditorCommon / Controls / QEditableComboBox.h
blobb281de4d19de6c3e7b62e33a62e0f3b6f4a70ce5
1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #include "EditorCommonAPI.h"
5 #include <QWidget>
7 #pragma once
9 class QMenuComboBox;
10 class QLineEdit;
12 //TODO : Unify with QMenuComboBox by adding editable functionnality there
13 class EDITOR_COMMON_API QEditableComboBox : public QWidget
15 Q_OBJECT
16 public:
17 QEditableComboBox(QWidget* pParent = nullptr);
19 QString GetCurrentText() const;
21 void ClearItems();
22 void AddItem(const QString& itemName);
23 void AddItems(const QStringList& itemNames);
24 void RemoveCurrentItem();
26 void SetCurrentItem(const QString& itemName);
28 public Q_SLOTS:
29 void OnBeginEditing();
30 void OnEditingFinished();
31 void OnEditingCancelled();
33 Q_SIGNALS:
34 void ItemRenamed(const QString& before, const QString& after);
35 void TextChanged();
36 void OnCurrentIndexChanged(int index);
38 protected:
39 bool eventFilter(QObject* obj, QEvent* event);
41 protected:
42 QMenuComboBox* m_pComboBox;
43 QLineEdit* m_pLineEdit;