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.
Related
Where can I find a program which can be executed on Visual studio to compile openGL sources and generate libraries like opengl32.lib, glut32.lib, etc. In fact I have a problem of version with QT. I want to execute opengl using QT but without QT Opengl API.
Here's the error message :
lnk2026 module unsafe for safeseh image opengl32.lib
I'm really lost.
Thanks in advance for your help.
OpenGL is a specification, not a library with a defined source code. OpenGL implementations are what you use, and most of them are propietary. Some of them are open source (such as MESA), but in general you do not have public access to the source code.
The "Open" in "OpenGL" refers to the nature of the specification, not to the concept of "open source". OpenGL is "Open" in that the specification is freely available and can be implemented by anyone (modulo patent claims).
So while you can compile free-standing implementations of OpenGL, what your operating system provides (in your case, via opengl32.lib and opengl32.dll) is not something you can compile yourself.
I created a Qt static library following the instruction here:
http://qt-project.org/wiki/How_to_create_a_library_with_Qt_and_use_it_in_an_application
Then I tried to link the library with my own (non-Qt) application, and GCC complained about undefined references. Examining the library content using Linux nm utilty I found the function I intend to call has cryptic letters added before and after it.
Reading the instruction from the instruction link more closely, it suggests that I need to use use an import define so the right Qt macro can be called to import the function (which I assume renames the function to match the naming scheme in the library). But I don't really want to introduce Qt dependency in my main application.
What I really want to do is to build a UI frontend library with Qt, and my main application will simply link to it without having any Qt dependency. Is this possible? Or am I using Qt in an unintended manner?
Thanks.
It sounds like you're running into C++ namespace mangling. Try adding an 'extern "C" {}' block around your libraries export.
The main point of the QLibrary::resolve function is to provide an abstraction layer so you don't have to worry about the win32 command or the linux command for resolving a symbol. It shouldn't be necessary to use a library created with Qt.
I have written a Qt based dll with some OpenGL calls. If I load my DLL from my Qt application with QGLWidget used for rendering, a call to QGLContext::currentContext from the DLL returns the correct context. But if use my DLL in a non Qt based program there is no QGLContext returned. As a result I couldn't use QGLShaderProgram in non Qt based apps.
What I am doing wrong?
P.S. Direct calls to glCreateProgram and so on in my library seem to work fine, but I want to use Qt classes.
I want to use Qt classes.
Then you should use your DLL in an application that uses Qt. By requiring the Qt classes, your DLL now requires Qt. If you want your DLL to work when Qt isn't available, then you shouldn't use Qt.
Besides, the Qt classes for shaders and programs aren't anything you couldn't whip up in 30 minutes.
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.
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.