This commit is contained in:
tobtoht
2023-12-04 20:47:19 +01:00
parent 14712341e7
commit db0c8d66da
96 changed files with 3060 additions and 725 deletions
+16 -1
View File
@@ -445,7 +445,7 @@ QString amountToCurrencyString(double amount, const QString &currencyCode) {
if (currencyCode == "USD")
return locale.toCurrencyString(amount, "$").remove("\xC2\xA0");
return locale.toCurrencyString(amount).remove("\xC2\xA0");
return QString("%1%2").arg(locale.currencySymbol(), QString::number(amount, 'f', 2));
}
QStandardItem *qStandardItem(const QString& text) {
@@ -693,4 +693,19 @@ QWindow *windowForQObject(QObject* object) {
}
return nullptr;
}
void clearLayout(QLayout* layout, bool deleteWidgets)
{
while (QLayoutItem *item = layout->takeAt(0)) {
if (deleteWidgets) {
if (QWidget *widget = item->widget()) {
widget->deleteLater();
}
}
if (QLayout *childLayout = item->layout()) {
clearLayout(childLayout, deleteWidgets);
}
delete item;
}
}
}