Connecting at the backend



  • How do I call a C function from Qt and return from the same C function?In my application I had created a form with "Dial" button in it.When I click on Dial my call should be established.Can anyone guide me in this?



  • Just like you would do it from any other c++ program?



  • Is it the same if I want to know about the call status like call in progress,ringing..



  • Well, I guess that would depend on the platform you're working on, and you're not giving us much information to work with (nor do I know much about developing for any platform that can make calls, to be honest).

    You have to appreciate that Qt runs on many operating systems, on many devices. We have no way of knowing what you are working on specifically, so if you have questions that relate to Qt-on-your-platform, it would be a good idea to tell us what platform that is.



  • [quote author="Revu" date="1299588778"]Is it the same if I want to know about the call status like call in progress,ringing..[/quote]

    Use the ways that this function provides you. As you're talking about a C function, callbacks come to mind.



  • @Andre & Volker:Thank You for your response.Am working on linux platform and my device is of touch screen type.Few modifications are made to my program to connect a call.I had displayed the messages like alert on the terminal.Now how can I display the same alert messages like call in progress/ringing on my screen?
    Can I update those status on the same screen or create new screen for every state change?
    If so how can I proceed with it?



  • @Revu

    Sorry, my crystal ball that I normally use to look at other peoples code is undergoing maintance. You'll understand that it needs considderable powers to pull off the feat of magically showing me the code, API's in use and the plans people have with them. So, it is currently in a karma bath...

    Anyway... as I said before: you are not nearly giving us enough information to work with. You have that problem more often, it seems. I am sorry, I can not continue playing 20 questions with you to find out what you are trying to do and what the relevant API's are you're strugling with. Try to take a moment to take a look at your questions as an outsider, not in the know of your project, would look at it. Would you think there is enough information there to understand what it going on?



  • I had created the forms in creator.call form has a button "Call" and the callpage form has a button "cancel".When I click on "call" my callpage form is activated while hiding the call form and on "cancel" the current form is closed and show the previous call page(the respective .cpp file is as below).Now at the backend some programs are included by others so on click on "call" the call is established and on cancel the call ends.(am not dealing with backend process).So w.r.t that how can I display the status messages on my application screen.Like when the call is established my screen should show that call is established similarly when call is in progress or ringing.
    @//call.cpp
    #include "call.h"
    #include "ui_call.h"
    #include "callpage.h"
    call::call(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::call)
    {
    ui->setupUi(this);
    }
    call::~call()
    {
    delete ui;
    }
    void call::on_callButton_clicked()
    {
    hide();
    static callpage *callPage = new callpage(this);
    callPage->show();
    callPage->activateWindow();
    callPage->raise();
    ui->callButton->setStatusTip("Call");
    }@
    @callpage.cpp
    #include "callpage.h"
    #include "ui_callpage.h"

    #include "call.h"

    callpage::callpage(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::callpage)
    {
    ui->setupUi(this);
    }

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

    void callpage::on_cancelButton_clicked()
    {
    close();
    static call *callWindow = new call(this);
    callWindow->show();
    callWindow->activateWindow();
    callWindow->raise();
    ui->cancelButton->setStatusTip("End Call & back to Main Page");

    }@
    Please let me know if this is still incomplete information.



  • Hi,

    there are some interesting thgings in your code:

    1. static callpage *callPage = new callpage(this);
      You create static widget (inside a function) with a hidden parent? Then the parent should be 0. Where do you delete this widget? perhaps it should be a member of the class call?

    2.) in void call::on_callButton_clicked() you hide the object and then change it's widget content to display a state (which might not be seen as it is hidden :-) )

    3.) you have no connection between call and callpage. In callpage you create a new instance when it is fist displayed which will never show the original one. You close callpage and then change it's properties, why? It's closed!



  • @Geroif:Actually it is for a dial application mean when I click "call" I should get one more window with a button "cancel".At once only one one screen should be visible for me.So I had used that code.

    If you have any other way to do it please let me know.
    Thanks



  • The controller used is DM6446 on montovista.On this I want to run my application for a incoming and outgoing call.So how can I get the call alert and the status of the call when am in a call.


Log in to reply
 

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