20 #include <QHBoxLayout>
22 #include <QStringList>
25 #include "../../backend/drivers/btmodulelist.h"
26 #include "../../backend/drivers/cswordlexiconmoduleinfo.h"
27 #include "../../backend/drivers/cswordmoduleinfo.h"
28 #include "../../backend/keys/cswordkey.h"
29 #include "../../backend/keys/cswordldkey.h"
30 #include "../../util/btconnect.h"
43 auto *
const l =
new QHBoxLayout(
this);
45 l->setContentsMargins(0, 0, 0, 0);
46 l->setDirection(QBoxLayout::LeftToRight);
47 l->setSizeConstraint(QLayout::SetNoConstraint);
57 tr(
"Entries of the current work"),
59 tr(
"Scroll through the entries of the list. Press the button and move the mouse to increase or decrease the item."),
63 l->addWidget(
m_widget, 0, Qt::AlignLeft);
65 auto const activatedSlot =
118 std::multimap<unsigned int, QStringList const *> entryMap;
119 for (
auto const *
const modulePtr :
m_modules) {
120 auto const & entries = modulePtr->entries();
121 entryMap.emplace(entries.count(), &entries);
124 QStringList goodEntries;
126 auto it(entryMap.begin());
127 QStringList refEntries = *(it->second);
128 const QStringList *cmpEntries = (++it)->second;
133 while (it != entryMap.end() && (refEntries.begin() != refEntries.end())) {
135 refEntries.begin(), --(refEntries.end()),
136 cmpEntries->begin(), --(cmpEntries->end()),
137 std::back_inserter(goodEntries)
140 cmpEntries = ( ++it )->second;
146 refEntries = goodEntries;
162 for (
auto const *
const m : modules)
163 if (CSLMI
const *
const lexicon =
dynamic_cast<CSLMI
const *
>(m))
QList< CSwordModuleInfo const * > BtConstModuleList
void keyChanged(CSwordKey *newKey)
QList< CSwordLexiconModuleInfo const * > m_modules
CSwordKey * key() final override
void setModules(BtConstModuleList const &modules, bool refresh=true) final override
void setKey(CSwordKey *key) final override
void refreshContent() final override
CKeyChooserWidget * m_widget
CLexiconKeyChooser(BtConstModuleList const &modules, CSwordKey *key=nullptr, QWidget *parent=nullptr)
void updateKey(CSwordKey *key) final override
bool setKey(const QString &newKey) final override
QString key() const final override