mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-16 03:44:56 +02:00
gui/MultiSelect: add variable for default state for addItem() and addItems()
This commit is contained in:
parent
c14a453f01
commit
925ef7e8ad
2 changed files with 6 additions and 6 deletions
|
|
@ -54,19 +54,19 @@ QPushButton (text + ": none", parent)
|
|||
QObject::connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(listItemClicked(QListWidgetItem*)));
|
||||
}
|
||||
|
||||
void MultiSelect::addItem(const QString& text)
|
||||
void MultiSelect::addItem(const QString& text, bool checked)
|
||||
{
|
||||
QListWidgetItem* item = new QListWidgetItem(text, m_list);
|
||||
item->setFlags(Qt::ItemIsEnabled);
|
||||
item->setCheckState(Qt::Unchecked);
|
||||
item->setCheckState(checked ? Qt::Checked : Qt::Unchecked);
|
||||
}
|
||||
|
||||
void MultiSelect::addItems(const QStringList& list)
|
||||
void MultiSelect::addItems(const QStringList& list, bool checked)
|
||||
{
|
||||
QStringList::const_iterator it;
|
||||
|
||||
for(it = list.cbegin(); it != list.cend(); it++) {
|
||||
addItem(*it);
|
||||
addItem(*it, checked);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue