Open the default Messaging Composer Application

Overiew

The following code snippet shows how to open the default messaging composer application of the platform (Symbian, MeeGo Harmattan, Maemo, etc.) using method compose [doc.trolltech.com] of class QMessageService [doc.trolltech.com] of Qt Mobility. The example loads SMS that is waiting to be edited and sent by the user.

Code Snippet

Include the required headers:

  1. #include <QMessageService>
  2. #include <QMessage>

Enable messaging at pro file:

  1. CONFIG += mobility
  2. MOBILITY += messaging

Implementation:

  1. QMessageService pMessageManager = new QMessageService(this);
  2. QMessage message;
  3. message.setType(QMessage::Sms);
  4. message.setBody("Foo");
  5. m_pMessageManager->compose(message);

Categories: