Files:
This Qt C++ application demonstrates how to use Multimedia, Messaging and Contacts modules from Qt Mobility.
The application shows the viewfinder picture from the device camera and allows the user to capture images. Captured images are stored into the gallery and can be sent as an MMS message to a friend. Application listens for incoming MMS messages in the Inbox folder. If the MMS message contains a picture, the application asks the user whether he or she wants to add the picture as an avatar of the sender. The person's general contact information has to exist in the device phonebook in order to store the avatar in it.
The application uses own MyVideoSurface video surface derived from QAbstractVideoSurface for showing camera view finder pictures. A video surface presents a continuous stream of identically formatted frames.
QMediaService* ms = m_camera->service(); QVideoRendererControl* vrc = ms->requestControl<QVideoRendererControl*>(); m_myVideoSurface = new MyVideoSurface(this,this,this); vrc->setSurface(m_myVideoSurface);
The application handles Graphics Out Of Memory (GOOM) events in it's QApplication::symbianEventFilter() method.
bool symbianEventFilter( const QSymbianEvent* symbianEvent ) { const TWsEvent *event = symbianEvent->windowServerEvent(); if ( !event ) { return false; } switch ( event->Type() ) { // GOOM handling enabled // http://wiki.forum.nokia.com/index.php/Graphics_memory_handling case EEventUser: { TApaSystemEvent* eventData = reinterpret_cast<TApaSystemEvent*>(event->EventData()); if ((*eventData) == EApaSystemEventShutdown) { eventData++; if ((*eventData) == KGoomMemoryLowEvent) { return true; } } break; } default: break; }; // Always return false so we don't stop // the event from being processed return false; }
Application can be self-signed.
After enabling Qt Mobility Messaging module (MESSAGING_ENABLED flag in .pro file) from the project file is ReadDeviceData WriteDeviceData capabilities also needed and application have to be Developer Signed. Enabling Messaging adds MMS sending feature for the application.
Qt SDK 1.1
Qt 4.7.2 for Symbian
QtMobility 1.1.1
Tested on: Nokia N8, Nokia E7
Developed with: Qt SDK 1.1
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.