Loading...
Searching...
No Matches
ComboBox.hpp
1#pragma once
2
3#include <QComboBox>
4
5#include <score_lib_base_export.h>
6
7#include <verdigris>
8
9namespace score
10{
11class ComboBox : public QComboBox
12{
13public:
14 ComboBox(QWidget* parent)
15 : QComboBox(parent)
16 {
17 setDisabled(true);
18 connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, [&](int index) {
19 this->setEnabled(index != -1);
20 });
21 }
22};
23
25class SCORE_LIB_BASE_EXPORT ComboBoxWithEnter final : public QComboBox
26{
27 W_OBJECT(ComboBoxWithEnter)
28public:
29 explicit ComboBoxWithEnter(QWidget* parent = nullptr);
31
33 void editingFinished() E_SIGNAL(SCORE_LIB_BASE_EXPORT, editingFinished)
35 void editingCancelled() E_SIGNAL(SCORE_LIB_BASE_EXPORT, editingCancelled)
36
37private:
38 bool event(QEvent* event) override;
39};
40}
Definition ComboBox.hpp:12
Counterpart of SpinboxWithEnter: reports when the user is done with it.
Definition ComboBox.hpp:26
void editingFinished()
Enter, or the focus going elsewhere: take what is in the box.
Base toolkit upon which the software is built.
Definition Application.cpp:113