[maemo-developers] Qt application crashes after 2 minutes if started from app grid

From: Felipe Crochik felipe at crochik.com
Date: Mon May 9 17:31:15 EEST 2011
Can it somehow be related to your desktop file? I can't see anything wrong
with this code.

-----Original Message-----
From: maemo-developers-bounces at maemo.org
[mailto:maemo-developers-bounces at 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<GuideListModel>();
    qmlRegisterType<PoiListModel>();
    qmlRegisterType<TourListModel>();

    qRegisterMetaType<QMediaContent>("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 at maemo.org
> > https://lists.maemo.org/mailman/listinfo/maemo-developers
> 


_______________________________________________
maemo-developers mailing list
maemo-developers at maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers

More information about the maemo-developers mailing list