totalswidget.cpp 557 B

1234567891011121314151617181920212223
  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. for (const auto &field : data) {
  14. auto line_edit = parent->findChild<QLineEdit *>(field.first + "LineEdit");
  15. line_edit->setText(field.second);
  16. }
  17. }
  18. TotalsWidget::~TotalsWidget()
  19. {
  20. delete ui;
  21. }