×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    2

    Question QMessageManager queryMessages returns 0 messages in N8

    I am trying to read SMS inbox messages with QMessageManager::queryMessages. I got it working in Qt Simulator, but in my actual device (N8) it always returns 0 messages although there are SMS and email messages available. I am now pretty stuck; do I need to declare some permissions or what could be the problem? I tried running straight from Qt Creator with debug and release, installing Qt Creator created .sis file, and even tried signing the app with developer certificate with device's IMEI code, but the result is always the same.

    Here is my test code:
    Code:
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent), ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        QMessageManager mm;
        QMessageIdList msgs = mm.queryMessages();
        ui->textBrowser->append(QString("Messages %1").arg(msgs.size()));
        for (int i = 0; i < msgs.count(); ++i) {
            QMessage message = mm.message(msgs.at(i));
            ui->textBrowser->append(message.from().addressee());
            ui->textBrowser->append(message.to().at(0).addressee());
            ui->textBrowser->append(message.textContent());
        }
    }
    I have declared in .pro file:
    Code:
    CONFIG += mobility
    MOBILITY += messaging
    All ideas appreciated. I am new to Qt & Symbian development so this may well be some trivial thing I have just missed.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: QMessageManager queryMessages returns 0 messages in N8

    you could check the capabilities from the wiki example: http://www.developer.nokia.com/Commu...g_an_SMS_in_Qt

  3. #3
    Registered User
    Join Date
    Sep 2012
    Posts
    2

    Thumbs up Re: QMessageManager queryMessages returns 0 messages in N8

    Yes, capabilities was the key I missed. I need to add
    Code:
    symbian:TARGET.CAPABILITY += ReadUserData
    to the .pro file. Thanks a lot for the hint! Issue resolved.

Similar Threads

  1. Replies: 2
    Last Post: 2012-11-06, 14:42
  2. QMessageManager.queryMessage returns 0 messages
    By rohitsingh81 in forum [Archived] Qt Mobility Project
    Replies: 0
    Last Post: 2011-08-11, 11:58
  3. QMessageManager->queryMessages works in simulator, but not in N900
    By mka_ in forum [Archived] Qt Mobility Project
    Replies: 10
    Last Post: 2010-08-16, 11:39
  4. querymessages example not compiling when QMessageStore is added
    By jmclaurin11 in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2010-04-27, 03:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •