Hi all,

I'm a newbie in QT. I've developed a project in vim. Now I want to display what I used to display in a terminal in a user-friendly way in a GUI.
Simply, I have a set of variables which I need to display in labels in the GUI. I also have couple of variables, whose values should control what should be displayed in the labels.
I knew that the best way to do this is using signals and slots, right?
Unfortunately, most of the signals and slots examples describe how to connect a slider with a progress bar, or a button with a label. But I need to know how to display a variable in my main project in a GUI?
Following is a sample code I can run successfully, and I want to display the variable distance in a label.

Qt Code:
  1. #include <QApplication>
  2. #include "mainwindow.h"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. int distance = 4;
  7. distance++;
  8.  
  9. QApplication a(argc, argv);
  10. MainWindow w;
  11. w.setName("Guided");
  12. w.show();
  13.  
  14. return a.exec();
  15. }
To copy to clipboard, switch view to plain text mode 

Thanks