title: QML widgets in QWidget
body: <p>I've a QWidget and I've some Simples Controlls like Button, ProgressBar, TextEdit etc.. done in QML which I am taking from QML Examples. I was reading <a href="http://doc.qt.io/archives/qt-4.7/qtbinding.html" rel="nofollow noreferrer">http://doc.qt.io/archives/qt-4.7/qtbinding.html</a> and <a href="http://doc.qt.io/archives/qt-4.7/qml-integration.html" rel="nofollow noreferrer">http://doc.qt.io/archives/qt-4.7/qml-integration.html</a> 
  at the moment I am trying QDeclarativeView.</p>
  
  <pre><code>setAttribute(Qt::WA_TranslucentBackground);
  layout = new QVBoxLayout(this);
  QDeclarativeView* btnView = new QDeclarativeView;
  btnView-&gt;setSource(QUrl::fromLocalFile("Button.qml"));
  QObject* btnObj = btnView-&gt;rootObject();
  btnObj-&gt;setProperty("width", 140);
  btnObj-&gt;setProperty("height", 32);
  btnObj-&gt;setProperty("text", "Close");
  //progressBar = new QProgressBar(this);
  button = new QPushButton("Click", this);
  //layout-&gt;addWidget(progressBar);
  layout-&gt;addWidget(button);
  btnView-&gt;setGeometry(0, 0, 140, 32);
  btnView-&gt;setBaseSize(140, 32);
  layout-&gt;addWidget(btnView);
  setLayout(layout);
  </code></pre>
  
  <p><img src="https://i.imgur.com/3m0Ik.png" alt="Screenshot">
  Why my btnView is taking this lot of Space ? and also is it (QDeclarativeView) a Good way of doing ? or there exists an even better solution ?</p>
  
  <p>When using  QDeclarativeComponent I get an QObject. But not a QWidget . and is this even a Good solution ? Whats the Best Solution to have lucrative Simple Widgets in Traditional QWidget ?</p>