Hello,

I'm adding a QCheckBox to a QLayout. The QWidget in which the QLayout resides is not being displayed under Windows 7. It is shown in the taskbar and I can maximize it from there thus making it display but it is not displayed as a regular window. No matter what I tried to get the QCheckBox into the QLayout.
Here's the code:
Qt Code:
  1. private:
  2. QSize size;
  3. QBoxLayout* boxLayout;
  4. QFormLayout* formLayout;
  5. QLabel* label;
  6. QDoubleSpinBox* doubleSpinBox;
  7. QLabel* label_2;
  8. QDoubleSpinBox* doubleSpinBox_2;
  9. QLabel* label_3;
  10. QDoubleSpinBox* doubleSpinBox_3;
  11. QLabel* label_4;
  12. QDoubleSpinBox* doubleSpinBox_4;
  13. QLabel* label_5;
  14. QCheckBox* checkBox;
To copy to clipboard, switch view to plain text mode 
Declared inside X.h
Qt Code:
  1. X::X() : size(202,157)
  2. {
  3. boxLayout = new QBoxLayout(QBoxLayout::TopToBottom, this);
  4. formLayout = new QFormLayout();
  5. label = new QLabel("a");
  6. doubleSpinBox = new QDoubleSpinBox(this);
  7. doubleSpinBox->setDecimals(3);
  8. doubleSpinBox->setMaximum(1);
  9. doubleSpinBox->setSingleStep(0.001);
  10. formLayout->addRow(label, doubleSpinBox);
  11. label_2 = new QLabel("a");
  12. doubleSpinBox_2 = new QDoubleSpinBox();
  13. doubleSpinBox_2->setDecimals(3);
  14. doubleSpinBox_2->setMaximum(1);
  15. doubleSpinBox_2->setSingleStep(0.001);
  16. formLayout->addRow(label_2, doubleSpinBox_2);
  17. label_3 = new QLabel("a");
  18. doubleSpinBox_3 = new QDoubleSpinBox();
  19. doubleSpinBox_3->setDecimals(3);
  20. doubleSpinBox_3->setMaximum(1);
  21. doubleSpinBox_3->setSingleStep(0.001);
  22. formLayout->addRow(label_3, doubleSpinBox_3);
  23. label_4 = new QLabel("a");
  24. doubleSpinBox_4 = new QDoubleSpinBox();
  25. doubleSpinBox_4->setDecimals(3);
  26. doubleSpinBox_4->setMaximum(1);
  27. doubleSpinBox_4->setSingleStep(0.001);
  28. formLayout->addRow(label_4, doubleSpinBox_4);
  29. boxLayout->addLayout(formLayout);
  30. checkBox = new QCheckBox("a");
  31. //boxLayout->addWidget(checkBox); // enabling this line makes the QWidget X not display
  32. }
To copy to clipboard, switch view to plain text mode 

I tried adding a label and the QCheckBox to the QFormLayout and didn't have the QBoxLayout but it didn't work. I thought it's perhaps the QFormLayout only accepting "input QWidgets" and QCheckBox isn't defined as an "input QWidget" according to QDesigner, thus I switched to a QBoxLayout containing a QFormLayout and a QCheckBox to no avail.

Help!

Lars