Reply
Thread Tools
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#1
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...
 

The Following User Says Thank You to nicolai For This Useful Post:
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#2
Happened to me ever since PR1.2 and still happens on PR1.3.
 

The Following User Says Thank You to javispedro For This Useful Post:
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#3
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();
}
 

The Following 2 Users Say Thank You to nicolai For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 14:23.