Make a phone call with qt 4.6.3 - qt

I need to trigger a phone call from a Qt application. I looked to previous post without find a complete answer.
I need to make it with qt 4.6.3. I'm quite new to symbian development, I'm using the last nokiaSDK.
It MUST work ONLY on n97 and E71.
Can Anybody provide a solution?
May be a solution exec an extenal process using QProcess?

It seems like currently none of Qt APIs (including QtMobility) allows to do it. However, you can use native Symbian C++ API - CTelephony class. There are some examples showing how to make a phone call using this class. The obvious disadvantage is that it won't work on any other platform than Symbian.
You may be interested in this example: http://library.forum.nokia.com/topic/Qt_for_Symbian_Developers_Library/GUID-B4DA6005-3037-4FF8-82D5-BA748532E648.html#GUID-B4DA6005-3037-4FF8-82D5-BA748532E648. It shows how to mix Symbian C++ code with Qt code, and it also uses CTelephony, so you just need to change method call from GetPhoneId() to DialNewCall(). Don't forget to add appropriate library (etel3rdparty.lib) in your .pro file.

Related

How can you access any android classes using JNI in Qt?

I'm a newbie on Qt and JNI so please edit or correct me if anything I am saying is off.
How can you access the classes in Android in the C++ code in Qt Creator? It is seemingly not possible to access classes not directly supported by QtAndroidExtras import .
e.g. TextView, BlueToothReceiver, and the countless many useful classes
Here is a good example:
http://doc.qt.io/qt-5/qtandroidextras-notification-example.html
It is possible to call any class from C++ per jni.

Using Qt classes natively in an Android application

The Android application I am about to work on has the UI in Java and the non-UI functionality in C++ that would be accessed via JNI. The C++ code uses some non-UI Qt classes. I am thinking I will spawn a thread in JNI_OnLoadthat essentially will instantiate and run QCoreApplication. Any subsequent JNI call will simply post an event to this thread. Is this possible? Regards.
What you want to do is definitely possible but a bit more difficult than it seems initially.
If you build your app end to end in Qt there's a lot of functionality you get for free from their framework that allows it to run on Android and a lot of that functionality/plumbing is wrapped up in their UI. So if you're not using their UI there's extra work that you need to do.
On Android their UI framework basically creates a native Activity and then uses that activity as a wrapper for the app. If you look at the low-level source for their UI thats what's happening on Android and it's what allows the Qt app to access local resources, the network, OS facilities, etc.
Without the Activity wrapper, your app will only be able to do simple, in-memory operations that require no OS, file system, or network access and also won't be able to make use of other Qt libraries(eg Qt5Sql, Qt5Core, etc).
Here's what we had to do to make this work in our java app:
Create a proxy wrapper Activity for Qt to use that shares the base
context of your app.
Create a QtActivityDelegate.
Set the proxy activity and delegate using the native Qt android
libraries. eg QtNavite.setActivity.
Instantiate and set a DexClassLoader using the same native Qt android libraries.
Load any Qt libraries using System.loadLibrary(..). Please note that the libraries need to be present on the file system already. This part was a big pain for us.
For your Qt Code, make sure you have proper wrappers written so that they can be used via jni. We ended up using swig to auto-generate java wrappers for our code.
You can find out more about swig here: http://swig.org/
After all that you should be able to use your Qt class/library from within a native Android app.
Painful but definitely possible!

How do I get application output from a Qt Creator plugin?

I'm writing an plugin for Qt Creator that will use the application output for a secondary reason (real-time graphical display of data). However, I've run into the problem of getting the application output. I don't wish to steal the output completely, just duplicate it. However, being able to filter what the debugger gets would be nice but not a requirement.
In case you are wondering, I'm trying to avoid modifying existing plugins so that any update to Qt Creator won't conflict and require patching for every single new version.
Creator is a open source project and your contributions are welcome:-) So why don't you to ask for Creator to be changed? The fastest way to do that is to write a patch that implements the interfaces you want and then submit it via codereview.qt-project.org.
Adding another patch that actually uses those interfaces can help, as that makes it easier to judge whether that functionality is really needed or whether there is a better way to implement it.

Modify Qt's shared library code while application starts

I'm trying to create some kind of a server which allows me to start Qt's applications on remote machine via web browser.
I'm wondering it is possible to change/hide some symbols from Qt library (I thought about QApplication or QCoreApplication) without making any changes in code of application (I assume that it is already compiled and uses Qt shared library) and compiling my whole tailor-made Qt libs?
The reason why I need to do this is because I want to install my own specific EventFilter to QApplication and also be able to push my own created events to Qt application.
It also would be great if the solution could be used on all platforms :D
P.S. I know that it will not be possible I could subclass QApplication and modify all Qt apps to use my derived class but I would like to do this more craftily. ;-)
The tool GammaRay does all kinds of injecting code into Qt methods at runtime to attach and debug running Qt applications. You might want to have a look at its code base to see how it is done.

Play sound file on Qt+Mac

I need to play sounds under Qt with control of volume and panning. QSound doesn't do it, phonon may be too much for only this so I thought I'd try the native api.
eeermm, in Mac I have no idea, is there some simple interface to invoke on c++? (I've seen all this NSSound stuff but I am not familar with Objective C and I am not sure if it's possible to mix code (under QtCreator)) my idea would be to a module with simple native api calls to system features not found on Qt.
Thanks!
Qt AudioEngine in Qt5 will do this.
If you're using Qt4, making a single 'Objective-C++' file (extension .mm) which can be called from Qt, but makes NSFoo calls, is easy and works well. The header file should be plain C++, and everything will work together.

Resources