Application crash
-
application crashes on Nokia c5-03. please watch this video and say me where is the problem i should fix. please note that each new screen is a new QDeclarativeView *view;
-
The video is upside down and the image quality is poor. It would be better if you share source code.
-
ahahhaha sorry... http://youtu.be/eBwCn_ynlU8
-
Honestly, I appreciate that you've taken the time to create a video showing your problem - but what do you expect from "the application crashes, tell me how to fix"? The best advice one can give you with this information content is "fix the bug that causes the crash".
Please, either upload your project somewhere or pastebin relevant code - otherwise noone can help you, even if he would.
-
for each new class opened there is this code:
@
Class *clas = new Class();Class' constructor that extends QWidget:
QDeclarativeView* view = new QDeclarativeView(QUrl::fromLocalFile("qml/Werfer/prima.qml"), this);
@however each app i have planned has this problem.
-
:( so i will copy the whole constructor of the class and will delete the snippet when (i hope this will happen) the problem will be solved.
EDIT: look down
"view" is everytime declared in header as "QDeclarativeView* view;". each new class has one own of that pointer.
-
"007" is the password for http://www.mediafire.com/?3do2dt2jnltbtud (13MB)
note: this is not the program shown in video, but it crashes on c5-03 as the other app. -
Your application is most probably crashing because you are wasting memory wherever possible:
- almost all your variables are created on the heap, not on the stack; in addition, they get never deleted
- your widgets are closed instead of deleted, although they are not re-shown but just re-created when needed
- your classes derive from QWidget just to encase a QDeclarativeView, which is already a QWidget; in addition, both are shown, although the widget is empty
- you create one of those declarative-view-widgets for every QML file you show instead of using one QDeclarativeView which is responsible for showing all; besides that, none of them get deleted
Honestly, and please don't get me wrong on that, I would start with a good read on C++, followed by a good read on Qt and QML, especially QML/C++ interaction, Qt Components and a lot of examples and then re-create the application from scratch, because I see hardly anything that is worth refactoring (besides some QML).
-
You do not need to learn C to learn C++ (although it helps a lot). If you are new to both you can start learning C++ right away. If you just want to do a project using Qt Quick chances are high that you do not even need to learn C++, because you can do applications in pure QML and JavaScript.
But whatever way you go, you will have to learn something in any ways before you start developing, be it C++ or QML or both.
There are is ton of useful information here at the QDN, documentation, examples, tutorials - just dig right in. And if there are any problems don't hesitate to come back right here and ask.