maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   QML MessageModel - Application aborts (https://talk.maemo.org/showthread.php?t=84929)

nicolai 2012-06-17 09:17

QML MessageModel - Application aborts
 
Anyone got the qml plugin MessageModel working?
For it does not work on the device (N950).
Here is a simple stripped down example.
In QtCreator:
Create Project ...
Qt Quick Application
Qt Quick Components for MeeGo/Harmattan

put this in your MainPage.qml
import QtQuick 1.1
import com.nokia.meego 1.0
import QtMobility.messaging 1.1

Page {
tools: commonTools
MessageModel {
id:messagemodel
}

ListView {
id:list
anchors.fill:parent
model:messagemodel
delegate: Item {
id: wrapper
height: 32; width: list.width
Text { id: subjText; text: subject; font.pixelSize: 13; x: 3 }
}
}
}

and add this to your .pro file
CONFIG += mobility
MOBILITY += messaging

Running the application on the simulator target works(!)
On the device I got this messages:
...
Messaging : Looking for account by id: 5
Messaging : Looking for account by id: 3
Aborted

and /var/log/syslog shows:

GLIB ERROR ** GThread - file /home/bifh7/cs2009q3-armel/work/glib2.0-2.28.4/./gthread/gthread-posix.c: line 362 (g_thread_create_posix_impl): error 'Invalid argument' during 'pthread_attr_setschedpolicy (&attr, policy)' aborting...

javispedro 2012-08-10 17:12

Re: QML MessageModel - Application aborts
 
Happened to me ever since PR1.2 and still happens on PR1.3.

nicolai 2012-08-10 21:33

Re: QML MessageModel - Application aborts
 
Actually I found a workaround.
You have to instantiate the QMessageService once before
loading the main qml-file.

For example, add this line to your main.cpp:
Code:

#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include <QMessageService>
QTM_USE_NAMESPACE
Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));
    QMessageService qm;
    QmlApplicationViewer viewer;
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/messagemodeltest/main.qml"));
    viewer.showExpanded();

    return app->exec();
}



All times are GMT. The time now is 03:31.

vBulletin® Version 3.8.8