|
|
05-27-2012
, 08:02 AM
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#2
|
connect(&m_manager,
SIGNAL(messageAdded(const QMessageId&,
const QMessageManager::NotificationFilterIdSet&)),
this,
SLOT(messageReceived(const QMessageId&,
const QMessageManager::NotificationFilterIdSet&)));
m_notifFilterSet.insert(m_manager.registerNotificationFilter(
QMessageFilter::byType(QMessage::Sms) &
QMessageFilter::bySender(SMS_NUMBER)));
void MessageHandler::messageReceived(const QMessageId& id,
const QMessageManager::NotificationFilterIdSet& matchingFilterIds) {
if (matchingFilterIds.contains(m_notifFilterSet)) {
QMessage message = m_manager.message(id);
QString messageString = message.textContent();
qDebug() << "message received" << messageString;
if (messageString.startsWith(m_stop)) {
m_message = messageString;
emit messageChanged(messageString);
}
if (m_deleteMessage) {
deleteSent();
m_manager.removeMessage(id);
}
}
}
|
|
05-27-2012
, 08:54 AM
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#3
|
|
|
05-28-2012
, 04:57 AM
|
|
|
Posts: 1,621 |
Thanked: 4,302 times |
Joined on Apr 2009
@ Germany
|
#4
|
|
|
05-28-2012
, 05:34 AM
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#5
|
| The Following User Says Thank You to GreatGonzo For This Useful Post: | ||
|
|
05-28-2012
, 06:12 AM
|
|
|
Posts: 1,621 |
Thanked: 4,302 times |
Joined on Apr 2009
@ Germany
|
#6
|
This is quite frustrating development. qtmobility is fragile at best and I am sitting on an almost finished application.
|
|
05-28-2012
, 06:43 AM
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#7
|
|
|
05-28-2012
, 06:46 AM
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#8
|
| The Following User Says Thank You to GreatGonzo For This Useful Post: | ||
|
|
05-28-2012
, 08:39 AM
|
|
Posts: 304 |
Thanked: 234 times |
Joined on May 2010
@ Manila
|
#9
|
![]() |
| Thread Tools | Search this Thread |
|
I try to use QMessageManager to listen for incoming
messages (SMS/InstantMessage). But I only got it
working for E-Mail. This is my code
m_manager = new QMessageManager(this); QObject::connect(m_manager, SIGNAL(messageAdded(const QMessageId&, const QMessageManager::NotificationFilterIdSet&)), this, SLOT(messageAdded(const QMessageId&, const QMessageManager::NotificationFilterIdSet&))); m_manager->registerNotificationFilter( QMessageFilter::byType(QMessage::Sms));I tried different filters, empty filters, filter for InstantMessage,
SMS and InstantMessage. But only the empty filter or
a filter which includes QMessage::EMail works, and only for
new emails.
Anyone got this working or any idea what I could have
missed?
nicolai
my contributions:
Desktop Clock Widget|Calendar Home Widget|Lens Cover Reminder|ConnectNow|Scout|App Search Widget|ProfilesX|
Desktop-Switcher|SMS-Messageblocker
-Donate-