Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

(Difference between revisions)

Send MMS using Qt Mobility

From Wiki
Jump to: navigation, search
teemup (Talk | contribs)
(Added correct category)
hamishwillee (Talk | contribs)
m (Set correct categories)
Line 1: Line 1:
[[Category:Qt]][[Category:Qt for Symbian]][[Category:Qt Mobility]]
+
[[Category:Messaging]][[Category:Qt Mobility]]
 
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"  
 
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"  
 
|-
 
|-
Line 8: Line 8:
 
|'''Tested on devices''' || Nokia N97 Mini
 
|'''Tested on devices''' || Nokia N97 Mini
 
|-
 
|-
|'''Category''' || Qt for Symbian
+
|'''Category''' || Qt  
 
|'''Subcategory''' || Qt Mobility API
 
|'''Subcategory''' || Qt Mobility API
 
|-
 
|-
Line 19: Line 19:
 
|}
 
|}
  
{{Tip| Read this article before moving forward: [[Setting up environment for Qt Mobility API]]}}
 
  
 
== Overview ==  
 
== Overview ==  
Send MMS using Qt Mobility
+
{{Abstract|visible=true|Send MMS using Qt Mobility [http://doc.qt.nokia.com/qtmobility-1.1/messaging.html messaging] API}}
 
+
== Keywords ==
+
  
 
== Project configuration file (.Pro file) ==
 
== Project configuration file (.Pro file) ==
Line 83: Line 80:
  
 
== Reference links==
 
== Reference links==
 +
* [[Read and Send messages in Qt for Symbian]]
 +
* [[Delete messages using Qt Mobility API in Qt for Symbian]]
 
* [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]

Revision as of 05:08, 14 April 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


Contents

Overview

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)

49 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×