×
Namespaces

Variants
Actions
(Difference between revisions)

How to use Messaging Filter in QML

From Nokia Developer Wiki
Jump to: navigation, search
chintandave_er (Talk | contribs)
(Chintandave er -)
Den123 (Talk | contribs)
(Den123 - code formatting)
Line 29: Line 29:
  
 
<code cpp>
 
<code cpp>
        enum StandardFolder {
+
enum StandardFolder {
            InboxFolder = QMessage::InboxFolder,
+
    InboxFolder = QMessage::InboxFolder,
            DraftsFolder = QMessage::DraftsFolder,
+
    DraftsFolder = QMessage::DraftsFolder,
            OutboxFolder = QMessage::OutboxFolder,
+
    OutboxFolder = QMessage::OutboxFolder,
            SentFolder = QMessage::SentFolder,
+
    SentFolder = QMessage::SentFolder,
            TrashFolder = QMessage::TrashFolder
+
    TrashFolder = QMessage::TrashFolder
 
}
 
}
 
</code>
 
</code>
  
 
To add folder filters, one have to use the values by hand:
 
To add folder filters, one have to use the values by hand:
<code cpp>
+
<code javascript>
                        MessageFilter {
+
MessageFilter {
                            type: MessageFilter.StandardFolder
+
    type: MessageFilter.StandardFolder
                            value: 4 //MessageFilter.SentFolder
+
    value: 4 //MessageFilter.SentFolder
                            comparator: MessageFilter.Equal
+
    comparator: MessageFilter.Equal
                        }
+
}
 
+
 
</code>
 
</code>

Revision as of 21:02, 25 March 2012

This article explains how to use Messaging Filter in QML.

Article Metadata
Code ExampleTested with
SDK: Qt SDK 1.2
Devices(s): Nokia 6-01 , Belle
Compatibility
Platform(s): Symbian^3
Symbian
Device(s): All*
Platform Security
Capabilities: NetworkServices ReadUserData WriteUserData
Article
Keywords: MessageModel
Created: Devnull (07 Mar 2012)
Last edited: Den123 (25 Mar 2012)

Introduction

Qt mobility messaging when used with Qt quick, involves the component of MessageModel. Due to a bug in the implementation, standard folders enums are not exposed to QML:

enum StandardFolder {
InboxFolder = QMessage::InboxFolder,
DraftsFolder = QMessage::DraftsFolder,
OutboxFolder = QMessage::OutboxFolder,
SentFolder = QMessage::SentFolder,
TrashFolder = QMessage::TrashFolder
}

To add folder filters, one have to use the values by hand:

MessageFilter {
type: MessageFilter.StandardFolder
value: 4 //MessageFilter.SentFolder
comparator: MessageFilter.Equal
}
133 page views in the last 30 days.
×