Displaying Progress Bar on Dialog Box in BB10 native | Techbirds

Posted on: January 10, 2014 /

Categories: Blackberry Apps / Author Name: Swapna Singh

In this blog we will be looking for how to display a “progress bar” on a “dialog box”. 

Here we are reading bb10 contact list. As many contacts we read progess on progress bar is displayed accordingly.

Firstly include :

#include #include

#include

Before defination keep in mind that progress bar value varies from 0 to 100. And in BB10 progress bar incrementation is done on integer value only, no float value is taken by it. So, here we take the size of contact list and group it so that it divides in 100 parts.             For example, if bb10 have 200 contacts than on reading 2 contacts 1 part of progress bar increases.

Now here is the code for that

QList AddressBook::fetchContacts(SystemProgressDialog *progressDialog,ProgressIndicator *progressIndicator,                                                                                                                     ApplicationUI *appui) { QList list_cm;

ContactListFilters filter;

//Reads all conatcts in the phone
QList phoneExistingContacts = m_contactService->contacts(filter);

//Gives number of contacts
qDebug() setProgress(str, i); count++; // progressDialog->setBody(str); // qDebug()