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.
#include <QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
int distance = 4;
distance++;
MainWindow w;
w.setName("Guided");
w.show();
return a.exec();
}
#include <QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
int distance = 4;
distance++;
QApplication a(argc, argv);
MainWindow w;
w.setName("Guided");
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Thanks
Bookmarks