Hello all,

I'm trying to understand how the following code that got generated in ui_mainwindow.h file. Can someone please help me understand how it's achieved. I'm trying to build similar application and I'm using qt4.x with c++. Thanks in advance.

Qt Code:
  1. class Ui_MainWindow
  2. {
  3. public:
  4. QLineEdit *filename_input;
  5. QLabel *current_logfile_label;
  6. ...
  7.  
  8. void setupUi(QMainWindow *MainWindow)
  9. {
  10. filename_input = new QLineEdit(centralWidget);
  11. filename_input->setObjectName(QString::fromUtf8("filename_input"));
  12. filename_input->setGeometry(QRect(20, 390, 291, 31));
  13. current_logfile_label = new QLabel(centralWidget);
  14. current_logfile_label->setObjectName(QString::fromUtf8("current_logfile_label"));
  15. current_logfile_label->setGeometry(QRect(20, 455, 421, 21));
  16.  
  17. ...
  18. }
To copy to clipboard, switch view to plain text mode 

I have the following code snippet for LineEdit and check box, in mainwindow.cpp file

Qt Code:
  1. void MainWindow::on_filename_input_editingFinished()
  2. {
  3. file_increment=0;
  4. QString text;
  5. text=ui->filename_input->text();
  6.  
  7. QString s = QString::number(file_increment);
  8.  
  9. filename = "/logs/" + QString(text) + "_" + s + ".csv";
  10.  
  11. ui->current_logfile_label->setText(filename);
  12.  
  13. }
  14.  
  15. void MainWindow::on_logging_clicked(bool checked)
  16. {
  17. logging_flag=checked;
  18. if(logging_flag)
  19. {
  20. file_increment++;
  21. }
  22. QString text;
  23. text=ui->filename_input->text();
  24.  
  25. QString s = QString::number(file_increment);
  26.  
  27. filename = "/logs/" + QString(text) + "_" + s + ".csv";
  28. ui->current_logfile_label->setText(filename);
  29. }
To copy to clipboard, switch view to plain text mode