Advertisement
sakuya-inu-izayoi

widget.cpp

Jun 15th, 2015
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include "widget.h"
  2. #include "ui_widget.h"
  3.  
  4. Widget::Widget(QWidget *parent) :
  5.     QWidget(parent),
  6.     ui(new Ui::Widget)
  7. {
  8.     ui->setupUi(this);
  9. }
  10.  
  11. Widget::~Widget()
  12. {
  13.     delete ui;
  14. }
  15.  
  16. void Widget::updateBaseNotation(QString input)
  17. {
  18.     if(buffer != input)
  19.     {
  20.         buffer = input;
  21.         ui->leInput->setText(buffer);
  22.         emit inputChanged(buffer);
  23.     }
  24.     bool correct;
  25.     int data = input.toInt(&correct);
  26.  
  27.     if(correct)
  28.     {
  29.         ui->leB2->setText(QString("%1").arg(data,0,2));
  30.         ui->leB3->setText(QString("%1").arg(data,0,3));
  31.         ui->leCustom->setText(QString("%1").arg(data,0,ui->sBase->value()));
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement