Project works with simulator but not with symbian....



  • I just reinstalled Nokia Qt SDK. I created a simple project with following pro file and code.

    Curiously, it builds successfully for simulator but does NOT build for symbian. Errors stating that QtContacts\QContact cannot be included. What could be wrong as this is fresh installation? I had to add contacts in MOBILITY manually to make it work for simulator.

    @
    #-------------------------------------------------

    Project created by QtCreator 2011-01-30T09:04:57

    #-------------------------------------------------

    QT += core gui network

    TARGET = Try5
    TEMPLATE = app

    CONFIG += mobility
    MOBILITY = contacts systeminfo

    LIBS += -llibpthread

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    symbian {
    TARGET.UID3 = 0xe10cc5e0
    # TARGET.CAPABILITY +=
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }

    and code looks like:

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QLabel>
    #include <QtContacts/QContact>
    using namespace QtMobility;

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    ui->gridLayout->setColumnMinimumWidth(3, 100);
    ui->gridLayout->setRowMinimumHeight(5, 60);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    void MainWindow::on_pushButton_clicked()
    {
    QContactManager manager;
    foreach (const QContact &contact, manager.contacts()) {
    QLabel * label = new QLabel(contact.displayLabel());
    ui->gridLayout->addWidget(label);
    }
    }
    @



  • Change the Target.Capability to TARGET.CAPABILITY += NetworkServices
    WriteUserData
    ReadUserData
    WriteDeviceData
    ReadDeviceData
    LocalServices
    UserEnvironment

    all these capabilities are not required, but change it as per your needs. For some capabilities, you need to sign the app with you device specific certificate, key pair.



  • Try changing the
    MOBILITY = contacts systeminfo
    to
    MOBILITY += contacts systeminfo

    Also, I think the official guideline is to use macro
    QTM_USE_NAMESPACE instead of "using namespace QtMobility" (it should unfold to be the same).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.