totalswidget.cpp 584 B

123456789101112131415161718192021222324
  1. #include "totalswidget.h"
  2. #include "ui_totalswidget.h"
  3. // Debug Makro
  4. #define DEB(expr) \
  5. qDebug() << __PRETTY_FUNCTION__ << "\t" << expr
  6. TotalsWidget::TotalsWidget(QWidget *parent) :
  7. QWidget(parent),
  8. ui(new Ui::TotalsWidget)
  9. {
  10. ui->setupUi(this);
  11. auto data = Stat::totals();
  12. DEB("Filling Totals Line Edits...");
  13. DEB("data: " << data);
  14. for (const auto &field : data) {
  15. auto line_edit = parent->findChild<QLineEdit *>(field.first + "LineEdit");
  16. line_edit->setText(field.second);
  17. }
  18. }
  19. TotalsWidget::~TotalsWidget()
  20. {
  21. delete ui;
  22. }