I have been trying to get a GUI to display inside Qt 3.3.7 and I have designed it off other classes I have successfully created. But for some reason all I see in this QDialog is the very first item I add to the layout. Here is my code for the constructor and the createGui function. Sorry if there is a typo as my coding machine is not hooked up online so I have to retype all my code to show on here. Thanks for your help!

Qt Code:
  1. ScreeningDialog::ScreeningDialog( Configuration *conf, QWidget *parent ) : QDialog( parent )
  2. {
  3. createGui( );
  4. mpConfiguration = config;
  5. mScreeningLocation = mpConfiguration->getScreeningExe( );
  6.  
  7. setPalette( parent->palette( ) );
  8. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void ScreeningDialog::createGui( )
  2. {
  3. QWidget *mainWidget = new QWidget( this );
  4. QGridLayout = new QGridLayout( mainWidget );
  5.  
  6. QLabel *outputDirLabel = new QLabel( tr( "Output Directory:" ), mainWidget );
  7. mpOutputDirLnEd = new QLineEdit( mainWidget );
  8. QPushButton *outputButton = new QPushButton( tr( "Open" ), mainWidget );
  9. connect( outputButton, SIGNAL( clicked( ) ), this, SLOT( openDirPressed( ) ) );
  10.  
  11. QLabel *confFileLabel = new QLabel( tr( "Configuration File:" ), mainWidget );
  12. mpConfFileLnEd = new QLineEdit( mainWidget );
  13. QPushButton *confButton = new QPushButton( tr( "Open" ), mainWidget );
  14. connect( confButton, SIGNAL( clicked( ) ), this, SLOT( openFilePressed( ) ) );
  15.  
  16. QGroupBox *methodBox = new QGroupBox( tr( "Method" ), mainWidget );
  17. QVBoxLayout *methodLayout = new QVBoxLayout( methodBox );
  18. QButtonGroup *methodGroup = new QButtonGroup( );
  19. methodGroup->setExclusive( true );
  20. mpWidthCB = new QCheckBox( tr( "Width" ), methodBox );
  21. mpAutoCB = new QCheckBox( tr( "Auto" ), methodBox );
  22.  
  23. methodGroup->insert( mpWidthCB );
  24. methodGroup->insert( mpAutoCB );
  25.  
  26. methodLayout->addWidget( mpWidthCB );
  27. methodLayout->addWidget( mpAutoCB );
  28.  
  29. QPushButton *executeButton = new QPushButton( tr( "Execute" ), mainWidget );
  30. connect( executeButton, SIGNAL( clicked( ) ), this, SLOT( executePressed( ) ) );
  31. QPushButton *cancelButton = new QPushButton( tr( "Cancel" ), mainWidget );
  32. connect( cancelButton, SIGNAL( clicked( ) ), this, SLOT( cancelPressed( ) ) );
  33.  
  34. mainLayout->addWidget( outputDirLabel, 0, 0 );
  35. mainLayout->addWidget( mpOutputDirLnEd, 0, 1 );
  36. mainLayout->addWidget( outputButton, 0, 2 );
  37. mainLayout->addWidget( confFileLabel, 1, 0 );
  38. mainLayout->addWidget( mpConfFileLnEd, 1, 1 );
  39. mainLayout->addWidget( confButton, 1, 2 );
  40. mainLayout->addWidget( methodBox, 2, 0 );
  41. mainLayout->addWidget( executeButton, 3, 1 );
  42. mainLayout->addWidget( cancelButton, 3, 2 );
  43. }
To copy to clipboard, switch view to plain text mode 

I cannot figure why the only thing I see when I open the dialog is the label that says "Output Directory:". Thanks for all your help with getting my dialog to display correctly!