I am wanting to neaten up my classes, and need some advise how to proceed.
Currently in my main file I have

Qt Code:
  1. {
  2. QApplication app(argc, argv);
  3. Client client;
  4. client.show();
  5. return client.exec();
  6. }
To copy to clipboard, switch view to plain text mode 

In my Client constructor I have

Qt Code:
  1. QGridLayout *mainLayout = new QGridLayout;
  2. mainLayout->addWidget(inputOptionsGroup(), 1, 0, 1, 2);
  3. mainLayout->addWidget(resultsGroup(), 2, 0, 1, 2);
  4. setLayout(mainLayout);
To copy to clipboard, switch view to plain text mode 

and then in resultsGroup (similar to inputOptionsGroup)

Qt Code:
  1. QGroupBox *Client::resultsGroup()
  2. {
  3. eccentricityLabel = new QLabel(tr("<b>Eccentricity</b>"));
  4. diameterLabel = new QLabel(tr("<b>Diameter</b>"));
  5. eccentricityLineEdit = new QLineEdit("0");
  6. eccentricityLineEdit->setReadOnly(true);
  7. diameterLineEdit = new QLineEdit("0");
  8. diameterLineEdit->setReadOnly(true);
  9. connectionStateLabel = new QLabel("<font color='red'><b>State : Not connected to camera</b></font>");
  10. dbConnectionLabel = new QLabel("<font color='purple'><b>Connecting to MySQL DB...</b></font>");
  11. countLabelPass = new QLabel("<font color='green'><b>Pass : 0</b></font>");
  12. countLabelFail = new QLabel("<font color='red'><b>Fail (Con/Dia/Total) : 0/0/0</b></font>");
  13.  
  14. queryLineEdit = new QLineEdit;
  15.  
  16. QGridLayout *vbox = new QGridLayout;
  17. vbox->addWidget(eccentricityLabel, 0, 0, 1, 1);
  18. vbox->addWidget(eccentricityLineEdit, 0, 1, 1, 1);
  19. vbox->addWidget(diameterLabel, 1, 0, 1, 1);
  20. vbox->addWidget(diameterLineEdit, 1, 1, 1, 1);
  21. vbox->addWidget(connectionStateLabel, 2, 0, 1, 2);
  22. vbox->addWidget(dbConnectionLabel, 3, 0, 1, 2);
  23. vbox->addWidget(queryLineEdit, 4, 0, 1, 2);
  24. vbox->addWidget(countLabelPass,5, 0, 1, 2);
  25. vbox->addWidget(countLabelFail,6, 0, 1, 2);
  26.  
  27. QGroupBox *groupBox = new QGroupBox(tr("Results"));
  28. groupBox->setLayout(vbox);
  29.  
  30. return groupBox;
  31. }
To copy to clipboard, switch view to plain text mode 

Essentially I am splitting up the various pieces of the GUI setup into separate functions. I would instead like to move the whole GUI setup to a separate class. I know this is probably simple to some, but I don't know how to do it, and I have been searching.

My fear is that I am going to fall into problems trying to access various components on the GUI, but I would assumedly get round this using slots/signals.

Thanks.