i want to display output line c=5 in sam line edit. but m only getting 5 .

mainwindow.cpp
Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent) :
  5. QMainWindow(parent),
  6. ui(new Ui::MainWindow)
  7. {
  8. ui->setupUi(this);
  9. connect(ui->pushButton, SIGNAL(clicked()),this,SLOT(result()));
  10. }
  11.  
  12. void MainWindow::result()
  13. {
  14. int a=2;
  15. int b=3 ;
  16. int c= a+b;
  17. QString s="";
  18. ui->lineEdit->setText("c=");
  19. ui->lineEdit->setText(s.setNum(c));
  20.  
  21.  
  22. }
  23.  
  24. MainWindow::~MainWindow()
  25. {
  26. delete ui;
  27. }
To copy to clipboard, switch view to plain text mode