Re: Qt application crashes after 2 minutes if started from app grid
Hi, 2011/5/10 Cornelius Hald : > On Tue, 2011-05-10 at 18:24 +0300, Eero Tamminen wrote: >> On 05/09/2011 08:44 PM, ext Timur Kristóf wrote: >> > On 05/09/2011 04:43 PM, Kimmo Hämäläinen wrote: >> >> If you don't use D-Bus at all, you need to implement this >> >> single-instance and window raising yourself. >> > >> > This can be easily done with the QtSingleApplication class. >> >> If that works by starting a new instance of the application >> which them notices that it's already running and exits, >> that makes window topping a really heavy operation... > > Actually for me the single-instance thing works even with a normal > QApplication. I've removed the .service file and the service line in > the .desktop file. Still I can have only one instance. I think on Maemo 5, hildon-desktop is keeping track of which window belongs to which .desktop file (or: launcher icon) and if the application is already running, hildon-desktop simply switches to the application instead of instantiating a new one. That doesn't mean that it will work the same on any other environment (e.g. N900 MeeGo DE, etc..). It's a good idea though if most applications are single-instance, because it makes switching instantaneous, because hildon-desktop simply has to present the window without creating another process. The code is in src/launcher/hd-app-mgr.c in hildon-desktop's source - it should be in the function hd_app_mgr_launch() and hd_app_mgr_activate() if I'm not mistaken. The user could still start two instances if (s)he would start your application from X Terminal. If you want to prevent that, I'd suggest using D-Bus. HTH. Thomas ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt application crashes after 2 minutes if started from app grid
On Tue, 2011-05-10 at 18:24 +0300, Eero Tamminen wrote: > On 05/09/2011 08:44 PM, ext Timur Kristóf wrote: > > On 05/09/2011 04:43 PM, Kimmo Hämäläinen wrote: > >> If you don't use D-Bus at all, you need to implement this > >> single-instance and window raising yourself. > > > > This can be easily done with the QtSingleApplication class. > > If that works by starting a new instance of the application > which them notices that it's already running and exits, > that makes window topping a really heavy operation... Actually for me the single-instance thing works even with a normal QApplication. I've removed the .service file and the service line in the .desktop file. Still I can have only one instance. Not sure why it's like that, but it fits my needs :) Cheers, Conny ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt application crashes after 2 minutes if started from app grid
Hi, On 05/09/2011 08:44 PM, ext Timur Kristóf wrote: On 05/09/2011 04:43 PM, Kimmo Hämäläinen wrote: If you don't use D-Bus at all, you need to implement this single-instance and window raising yourself. > > This can be easily done with the QtSingleApplication class. If that works by starting a new instance of the application which them notices that it's already running and exits, that makes window topping a really heavy operation... - Eero ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt application crashes after 2 minutes if started from app grid
This can be easily done with the QtSingleApplication class. On 05/09/2011 04:43 PM, Kimmo Hämäläinen wrote: If you don't use D-Bus at all, you need to implement this single-instance and window raising yourself. -Kimmo ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt application crashes after 2 minutes if started from app grid
On 05/09/11 17:37, ext Cornelius Hald wrote: Brilliant :) Already runs for 6:30 minutes without crashing. Do I still need the .service file or can I delete it as well? There is a reason why all applications register a D-Bus service: that way we can guarantee that only one copy of the application is running (this is also used in MeeGo). Also, if the application is already running, it can receive the D-Bus message and raise its window. If you don't use D-Bus at all, you need to implement this single-instance and window raising yourself. -Kimmo Thanks a lot! Conny P.S. Added the list again. On Mon, 2011-05-09 at 16:27 +0200, th.p...@gmail.com wrote: Hi, Have you tried removing the osso service line/d-bus information in the application's .desktop file? I think that fixed the problem. There should be something about that in the mailing list archives IIRC. HTH :) Thomas __ On May 9, 2011 4:05 PM, Cornelius Hald wrote: Hi all! I've got a bit a weird problem. I'd we happy if anyone could give me a hint. My Qt (QML/C++) app terminates after exactly 2 minutes if it was started via the graphical launcher. If I start it from the terminal it runs fine for hours. I think this could be connected with D-Bus, but I'm not sure how/where to look. In Gtk+ apps we had to register with D-Bus after start-up. If we didn't do so, the app was killed after some time. I thought with Qt that QApplication takes care of this. Is this true, or do I have to register manually? Thanks! Conny ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt application crashes after 2 minutes if started from app grid
So a short test shows that the .service file is not needed with Qt apps. Thanks everyone! This list is awesome :) Conny On Mon, 2011-05-09 at 16:37 +0200, Cornelius Hald wrote: > Brilliant :) Already runs for 6:30 minutes without crashing. Do I still > need the .service file or can I delete it as well? > > Thanks a lot! > Conny > > P.S. Added the list again. > > On Mon, 2011-05-09 at 16:27 +0200, th.p...@gmail.com wrote: > > Hi, > > > > Have you tried removing the osso service line/d-bus information in the > > application's .desktop file? I think that fixed the problem. There > > should be something about that in the mailing list archives IIRC. > > > > HTH :) > > Thomas > > > > > > > > > > __ > > On May 9, 2011 4:05 PM, Cornelius Hald wrote: > > Hi all! > > > > I've got a bit a weird problem. I'd we happy if anyone could give me > > a > > hint. > > > > My Qt (QML/C++) app terminates after exactly 2 minutes if it was > > started > > via the graphical launcher. If I start it from the terminal it runs > > fine > > for hours. I think this could be connected with D-Bus, but I'm not > > sure > > how/where to look. > > > > In Gtk+ apps we had to register with D-Bus after start-up. If we > > didn't > > do so, the app was killed after some time. I thought with Qt that > > QApplication takes care of this. Is this true, or do I have to > > register > > manually? > > > > Thanks! > > Conny > > > > > > ___ > > maemo-developers mailing list > > maemo-developers@maemo.org > > https://lists.maemo.org/mailman/listinfo/maemo-developers > > > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt application crashes after 2 minutes if started from app grid
Brilliant :) Already runs for 6:30 minutes without crashing. Do I still need the .service file or can I delete it as well? Thanks a lot! Conny P.S. Added the list again. On Mon, 2011-05-09 at 16:27 +0200, th.p...@gmail.com wrote: > Hi, > > Have you tried removing the osso service line/d-bus information in the > application's .desktop file? I think that fixed the problem. There > should be something about that in the mailing list archives IIRC. > > HTH :) > Thomas > > > > > __ > On May 9, 2011 4:05 PM, Cornelius Hald wrote: > Hi all! > > I've got a bit a weird problem. I'd we happy if anyone could give me > a > hint. > > My Qt (QML/C++) app terminates after exactly 2 minutes if it was > started > via the graphical launcher. If I start it from the terminal it runs > fine > for hours. I think this could be connected with D-Bus, but I'm not > sure > how/where to look. > > In Gtk+ apps we had to register with D-Bus after start-up. If we > didn't > do so, the app was killed after some time. I thought with Qt that > QApplication takes care of this. Is this true, or do I have to > register > manually? > > Thanks! > Conny > > > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt application crashes after 2 minutes if started from app grid
On 05/09/2011 03:04 PM, Cornelius Hald wrote: Hi all! I've got a bit a weird problem. I'd we happy if anyone could give me a hint. My Qt (QML/C++) app terminates after exactly 2 minutes if it was started via the graphical launcher. If I start it from the terminal it runs fine for hours. I think this could be connected with D-Bus, but I'm not sure how/where to look. I remember this being talked about on IRC yesterday - maybe look at the logs? ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
RE: Qt application crashes after 2 minutes if started from app grid
Can it somehow be related to your desktop file? I can't see anything wrong with this code. -Original Message- From: maemo-developers-boun...@maemo.org [mailto:maemo-developers-boun...@maemo.org] On Behalf Of Cornelius Hald Sent: Monday, May 09, 2011 10:26 AM To: Kristóf Timur Cc: maemo-developers Subject: Re: Qt application crashes after 2 minutes if started from app grid Hi Timur, unfortunately I currently can't provide the complete sources. I don't think I have something special in there. My main() looks mostly like this: int main(int argc, char *argv[]) { #if defined(Q_OS_SYMBIAN) QApplication::setGraphicsSystem("openvg"); #else QApplication::setGraphicsSystem("raster"); #endif QApplication app(argc, argv); // Export types to QML qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qRegisterMetaType("QMediaContent"); Configuration config(app.arguments()); if (config.hasErrors()) { config.printErrors(); return -1; } // Init QML view QmlApplicationViewer viewer; QDeclarativeContext *ctx = viewer.rootContext(); CoreManager coreManager(config, ctx); ctx->setContextProperty("coreManager", &coreManager); viewer.setOrientation(QmlApplicationViewer::LockPortrait); viewer.setSource(QUrl("qrc:qml/MainWindow.qml")); viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView); viewer.show(); return app.exec(); } Cheers, Conny On Mon, 2011-05-09 at 16:16 +0200, Kristóf Timur wrote: > Hello Conny, > > AFAIK you don't need to bother with D-Bus at all if you're not actually > using it. > If your app is open source, I could take a look at the code to try help out. > > Cheers, > Timur > > On 05/09/2011 04:04 PM, Cornelius Hald wrote: > > Hi all! > > > > I've got a bit a weird problem. I'd we happy if anyone could give me a > > hint. > > > > My Qt (QML/C++) app terminates after exactly 2 minutes if it was started > > via the graphical launcher. If I start it from the terminal it runs fine > > for hours. I think this could be connected with D-Bus, but I'm not sure > > how/where to look. > > > > In Gtk+ apps we had to register with D-Bus after start-up. If we didn't > > do so, the app was killed after some time. I thought with Qt that > > QApplication takes care of this. Is this true, or do I have to register > > manually? > > > > Thanks! > > Conny > > > > > > ___ > > maemo-developers mailing list > > maemo-developers@maemo.org > > https://lists.maemo.org/mailman/listinfo/maemo-developers > ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt application crashes after 2 minutes if started from app grid
Hi Timur, unfortunately I currently can't provide the complete sources. I don't think I have something special in there. My main() looks mostly like this: int main(int argc, char *argv[]) { #if defined(Q_OS_SYMBIAN) QApplication::setGraphicsSystem("openvg"); #else QApplication::setGraphicsSystem("raster"); #endif QApplication app(argc, argv); // Export types to QML qmlRegisterType(); qmlRegisterType(); qmlRegisterType(); qRegisterMetaType("QMediaContent"); Configuration config(app.arguments()); if (config.hasErrors()) { config.printErrors(); return -1; } // Init QML view QmlApplicationViewer viewer; QDeclarativeContext *ctx = viewer.rootContext(); CoreManager coreManager(config, ctx); ctx->setContextProperty("coreManager", &coreManager); viewer.setOrientation(QmlApplicationViewer::LockPortrait); viewer.setSource(QUrl("qrc:qml/MainWindow.qml")); viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView); viewer.show(); return app.exec(); } Cheers, Conny On Mon, 2011-05-09 at 16:16 +0200, Kristóf Timur wrote: > Hello Conny, > > AFAIK you don't need to bother with D-Bus at all if you're not actually > using it. > If your app is open source, I could take a look at the code to try help out. > > Cheers, > Timur > > On 05/09/2011 04:04 PM, Cornelius Hald wrote: > > Hi all! > > > > I've got a bit a weird problem. I'd we happy if anyone could give me a > > hint. > > > > My Qt (QML/C++) app terminates after exactly 2 minutes if it was started > > via the graphical launcher. If I start it from the terminal it runs fine > > for hours. I think this could be connected with D-Bus, but I'm not sure > > how/where to look. > > > > In Gtk+ apps we had to register with D-Bus after start-up. If we didn't > > do so, the app was killed after some time. I thought with Qt that > > QApplication takes care of this. Is this true, or do I have to register > > manually? > > > > Thanks! > > Conny > > > > > > ___ > > maemo-developers mailing list > > maemo-developers@maemo.org > > https://lists.maemo.org/mailman/listinfo/maemo-developers > ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Qt application crashes after 2 minutes if started from app grid
Hello Conny, AFAIK you don't need to bother with D-Bus at all if you're not actually using it. If your app is open source, I could take a look at the code to try help out. Cheers, Timur On 05/09/2011 04:04 PM, Cornelius Hald wrote: Hi all! I've got a bit a weird problem. I'd we happy if anyone could give me a hint. My Qt (QML/C++) app terminates after exactly 2 minutes if it was started via the graphical launcher. If I start it from the terminal it runs fine for hours. I think this could be connected with D-Bus, but I'm not sure how/where to look. In Gtk+ apps we had to register with D-Bus after start-up. If we didn't do so, the app was killed after some time. I thought with Qt that QApplication takes care of this. Is this true, or do I have to register manually? Thanks! Conny ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Qt application crashes after 2 minutes if started from app grid
Hi all! I've got a bit a weird problem. I'd we happy if anyone could give me a hint. My Qt (QML/C++) app terminates after exactly 2 minutes if it was started via the graphical launcher. If I start it from the terminal it runs fine for hours. I think this could be connected with D-Bus, but I'm not sure how/where to look. In Gtk+ apps we had to register with D-Bus after start-up. If we didn't do so, the app was killed after some time. I thought with Qt that QApplication takes care of this. Is this true, or do I have to register manually? Thanks! Conny ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers