06-27-2012 02:05 AM
Hello,
I am currently learning developement for playbook with Qt.
For that I am using Qt creator to develope the UI specific application.
I want to know that, Is it possible to call any native api from the application that is I am making in QT creator.
As I want to integrate video and audio player in my app.
Is it easier in the native api to use both of this feature.
In QT I found it in QT mobility and with phonon but both of them are not supported on Playbook,
So please guide me with my issue.
Thanks in advance.
bskania.
Solved! Go to Solution.
06-27-2012 10:19 AM
Are you having a particular issue? I have only used the dialog functions and the navigator_invoke functions. Incomplete example:
#ifdef Q_OS_BLACKBERRY
#include <bps/dialog.h>
#endif
.
.
.
void MyWindow::openFile() {
#if defined(Q_OS_BLACKBERRY)
dialog_instance_t alert_dialog = 0;
bps_initialize();
dialog_request_events(0);
if (dialog_create_filebrowse(&alert_dialog) != BPS_SUCCESS) {
fprintf(stderr, "Failed to create alert dialog.");
return;
}
const char* Ext[1];
Ext[0]="*.txt";
if(dialog_set_filebrowse_filter(alert_dialog,Ext,1 )!=BPS_SUCCESS) {
fprintf(stderr, "Failed to set dialog filters.");
dialog_destroy(alert_dialog);
alert_dialog=0;
return;
}
bool yes=false;
if(dialog_set_filebrowse_multiselect(alert_dialog, yes)!=BPS_SUCCESS) {
fprintf(stderr, "Failed to set dialog multiselect option.");
dialog_destroy(alert_dialog);
alert_dialog=0;
return;
}
if (dialog_show(alert_dialog) != BPS_SUCCESS) {
fprintf(stderr, "Failed to show alert dialog.");
dialog_destroy(alert_dialog);
alert_dialog = 0;
return;
}
bool shutdown = false;
char **p[100];
while (!shutdown) {
bps_event_t *event = NULL;
bps_get_event(&event, -1);
if (event) {
if (bps_event_get_domain(event) == dialog_get_domain()) {
int num_paths = 1;
if (dialog_event_get_filebrowse_filepaths(event, p, &num_paths) != BPS_SUCCESS) {
return;
} else {
docPath = QString::fromUtf8(**p);
}
shutdown = true;
}
}
}
if (alert_dialog) {
dialog_destroy(alert_dialog);
}
bps_shutdown();
}
06-30-2012 01:02 AM
Hello,
I tried the example you had given.
But its not running code part that is written in macro Q_OS_BLACKBERRY.
I debugged the code, but its not working,
I am trying alot for this kind of working,
So if anyone have working examle than help me with that.
Thanks in advance
bskania,
06-30-2012 02:28 AM
If it is not running that code, you may have built Qt wrong. I did at first. What mkspec did you use? Will the code run if you change it to Q_OS_QNX?
Nic
06-30-2012 03:05 AM
07-02-2012 12:46 AM
07-02-2012 06:26 PM
Was it giving you those errors with Q_OS_BLACKBERRY? If not then I would say it is at least trying to run the code now. You can just comment that out the fprintf lines. Can you post the compiler output? Did you build Qt using the instructions here: http://qt-project.org/wiki/QNX. Where and when did you get the source?
Nic
07-03-2012 05:15 AM
07-03-2012 12:01 PM
07-04-2012 02:35 AM