title: Expanding a Qt Layout : how to put a widget on the right side and the let the other widget to fully fill the left?
body: <p>I want to put a widget on the right side of a QHBoxLayout, and the other spaces should expand the left side. I've set the widget's SizePolicy to Expanding, but it's not valid. Anyone could offer some help? Thanks.</p>
  
  <p>Code is here:</p>
  
  <pre><code>QHBoxLayout* tmplayout = new QHBoxLayout(this);
  tmplayout-&gt;setContentsMargins(0, 0, 0, 0);
  lineEdit-&gt;setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored);
  tmplayout-&gt;addWidget(lineEdit, 0, Qt::AlignRight);
  tmplayout-&gt;addWidget(pushButton, 0, Qt::AlignRight);
  </code></pre>
  
  <p>lineEdit should expand.</p>