So I have a simple class with one variable called param1, constructor, and two functions to set/get that parameter:

So here are the sources of ctester.h and ctester.cpp
Qt Code:
  1. #ifndef CTESTER_H
  2. #define CTESTER_H
  3.  
  4.  
  5. class CTester {
  6.  
  7. public:
  8. CTester(); // constructor
  9. void SetParam1(int value);
  10. int GetParam1(void);
  11.  
  12. private:
  13. int param1;
  14.  
  15. };
  16.  
  17. #endif // CTESTER_H
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. CTester::CTester(void)
  2. {
  3. // initializing all the parameters
  4. param1 = 0;
  5. }
  6.  
  7. void CTester::SetParam1(int value)
  8. {
  9. param1 = value;
  10. }
  11.  
  12. int CTester::GetParam1(void)
  13. {
  14. return param1;
  15. }
To copy to clipboard, switch view to plain text mode 

My main.cpp and mainwindow.cpp files are rather simple, since I just started a QMainWindow application in QtCreator:
Qt Code:
  1. #include "mainwindow.h"
  2. #include <QApplication>
  3.  
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication a(argc, argv);
  8. MainWindow w;
  9. w.show();
  10.  
  11. return a.exec();
  12. }
To copy to clipboard, switch view to plain text mode 

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. }
  10.  
  11. MainWindow::~MainWindow()
  12. {
  13. delete ui;
  14. }
To copy to clipboard, switch view to plain text mode 

What I am not quite sure is, what is the most proper way of getting/setting that param1 variable in my class through that MainWindow form?
The search on QtCentre gives tons of similar threads BUT about sharing data between dialogs or dialogs and main window, but I did not see any description in docs or the forum threads about reading/writing to own class.

In other words, I have my Qt GUI interface, but what I want to achieve now is create now personal c++ class which is "tied" to that GUI and updated by it. I do have two buttons on the MainWindow form, Set and get, and the editbox for setting the value and label for showing the value of param1 when get button is clicked.

Keep in mind that I want to keep ctester.h and ctester.cpp as c++ source files only, i.e. no Qt related macros/keywords there.

Now, does it mean that I need another "intermediate" wrapper class for this mechanism to work? Or there is a better, more elegant approach to achieve what I just described?