Reply
Thread Tools
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#1
At my desktop in x11 when closing my app with the window button the aboutToQuit signal is called ... but in the Sailfish emulator it's not. Anyone else noticed this? The qml Component.onDestruction signal doesn't seem to work either, on desktop or emulator. Shouldn't aboutToQuit be called when closing app with the Sailfish UX? This could be a Wayland related problem but hopefully it's fixable.
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).
 

The Following User Says Thank You to xerxes2 For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#2
Originally Posted by xerxes2 View Post
At my desktop in x11 when closing my app with the window button the aboutToQuit signal is called ... but in the Sailfish emulator it's not. Anyone else noticed this? The qml Component.onDestruction signal doesn't seem to work either, on desktop or emulator. Shouldn't aboutToQuit be called when closing app with the Sailfish UX? This could be a Wayland related problem but hopefully it's fixable.
It's a bug. If you use Item instead of ApplicationWindow it works. Otherwise it's aborted. Look here: https://lists.sailfishos.org/piperma...er/000723.html
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following 2 Users Say Thank You to marmistrz For This Useful Post:
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#3
Hmm ok, and thanks for the fast answer. So I just wait until it's fixed then ... and hopefully the aboutToQuit signal too.

Edit: Or maybe you were talking about aboutToQuit because that one works with Item.
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).

Last edited by xerxes2; 2013-10-14 at 14:28.
 

The Following User Says Thank You to xerxes2 For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#4
Originally Posted by xerxes2 View Post
Hmm ok, and thanks for the fast answer. So I just wait until it's fixed then ... and hopefully the aboutToQuit signal too.

Edit: Or maybe you were talking about aboutToQuit because that one works with Item.
I was talking about Component.onDestruction
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following 2 Users Say Thank You to marmistrz For This Useful Post:
pycage's Avatar
Posts: 3,404 | Thanked: 4,474 times | Joined on Oct 2005 @ Germany
#5
On the C++ side, you could install an event filter with "installEventFilter" on the QQuickView and look for the close event.

Code:
bool MyClass::eventFilter(QObject* obj, QEvent* ev)
{
    if (obj == myView && ev->type() == QEvent::Close)
    {
        // do something...
    }
    return QObject::eventFilter(obj, ev);
}
__________________
Tidings - RSS and Podcast aggregator for Jolla - https://github.com/pycage/tidings
Cargo Dock - file/cloud manager for Jolla - https://github.com/pycage/cargodock
 

The Following 2 Users Say Thank You to pycage For This Useful Post:
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#6
I use python but I've not tried it like that. Even if it works, shouldn't the aboutToQuit signal work when closing from the Sailfish UX?

http://qt-project.org/doc/qt-5.1/qtc...ml#aboutToQuit

"This signal is emitted when the application is about to quit the main event loop, e.g. when the event loop level drops to zero. This may happen either after a call to quit() from inside the application or when the users shuts down the entire desktop session."

Or if the user closes the app from the window/UX.

Edit: I got aboutToQuit to work in a small test code now so will try some more ...

Edit2: It seems like aboutToQuit is called but the process is killed before the callback returns.

Edit3: Hmm, I have one thing in the aboutToQuit callback that takes some time to return and the process is killed before that happens. It works on my desktop though.
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).

Last edited by xerxes2; 2013-10-14 at 21:35.
 

The Following 2 Users Say Thank You to xerxes2 For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#7
Originally Posted by xerxes2 View Post
I use python but I've not tried it like that. Even if it works, shouldn't the aboutToQuit signal work when closing from the Sailfish UX?

http://qt-project.org/doc/qt-5.1/qtc...ml#aboutToQuit

"This signal is emitted when the application is about to quit the main event loop, e.g. when the event loop level drops to zero. This may happen either after a call to quit() from inside the application or when the users shuts down the entire desktop session."

Or if the user closes the app from the window/UX.

Edit: I got aboutToQuit to work in a small test code now so will try some more ...

Edit2: It seems like aboutToQuit is called but the process is killed before the callback returns.

Edit3: Hmm, I have one thing in the aboutToQuit callback that takes some time to return and the process is killed before that happens. It works on my desktop though.
just post jolla mailing list about it and hope theyll fix it.
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following 2 Users Say Thank You to marmistrz For This Useful Post:
w00t's Avatar
Posts: 1,055 | Thanked: 4,107 times | Joined on Oct 2009 @ Norway
#8
It could well be that this is an SDK bug. There were changes made in how application closing happens quite some time ago that I am not completely sure have yet propagated into SDK releases (as they are lagging a bit behind our internal development for various reasons).

Once that is integrated, aboutToQuit should - to my knowledge - work OK, and the application will not be force-terminated unless it refuses to shut down when requested.

Off the top of my head, anyway...
__________________
i'm a Qt expert and former Jolla sailor (forever sailing, in spirit).
if you like, read more about me.
if you find me entertaining, or useful, thank me. if you don't, then tell me why.
 

The Following 6 Users Say Thank You to w00t For This Useful Post:
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#9
Ok, then we'll just sit tight and wait for a sdk update. I understand why you want to nuke the process on a mobile device but you should at least give the mainloop some time to return cleanly before doing so. But as you say it's probably fixed already and will be pushed to the next sdk update.
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).
 

The Following User Says Thank You to xerxes2 For This Useful Post:
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#10
Just as promised, the bug is fixed in todays sdk update. The process is not being killed before the mainloop returns. I just tested if a ten seconds sleep works and it did and that ought to be enough for anybody.
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).
 

The Following 6 Users Say Thank You to xerxes2 For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 20:08.