title: Minimum size/width of a QPushButton that is created from code
body: <p>I created 2 rows of push buttons, each row is inside a QHBoxLayout. 
  <img src="https://i.stack.imgur.com/pmHOf.png" alt="enter image description here"></p>
  
  <p>I create the buttons in the code:</p>
  
  <pre><code>static const char* buttonText = "23456789TJQKA";
  for (int ii = 0; buttonText[ii]; ii++)
  {
      QPushButton* pushButton = new QPushButton(this);
      pushButton-&gt;setText(QString(buttonText[ii]));
      ui-&gt;horizontalLayout_1-&gt;addWidget(pushButton);
  }
  for (int ii = 0; buttonText[ii]; ii++)
  {
      QPushButton* pushButton = new QPushButton(this);
      pushButton-&gt;setText(QString(buttonText[ii]));
      ui-&gt;horizontalLayout_2-&gt;addWidget(pushButton);
  }
  </code></pre>
  
  <p>The problem is that they can't shrink (when the user resizes the dialog) beyond that size, even though their text would fit in a much smaller width. If I create the buttons manually in the resource editor instead of in the code, they can have smaller width than that.</p>