I am trying to embed a simple "Hello World" text qml into a QMainWindow derived userdefined object.
In any possible idea that i tested, the text does not show up.

This is my object constructor code:
Qt Code:
  1. MainWindow::MainWindow() : QMainWindow ()
  2. {
  3. this->resize(1024, 768);
  4.  
  5. QWidget *topFiller = new QWidget;
  6. topFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  7.  
  8. QWidget *bottomFiller = new QWidget;
  9. bottomFiller->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
  10.  
  11. QVBoxLayout *layout = new QVBoxLayout;
  12.  
  13. layout->setMargin(5);
  14. layout->addWidget(topFiller);
  15. layout->addWidget(bottomFiller);
  16. this->setLayout(layout);
  17.  
  18. createActions();
  19. createMenus();
  20.  
  21. QQmlEngine engine(this);
  22. QQmlComponent component(&engine, QUrl::fromLocalFile("D:\\test.qml"),this);
To copy to clipboard, switch view to plain text mode 

This is my main app code:
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. MainWindow mw;
  5. mw.show();
  6.  
  7. return a.exec();
  8. }
To copy to clipboard, switch view to plain text mode 

This ist the QML file:
Qt Code:
  1. import QtQuick 2.0
  2.  
  3. Text {
  4. text: "Hello world!" //a basic greeting
  5. /*
  6.   We want this text to stand out from the rest so
  7.   we give it a large size and different font.
  8.   */
  9. font.family: "Helvetica"
  10. font.pointSize: 24
  11. }
To copy to clipboard, switch view to plain text mode