Full support for other units, add configuration option for default unit (used when displaying amounts)

This commit is contained in:
Wladimir J. van der Laan
2011-07-29 14:36:35 +02:00
parent b5b1d1a66b
commit ee014e5b10
19 changed files with 152 additions and 34 deletions

27
src/qt/qvaluecombobox.cpp Normal file
View File

@@ -0,0 +1,27 @@
#include "qvaluecombobox.h"
QValueComboBox::QValueComboBox(QWidget *parent) :
QComboBox(parent), role(Qt::UserRole)
{
connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int)));
}
int QValueComboBox::value() const
{
return itemData(currentIndex(), role).toInt();
}
void QValueComboBox::setValue(int value)
{
setCurrentIndex(findData(value, role));
}
void QValueComboBox::setRole(int role)
{
this->role = role;
}
void QValueComboBox::handleSelectionChanged(int idx)
{
emit valueChanged();
}