Quote Originally Posted by viulskiez View Post
The source code doesn't clear because you do not use new operator to instantiate the object, but you try to destroy using delete operator.
Yes, it's my mistake. The source should be:

Qt Code:
  1. MainWindow::MainWindow()
  2. {
  3. m_pView = new QDeclarativeView(); // CONSTRUCT NEW QtDeclarativeView
  4. m_pView->setSource("qrc:/UI/main.qml");
  5.  
  6. setCentralWidget(m_pView);
  7. setFocus();
  8. centralWidget()->setFocus();
  9. }
To copy to clipboard, switch view to plain text mode 

But I can't not delete QDeclarativeView* after using new operator.
It's ok to continue the program without delete, but it can lead to memory leaking. How to avoid it