totalswidget.cpp 790 B

12345678910111213141516171819202122232425262728
  1. #include "totalswidget.h"
  2. #include "ui_totalswidget.h"
  3. #include "src/testing/adebug.h"
  4. TotalsWidget::TotalsWidget(QWidget *parent) :
  5. QWidget(parent),
  6. ui(new Ui::TotalsWidget)
  7. {
  8. ui->setupUi(this);
  9. auto data = AStat::totals();
  10. DEB("Filling Totals Line Edits...");
  11. //DEB("data: " << data);
  12. for (const auto &field : data) {
  13. auto line_edit = parent->findChild<QLineEdit *>(field.first + "LineEdit");
  14. line_edit->setText(field.second);
  15. }
  16. QSettings settings;
  17. QString name = settings.value("userdata/picfirstname").toString();
  18. if(!name.isEmpty()) {
  19. QString salutation = "Welcome to openPilotLog, " + name + QLatin1Char('!');
  20. ui->welcomeLabel->setText(salutation);
  21. }
  22. }
  23. TotalsWidget::~TotalsWidget()
  24. {
  25. delete ui;
  26. }