[Solved] [Moved] cannot declare QDeclarativeView into stack
why must i declare QDeclarativeView so?
- {
- QDeclarativeView *view = new QDeclarativeView(QUrl::fromLocalFile("qml/Werfer/FliegendeLieder/musica1.qml"), this);
- ... }
and not so:
6 replies
You post is just a fragment and does not allow a full explanation.
However, I would assume that you like to use “view” after you have exited the constructor. In the second case it is gone when you leave the contructor. The first is at least still in memory. If you do not handle it somewhere else, you have possibly created a memory leak.
- {
- connect(b, SIGNAL(signal_musicarequest()), this, SLOT(open_musica2()));
- connect(b, SIGNAL(request_close()), this, SLOT(close()));
- view->show();
- this->showFullScreen();
- }
and i need to use view on methods. in fact, i declared view as a QDeclarativeView’ pointer in the header. so, can i declare QDeclarativeView view in the header and inizialize it in the cpp file as a not-pointer? if not, how to do?
You must log in to post a reply. Not a member yet? Register here!




