Skip to content
Snippets Groups Projects
Commit 63400280 authored by SeeLook's avatar SeeLook :musical_note:
Browse files

[Android] Fixed crash after wizard

- seems like deleting QML context after wizard is too tricky on Android
- so use deleteLater()
- then keep HELP object live after wizard scope
- get rid of wizard fontSIze prop - use Noo.fontSize() instead
parent 93dae8fa
No related branches found
No related tags found
No related merge requests found
......@@ -142,9 +142,10 @@ int main(int argc, char *argv[])
e->rootContext()->setContextProperty(QStringLiteral("Noo"), nooObj);
e->rootContext()->setContextProperty(QStringLiteral("SOUND"), sound);
bool wasFirstRun = gl->isFirstRun;
TmainHelp* hlp = nullptr; // keep help object live after wizard, Qt deletes it with some delay
if (gl->isFirstRun) {
TmainHelp h;
e->rootContext()->setContextProperty(QStringLiteral("HELP"), &h);
hlp = new TmainHelp();
e->rootContext()->setContextProperty(QStringLiteral("HELP"), hlp);
nooObj->setQmlEngine(e);
e->load(QUrl(QStringLiteral("qrc:/wizard/Wizard.qml")));
if (firstLoop) {
......@@ -152,7 +153,8 @@ int main(int argc, char *argv[])
o << "\033[01;35m Nootka wizard launch time: " << startElapsed.nsecsElapsed() / 1000000.0 << " [ms]\033[01;00m\n";
}
exitCode = a->exec();
delete e;
e->deleteLater(); // Android crashes without a delayed destroy
qApp->quit();
e = new QQmlApplicationEngine;
e->rootContext()->setContextProperty(QStringLiteral("GLOB"), gl);
e->rootContext()->setContextProperty(QStringLiteral("Noo"), nooObj);
......@@ -204,6 +206,8 @@ int main(int argc, char *argv[])
firstLoop = false;
exitCode = a->exec();
if (hlp)
delete hlp;
delete e;
delete sound;
delete gl;
......
......@@ -23,8 +23,6 @@ ApplicationWindow {
property alias swipe: swipe
property alias labelColor: aboutPage.color
readonly property int fontSize: Noo.fontSize()
SystemPalette {
id: activPal
property color dimText: Qt.tint(activPal.base, Noo.alpha(activPal.text, 150))
......@@ -78,13 +76,13 @@ ApplicationWindow {
}
footer: Rectangle {
width: parent.width; height: prevBut.height + fontSize + 2
color: Qt.tint(activPal.window, Noo.alpha(aboutPage.color, 50)) // Qt.darker(activPal.window, 0.9)
Rectangle { color: aboutPage.color; height: fontSize / 6; width: parent.width; anchors.top: parent.top }
width: parent.width; height: prevBut.height + Noo.fontSize() + 2
color: Qt.tint(activPal.window, Noo.alpha(aboutPage.color, 50))
Rectangle { color: aboutPage.color; height: Noo.fontSize() / 6; width: parent.width; anchors.top: parent.top }
Row {
x: (parent.width - width - 8 * fontSize) / 2
x: (parent.width - width - 8 * Noo.fontSize()) / 2
anchors.verticalCenter: parent.verticalCenter
spacing: fontSize * 2
spacing: Noo.fontSize() * 2
TcuteButton {
id: prevBut
anchors.verticalCenter: parent.verticalCenter
......@@ -117,7 +115,7 @@ ApplicationWindow {
}
TcuteButton {
anchors.verticalCenter: parent.verticalCenter
x: parent.width - width - fontSize
x: parent.width - width - Noo.fontSize()
text: Noo.TR("QWizard", "&Finish").replace("&", "")
onClicked: nootkaWindow.close()
Shortcut { sequence: "Return"; onActivated: nootkaWindow.close() }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment