QLocale::setDefault(QLocale::C); d = QString("1234,56").toDouble(&ok); // ok == false d = QString("1234.56").toDouble(&ok); // ok == true, d == 1234.56 QLocale::setDefault(QLocale::German); d = QString("1234,56").toDouble(&ok); // ok == true, d == 1234.56 d = QString("1234.56").toDouble(&ok); // ok == true, d == 1234.56
class UIntTableWidgetItem: public QTableWidgetItem{protected: virtual bool operator < (const QTableWidgetItem & other) const { qint32 a = text().toInt(); qint32 b = other.text().toInt(); return a < b; }};