title: how to add qspaceritem to qgridlayout
body: <p>I have manualy created two groupboxes with many items. In one groupbox are more items than in the second and this is a layout problem. See picture:</p>
  
  <p><a href="https://i.stack.imgur.com/2Phbo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Phbo.png" alt="enter image description here"></a></p>
  
  <p>I test inserting vertical spacer in to "Analog" section, but with no success.</p>
  
  <p>Piece of code is:</p>
  
  <pre><code>...
  groupBox2Layout = new QGridLayout;
  groupBox2 = new QGroupBox();
  groupBox2-&gt;setTitle("Analog");
  for(int i=0; i&lt;=15; i++)
  {
      QSlider *horizontalSlider = new QSlider(Qt::Orientation::Horizontal);
      QComboBox *comboBox1 =  new QComboBox();
      comboBox1-&gt;addItems(analogPins);
      QLineEdit *lineEdit1 =  new QLineEdit("Slider " + QString::number(i));
      groupBox2Layout-&gt;addWidget(horizontalSlider, i, 0);
      groupBox2Layout-&gt;addWidget(comboBox1, i, 2);
      groupBox2Layout-&gt;addWidget(lineEdit1, i, 3);
  
      groupBox2-&gt;setLayout(groupBox2Layout);
  }
  
  groupBox2Spacer = new QSpacerItem(100,100, QSizePolicy::Expanding, QSizePolicy::Expanding);
  groupBox2Layout-&gt;
  ...
  </code></pre>
  
  <p>I tested </p>
  
  <p>groupBox2Layout->addItem(groupBox2Spacer); 
  with error:
  masim.cpp:60:22: error: 'addItem' is a protected member of 'QGridLayout'
  qgridlayout.h:123:10: note: declared protected here</p>
  
  <p>groupBox2Layout->addWidget(groupBox2Spacer);
  masim.cpp:60:22: error: no matching member function for call to 'addWidget'
  qgridlayout.h:102:17: note: candidate function not viable: no known conversion from 'QSpacerItem *' to 'QWidget *' for 1st argument
  qgridlayout.h:103:10: note: candidate function not viable: requires at least 3 arguments, but 1 was provided
  qgridlayout.h:104:10: note: candidate function not viable: requires at least 5 arguments, but 1 was provided</p>
  
  <p>Can't find another way how to add Spacer to the "Analog" groupbox... 
  Can you help me?</p>