×
Namespaces

Variants
Actions
Revision as of 09:49, 14 June 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Send MMS using Qt Mobility

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
SDK: S60 5th Edition
Devices(s): Nokia N97 Mini
Compatibility
Platform(s):
Symbian
Article
Keywords: QMessageService
Created: skumar_rao (28 Mar 2010)
Last edited: hamishwillee (14 Jun 2013)

Contents

Overview

This article demonstrate how to send MMS using Qt Mobility messaging API

Project configuration file (.Pro file)

  • Add the Qt Mobility project configuration option in the .Pro file as shown below
CONFIG += mobility
MOBILITY += messaging

Header File

#include <qmessage.h>
#include <qmessageservice.h>
 
public slots:
// QMessageService
void stateChanged(QMessageService::State s);
private:
bool sendMMS(QString picturePath, QString phoneNumber);
private:
QMessageService* m_service;

Source File

    m_service = new QMessageService(this);    
connect(m_service, SIGNAL(stateChanged(QMessageService::State)), this, SLOT(stateChanged(QMessageService::State)));
bool QtMMS::sendMMS(QString picturePath, QString phoneNumber) {
// Send MMS
QMessage message;
message.setType(QMessage::Mms);
 
message.setTo(QMessageAddress(QMessageAddress::Phone, phoneNumber));
 
QStringList paths;
paths << picturePath;
message.appendAttachments(paths);
 
return m_service->send(message);
}
void QtMMS::stateChanged(QMessageService::State error) {
if (error == QMessageService::FinishedState) {
QMessageBox::information(this, "MMS", "Message sent");
}
else if (error == QMessageService::CanceledState) {
QMessageBox::warning(this, "MMS", "Sending message failed");
}
}

Classes

  • QMessageService

Reference links

--skumar_rao 09:10, 28 March 2010 (UTC)

This page was last modified on 14 June 2013, at 09:49.
111 page views in the last 30 days.
×