(Difference between revisions)

Send MMS using Qt Mobility

From Nokia Developer Wiki
Jump to: navigation, search
somnathbanik (Talk | contribs)
hamishwillee (Talk | contribs)
m (Bot fixing redirect link)
Line 84: Line 84:
* [http://qt.nokia.com/ Qt - cross-platform application and UI framework]
* [http://qt.nokia.com/ Qt - cross-platform application and UI framework]
* [http://labs.trolltech.com/page/Projects/QtMobility Qt Mobility API]
* [http://labs.trolltech.com/page/Projects/QtMobility Qt Mobility API]
* [http://qt.nokia.com/developer/new-qt-apis New Qt APIs Beta - Mobility Project]
* [http://qt.nokia.com/developer/qt-roadmap New Qt APIs Beta - Mobility Project]
* SDK help
* SDK help
--[[User:Skumar rao|Skumar rao]] 09:10, 28 March 2010 (UTC)
--[[User:Skumar rao|Skumar rao]] 09:10, 28 March 2010 (UTC)

Revision as of 16:12, 27 May 2011

ID Creation date 28th Mar 2010
Platform S60 5th Edition Tested on devices Nokia N97 Mini
Category Qt Subcategory Qt Mobility API

Keywords (APIs, classes, methods, functions): QMessageService



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);
bool sendMMS(QString picturePath, QString phoneNumber);
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.setTo(QMessageAddress(QMessageAddress::Phone, phoneNumber));
QStringList paths;
paths << picturePath;
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");


  • QMessageService

Reference links

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

115 page views in the last 30 days.