hai friends,
i am doing progect using Qt... i am a beginner in Qt so i just downloaded the example file for reading contacts using Qt mobility. i am able to run it successfully in Qt simulator. Bt when i deploy it to my e63 it get installed bt not able to run. i hv installed s60_3_1_app_trk_3_1_2.sisx, qt_installer.sis,qtmobility.sis.. i am using Nokia Qt SDK Qt Creator 2.0.1
Based on Qt 4.7.0 (32 bit)
Built on Sep 9 2010 at 14:27:59
From revision 113d4c5618
. i hv also installed s60 sdk s60v5 sdkv1.0 + Qt 4.7.1 and s60v3 sdk v9.0 + Qt 4.7.1
.
my code is
Test2.pro
#-------------------------------------------------
#
# Project created by QtCreator 2011-02-03T10:51:31
#
#-------------------------------------------------
QT += core gui
TARGET = test2
TEMPLATE = app
SOURCES += main.cpp\
addressbook.cpp
HEADERS += addressbook.h
CONFIG += mobility
MOBILITY = contacts
symbian {
TARGET.UID3 = 0xeccd19d8
TARGET.CAPABILITY += ReadUserData WriteUserData
TARGET.EPOCSTACKSIZE = 0x14000
TARGET.EPOCHEAPSIZE = 0x020000 0x800000
}
addressbook.h
#ifndef ADDRESSBOOK_H
#define ADDRESSBOOK_H
#include <QtGui/QWidget>
#include <QtCore/QPointer>
#include <QtGui/QListWidget>
#include <QtGui/QMainWindow>
#include <QContactManager>
// QtMobility namespace
QTM_USE_NAMESPACE
class AddressBook : public QWidget
{
Q_OBJECT
public:
AddressBook(QWidget *parent = 0);
~AddressBook();
void createContactManager();
void listContacts();
private:
QPointer<QContactManager> m_contactManager;
QListWidget *m_listWidget;
};
#endif // ADDRESSBOOK_H
addressbook.cpp
#include "addressbook.h"
#include<QtGui/QFrame>
#include<QtGui/QMessageBox>
#include<QVBoxLayout>
#include<QContact>
AddressBook::AddressBook(QWidget *parent)
: QWidget(parent)
{
setWindowTitle("Contacts");
m_listWidget= new QListWidget;
m_listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_listWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
// QObject::connect(m_listWidget,SIGNAL(itemActivated(QListWidgetItem*)),this,SLOT(itemSelected(QListWidgetItem*)));
//QVBoxLayout *layout = new QVBoxLayout();
//layout->addWidget(m_listWidget);
QFrame* cw = new QFrame(this);
// setCentralWidget(cw);
QVBoxLayout* layout = new QVBoxLayout(cw);
cw->setLayout(layout);
layout->addWidget(m_listWidget);
createContactManager();
listContacts();
}
void AddressBook::createContactManager()
{
m_contactManager = new QContactManager();
}
void AddressBook::listContacts()
{
QList<QContact> contacts = m_contactManager->contacts();
foreach(const QContact &contact,contacts)
{
QListWidgetItem *currentItem = new QListWidgetItem;
currentItem->setData(Qt:isplayRole,contact.displayLabel());
currentItem->setData(Qt::UserRole,contact.localId());
m_listWidget->addItem(currentItem);
}
}
AddressBook::~AddressBook()
{
}
main.cpp
#include <QtGui/QApplication>
#include "addressbook.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
AddressBook w;
#if defined(Q_WS_S60)
w.showMaximized();
#else
w.show();
#endif
return a.exec();
}
i hv already reinstalled my phone software and tried installing it again.... i am still able to install bt the application is not running..

isplayRole,contact.displayLabel());


