Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
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;
leon.anavi last edited by
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.
I have no clue what you are talking about. The information content is almost the same as in your inital post, zero. If you provide a small, compilable example that reproduces your problem we are possibly able to help you.
:( 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.
you boys, you surely know someone planned Qt Creator, so someone can help me to solve this issue. Heeelp!!
[quote author="Lukas Geyer" date="1327604205"]If you provide a small, compilable example that reproduces your problem we are possibly able to help you.[/quote]
"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).
i do want to say to you that you are saying something right. i wanted to plan in c++ but i just know few c. it is my fault. but...do not you think it is a great think i achived to plan in c++ without knowing perfectly c??? =D
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.