|
|
2010-11-05
, 17:08
|
|
Posts: 1,048 |
Thanked: 979 times |
Joined on Mar 2008
@ SF Bay Area
|
#2
|
|
|
2010-11-06
, 23:18
|
|
Posts: 4 |
Thanked: 0 times |
Joined on Nov 2010
|
#3
|
TEMPLATE = app CONFIG += mobility MOBILITY = messaging SOURCES += main.cpp qtm.cpp HEADERS += qtm.h
#include <QApplication>
#include "qtm.h"
int main(int argc, char *argv[])
{
qDebug() << "QT_VERSION_STR: " << QT_VERSION_STR;
qDebug() << "QTM_VERSION_STR: " << QTM_VERSION_STR;
QApplication app(argc, argv);
Qtm m;
QTimer::singleShot(5000, &m, SLOT(getMessages()));
m.show();
return app.exec();
}
#include <QtGui>
#include <QMessageService>
#include "qtm.h"
using namespace QtMobility;
Qtm::Qtm()
{
connect(&service, SIGNAL(messagesFound(QMessageIdList)), this, SLOT(messagesFound(QMessageIdList)));
setText("Updating..");
}
void Qtm::getMessages()
{
service.queryMessages();
}
void Qtm::messagesFound(const QMessageIdList &ids)
{
list << ids;
setText("Total: " + QString::number(list.count()));
}
#ifndef QTM_H
#define QTM_H
#include <QtGui>
#include <QMessageService>
using namespace QtMobility;
class Qtm : public QLabel
{
Q_OBJECT
public:
Qtm();
private slots:
void messagesFound(const QMessageIdList &ids);
void getMessages();
private:
QMessageService service;
QMessageIdList list;
};
#endif
|
|
2010-11-06
, 23:51
|
|
Posts: 44 |
Thanked: 73 times |
Joined on Dec 2009
@ Freiburg, Germany
|
#4
|
|
|
2010-11-07
, 00:31
|
|
Posts: 4 |
Thanked: 0 times |
Joined on Nov 2010
|
#5
|
(gdb) run Starting program: /home/developer/madde/qtm QT_VERSION_STR: 4.7.0 QTM_VERSION_STR: 1.0.2 Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString) sync eventloop exit ModestEngine::ModestEngine Starting to initialize ModestEngine::ModestEngine Connecting to Modest DBus Interface ModestEngine::ModestEngine Connected to Modest DBus Interface ModestEngine::ModestEngine Connecting to Qt Mobility Modest Plugin DBus Interface ModestEngine::ModestEngine Connected to Qt Mobility Modest Plugin DBus Interface ModestEngine::ModestEngine Initialized successfully
Program received signal SIGSEGV, Segmentation fault. 0x411f94d4 in strlen () from /lib/libc.so.6 0x411f94d4 <strlen+4>: ldr r2, [r1], #4
(gdb) bt #0 0x411f94d4 in strlen () from /lib/libc.so.6 #1 0x4009630c in QtMobility::ModestEngine::accountEmailProtocolAsString(QtMobility::QMessageAccountId const&) const () from /usr/lib/libQtMessaging.so.1 #2 0x4009a04c in QtMobility::ModestEngine::folderUpdatedSlot(QDBusMessage) () from /usr/lib/libQtMessaging.so.1 #3 0x400aa344 in QtMobility::ModestEngine::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libQtMessaging.so.1 #4 0x40c3e5a4 in QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&, QList<int> const&, int) () from /usr/lib/libQtDBus.so.4 #5 0x40c4e78c in ?? () from /usr/lib/libQtDBus.so.4 #6 0x40c4e78c in ?? () from /usr/lib/libQtDBus.so.4 Backtrace stopped: previous frame identical to this frame (corrupt stack?)
|
|
2010-11-07
, 10:26
|
|
Posts: 44 |
Thanked: 73 times |
Joined on Dec 2009
@ Freiburg, Germany
|
#6
|
|
|
2010-11-07
, 12:51
|
|
Posts: 121 |
Thanked: 53 times |
Joined on Aug 2006
@ Alexandria, VA, USA
|
#7
|
void messagesFound(const QMessageIdList &ids)
|
|
2010-11-07
, 22:20
|
|
Posts: 4 |
Thanked: 0 times |
Joined on Nov 2010
|
#8
|
void Qtm::messagesFound(const QMessageIdList &ids)
{
list << ids;
setText("Total: " + QString::number(list.count()));
list = QMessageIdList();
}
|
|
2010-11-14
, 12:24
|
|
Posts: 5 |
Thanked: 5 times |
Joined on Nov 2010
|
#9
|
|
|
2010-11-22
, 00:39
|
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#10
|
#include <QtGui/QApplication>
#include <QMessageManager>
QTM_USE_NAMESPACE
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMessageManager manager;
QMessageFilter filter = QMessageFilter::byType(QMessage::Sms);
QMessageIdList messageIds = manager.queryMessages(filter, QMessageSortOrder(), 10);
return a.exec();
}
| The Following User Says Thank You to nicolai For This Useful Post: | ||
But the thing is that for some reason I always end up getting a segmentation fault with it. It always takes a while like 10-20mins for it to crash. And I was hoping some people could help me find out what's wrong..
And here's the source code for it..
qtm.pro
#include <QtGui> #include <QMessageManager> using namespace QtMobility; int main(int argc, char *argv[]) { QApplication app(argc, argv); qDebug() << "QT_VERSION_STR: " << QT_VERSION_STR; qDebug() << "QTM_VERSION_STR: " << QTM_VERSION_STR; QLabel *l = new QLabel(); QMessageManager manager; QMessageIdList list = manager.queryMessages(); int count = list.count(); l->setText("Total: " + QString::number(count)); l->show(); app.exec(); }Last edited by johnson; 2010-11-05 at 17:22.