Hi

I am trying to create a wizard for my application which will create a new file with specific details filled in. I stored all variables in registerField with a diffrenet name, i can access the values from a spin box later in the wizard but cannot access any values from the QLineEdit boxes. Any help would be greatly appreciated. the code is inserted below.

Qt Code:
  1. tabNamePage::tabNamePage(QWidget *parent) : QWizardPage(parent)
  2. {
  3. setTitle(tr("Tab Selection"));
  4. setSubTitle(tr("Please choose how many tabs "
  5. "and specify the names of each."));
  6.  
  7. Qt::Alignment Left = Qt::AlignLeft;
  8.  
  9. numberTabLabel = new QLabel(tr("Number of tabs:"));
  10. numberTabLabel->setMaximumWidth(100);
  11.  
  12. numberTabSpin = new QSpinBox;
  13. numberTabSpin->setFixedWidth(50);
  14. numberTabSpin->setMinimum(1);
  15. numberTabSpin->setMaximum(10);
  16.  
  17. tab1 = new QLineEdit;
  18. tab1->setVisible(true);
  19. tab1->setText("Tab 1");
  20. tab1->setFixedWidth(220);
  21. ...
  22. registerField("Number of tabs", numberTabSpin);
  23. registerField("tab1", tab1);
  24. registerField("Name of tab 2", tab2);
  25. registerField("Name of tab 3", tab3);
  26. registerField("Name of tab 4", tab4);
  27. registerField("Name of tab 5", tab5);
  28. registerField("Name of tab 6", tab6);
  29. registerField("Name of tab 7", tab7);
  30. registerField("Name of tab 8", tab8);
  31. registerField("Name of tab 9", tab9);
  32. registerField("Name of tab 10", tab10);
  33.  
  34. QHBoxLayout *Hlayout = new QHBoxLayout;
  35. Hlayout->addWidget(numberTabLabel);
  36. Hlayout->addWidget(numberTabSpin);
  37. Hlayout->setAlignment(Left);
  38.  
  39. QHBoxLayout *tab1Hlayout = new QHBoxLayout;
  40. tab1Hlayout->addWidget(tab1);
  41. tab1Hlayout->addWidget(tab2);
  42. tab1Hlayout->setAlignment(Left);
  43.  
  44. ...
  45.  
  46. Vlayout = new QVBoxLayout;
  47. Vlayout->addLayout(Hlayout);
  48. Vlayout->addLayout(tab1Hlayout);
  49. Vlayout->addLayout(tab2Hlayout);
  50. Vlayout->addLayout(tab3Hlayout);
  51. Vlayout->addLayout(tab4Hlayout);
  52. Vlayout->addLayout(tab5Hlayout);
  53. setLayout(Vlayout);
  54.  
  55. connect(numberTabSpin, SIGNAL(valueChanged(int)),this, SLOT(filltabnameboxes(int)));
  56. }
  57.  
  58.  
  59. whichVariablesPage1::whichVariablesPage1(QWidget *parent) : QWizardPage(parent)
  60. {
  61. QString tab1 = field("tab1").toString();
  62.  
  63. //QString title ="Variables Selection for ";
  64. setTitle(tab1);
  65. setSubTitle(tr("Specify which Variables you would like to include."));
  66.  
  67. QHBoxLayout *tab5Hlayout = new QHBoxLayout;
  68. QLabel *tab2 = new QLabel(tab1);
  69. tab5Hlayout->addWidget(tab2);
  70. setLayout(tab5Hlayout);
  71.  
  72. }
  73.  
  74. int whichVariablesPage1::nextId() const
  75. {
  76. int tabs = field("Number of tabs").toInt();
  77. if(tabs > 1)
  78. {
  79. return newWizard::Page_whichVariable2;
  80. } else {
  81. return newWizard::Page_conclusion;
  82. }
  83. }
To copy to clipboard, switch view to plain text mode 

Thanks

James