Can't seem to get widgets in a layout spaced the way I want.
Qt Code:
  1. // panel_1 class
  2. int w = 50;
  3. int h = 100;
  4.  
  5. pbStart = new QPushButton("Start");
  6. QHBoxLayout *layout_1 = new QHBoxLayout(this);
  7. layout_1->setSpacing(0);
  8.  
  9. layout_1->addWidget(pbStart);
  10.  
  11. lineEdit1 = new QLineEdit(this);
  12. lineEdit2 = new QLineEdit(this);
  13. lineEdit3 = new QLineEdit(this);
  14.  
  15. lineEdit1->setFixedSize(w, h);
  16. lineEdit2->setFixedSize(w, h);
  17. lineEdit3->setFixedSize(w, h);
  18.  
  19. layout_1->addWidget(lineEdit1);
  20. layout_1->addWidget(lineEdit2);
  21. layout_1->addWidget(lineEdit3);
  22.  
  23. // mainwindow class
  24. QWidget *widget = new QWidget(this);
  25. QVBoxLayout *layout = new QVBoxLayout;
  26. layout->setSpacing(1);
  27.  
  28. panel_1 = new Panel_1();
  29. layout->addWidget(panel_1);
  30. layout->addWidget(d_.view);
  31.  
  32. widget->setLayout(layout);
  33. setCentralWidget(widget);
To copy to clipboard, switch view to plain text mode 
The space between the pb and the line edits and between the edits is constant - about 2"
Checking spacing() with debug, it reports 0.

What am I doing wrong that's not letting me set the spacing to what I need?
Thanks for any help.