Choreonoid  1.8
ComboBox.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_COMBO_BOX_H
6 #define CNOID_BASE_COMBO_BOX_H
7 
8 #include <cnoid/Signal>
9 #include <QComboBox>
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class CNOID_EXPORT ComboBox : public QComboBox
15 {
16  Q_OBJECT
17 
18 public:
19  ComboBox(QWidget* parent = nullptr);
20  ~ComboBox();
21 
22  void enableI18n(const char* domainname);
23  void addI18nItem(const char* text);
24  void addI18nItem(const QIcon & icon, const char* text);
25  QString currentOrgText() const;
26  int findOrgText(const std::string& text, bool setFoundItemCurrent = false);
27  virtual void showPopup() override;
28 
29  SignalProxy<void(int)> sigActivated();
30  SignalProxy<void(int)> sigCurrentIndexChanged();
31  SignalProxy<void(const QString&)> sigEditTextChanged();
32  SignalProxy<void(int)> sigHighlighted();
33  SignalProxy<void()> sigAboutToShowPopup();
34 
35 private Q_SLOTS:
36  void onActivated(int index);
37  void onCurrentIndexChanged(int index);
38  void onEditTextChanged(const QString& text);
39  void onHighlighted(int index);
40 
41 private:
42  class Impl;
43  Impl* impl;
44 };
45 
46 }
47 
48 #endif
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::ComboBox
Definition: ComboBox.h:14
cnoid::SignalProxy
Definition: Signal.h:470