Alphabetic sorting for variables.
--HG-- branch : develop
This commit is contained in:
parent
d0ce7e5d10
commit
3407961b65
|
@ -396,15 +396,23 @@ void DialogTool::ShowVariable(const QHash<key, val> *var){
|
||||||
Q_CHECK_PTR(listWidget);
|
Q_CHECK_PTR(listWidget);
|
||||||
disconnect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
disconnect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
||||||
listWidget->clear();
|
listWidget->clear();
|
||||||
connect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
|
||||||
QHashIterator<key, val> i(*var);
|
QHashIterator<key, val> i(*var);
|
||||||
|
QMap<key, val> map;
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
i.next();
|
i.next();
|
||||||
QListWidgetItem *item = new QListWidgetItem(i.key());
|
map.insert(i.key(), i.value());
|
||||||
|
}
|
||||||
|
|
||||||
|
QMapIterator<key, val> iMap(map);
|
||||||
|
while (iMap.hasNext()) {
|
||||||
|
iMap.next();
|
||||||
|
QListWidgetItem *item = new QListWidgetItem(iMap.key());
|
||||||
item->setFont(QFont("Times", 12, QFont::Bold));
|
item->setFont(QFont("Times", 12, QFont::Bold));
|
||||||
listWidget->addItem(item);
|
listWidget->addItem(item);
|
||||||
}
|
}
|
||||||
listWidget->setCurrentRow (0);
|
listWidget->setCurrentRow (0);
|
||||||
|
connect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 DialogTool::getIdDetail() const{
|
qint64 DialogTool::getIdDetail() const{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user