I have project on QML 2 (Qt 5.2.1). It seems works fine.
But when I close running project (ALT+F4, or whatever) in Qt Creator's "Application Output" (that thing at the bottom), after 1-2 sec, I get the following message:
The program has unexpectedly finished.
bla-bla-bla.exe crashed
This happens in release and debug modes. I Launched under debug, but not got any errors. I follow step-by-step from my last destructor till the very return app.exec();, which return 1.
I mean except this - I don't see any errors. Should I worry about this? Can I know a reason for this message? Is there a way to get more specific message?
I tried to launch application from cmd, but not get any errors. My main.cpp:
#include <QtGui/QGuiApplication>
#include "qtquick2applicationviewer.h"
#include "painter.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
qmlRegisterType<Painter>("MyCanvas", 1, 0, "MyCanvas");
QtQuick2ApplicationViewer viewer;
viewer.setMainQmlFile(QStringLiteral("qml/test_painteditem/main.qml"));
viewer.showExpanded();
return app.exec();
}
Main.qml:
import QtQuick 2.0
import MyCanvas 1.0
Rectangle {
width: 360
height: 360
color: "white";
focus: true;
Keys.onLeftPressed: {
mc.frame--;
mc.update();
}
Keys.onRightPressed: {
mc.frame++;
mc.update();
}
Keys.onPressed: {
if (event.key === Qt.Key_C){
mc.switchCurve();
}else if (event.key === Qt.Key_O){
mc.switchCurveOffset();
}
}
MouseArea {
anchors.fill: parent
onClicked: {
// mc.x += 10;
//mc.update();
if (!tim.running){
tim.start();
} else {
tim.stop();
}
}
onWheel: {
if (wheel.angleDelta.y > 0)
mc.zoomIn();
else
mc.zoomOut();
}
onPressed: {
}
}
Timer {
id:tim
interval: 1; running: false; repeat: true
onTriggered: {
mc.frame++;
mc.update();
}
}
MyCanvas {
id:mc;
x:0;
y:0;
width:1000; /** 2000x2000 not supported in Android */
height:1000;
}
}
execis called the Qt part of your program start. Set some breakpoint and try to localize the point in which crashes. - Jepessen