MCPcopy Create free account
hub / github.com/davy7125/polyphone / ComboBoxLoopMode

Method ComboBoxLoopMode

sources/editor/widgets/comboboxloopmode.cpp:29–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include <QKeyEvent>
28
29ComboBoxLoopMode::ComboBoxLoopMode(QWidget *parent) : QComboBox(parent),
30 _ignoreFirstHide(true),
31 _currentIndex(0)
32{
33 this->setView(new ComboView());
34 this->setFocusPolicy(Qt::StrongFocus);
35 this->setFocus();
36
37 // Different loop possibilities
38 this->addItem("", -1);
39 QMap<QString, QString> replacement;
40 replacement["currentColor"] = ContextManager::theme()->getColor(ThemeManager::LIST_TEXT).name();
41 replacement["secondColor"] = ContextManager::theme()->getColor(ThemeManager::LIST_TEXT, ThemeManager::ColorContext::DISABLED).name();
42 this->addItem(ContextManager::theme()->getColoredSvg(":/icons/sample_mode_loop_off.svg", QSize(48, 48), replacement), "", 0);
43 this->addItem(ContextManager::theme()->getColoredSvg(":/icons/sample_mode_loop_on.svg", QSize(48, 48), replacement), "", 1);
44 this->addItem(ContextManager::theme()->getColoredSvg(":/icons/sample_mode_release.svg", QSize(48, 48), replacement), "", 2);
45 this->addItem(ContextManager::theme()->getColoredSvg(":/icons/sample_mode_loop_on_end.svg", QSize(48, 48), replacement), "", 3);
46
47 QObject::connect(this, SIGNAL(activated(int)), this, SLOT(onActivated(int)));
48 QObject::connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(onActivated(int)));
49}
50
51void ComboBoxLoopMode::showEvent(QShowEvent * event)
52{

Callers

nothing calls this directly

Calls 3

addItemMethod · 0.80
getColoredSvgMethod · 0.80
getColorMethod · 0.45

Tested by

no test coverage detected