So it is not possible to draw text using the Momentics??? That'd be bummer I think my stuff is almost good to go if I could just draw some text on my graphics. I'm drawing on QImage via QPainter it was looking so good until I tried to add some Text, BB10 documentation is pretty poor. SIGSEGV when I tried to call drawText
Cascades is BlackBerry UI toolkit built on Qt Quick. Qt Quick have only primitives like Rectangle, MouseArea, Gradient and etc. Combining those Cascades gives you various buttons, menus and etc.
You can still use BB10 APIs from your non-Cascades app.
Hi Rondog, thanks for your help, your source code is very interesting, I will try to implement it.
My project uses MainWidget, the original version of the project (Symbian) used MainWindow.
I tell you that a week ago I heard of Qt for BlackBerry, I want to port my app. The most important functions of the app are:
Send and receive SMS automatically (Not ported)
Making and accepting requests http automatically (ported)
Sqlite data base management (ported)
The quality of the graphical interface is secondary.
Apparently Qt Creator has limitations, I will try to implement the most important functions (Send and receive SMS automatically). If I solve the problem, I will continue with the GUI, but if I have problems I'll have to start using
BlackBerry Native SDK. Thank you very much.
Coldpeace, I did what you said (cleaned the projects, set the right kit). It works (only with new proyects). My proyect (symbian) don't works. Now I will copy-paste the source code, look for the error. Thank you very much to all.
It should be possible to utilize the nokia plugin. If you are using Qt5, there is an OpenStreet maps one afaik. The position plugin for Blackberry is not yet upstream in Qt5 but will probably be available soon.
are you using QtGui or Cascades and which Qt version?
I think there are several ways to do that. Did you already look into the qnx platform plugin? The touch events are sent with QWindowSystemInterface::handleTouchEvent(w, m_touchDevice, pointList);
So you could hack it into the platformplugin somehow.
Another possibility would be to inject a bps screen touch event into the qt event loop. You might want to have a look at:
QQnxBpsEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
I was referring to BB10's Cascades which supposedly is different from the Qt Quick Controls (aka. Qt Desktop Components).
I have to admit that I only ever tried to run demo apps shipped with the SDK on BB10 to test the creator integration, so I may be wrong.
I went back and re-read the notes on building Qt for Blackberry.
It does mention that it is targeting Blackberry 10 and not so much the playbook. It also recommends using 4.8.x
From what I have found version 4.8.3 is the latest Qt version that you can use if your target is a playbook (version 2.1). Every version higher has some really strange issues (maybe unsolvable at the application level).
read this "link":http://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/accessible_folders.html for more info regarding filesystem access permissions in BB10
it is also recommended to use absolute file paths, instead of relative paths
Just to add more information on this subject, I notice other widgets, like labels, are updated on the showevent(). Not sure if this behavior could be considered a bug, I always tought that showevent() was suposed to be used in this kind of situation of updating widgets. Anyway it's "fixed" with singleshot()
I got it working like you said.
@joao@joao-EasyNote-TM86:~/qtBlackBerryProjects/MathGraphicaOpenGL-build-Blackberry-Release$ ./../../bbndk/host_10_0_9_404/linux/x86/usr/bin/blackberry-nativepackager -package MathGraphica.bar bar-descriptor.xml@
Thank you very much.
Is there any player in example / demo in que Qt that you can try porting out of the box to bb10 to see if it plays sound ? I was having a OpenGL problem in BB10, I solve it by using the cube example and comparing with my code.
I will not reject possibility that simulator has some problems getting correct DPI while showing text when its font size is given in points. How size of your rectangle is calculated? Is it calculated in pixels or points? If in points where from have you got points?
OK. I have successfully launched app from QtCreator. Previously I had used QtCreator with simulator and that ended with following error:
Info: Sending request: Launch
Info: Action: Launch
Info: Launching lt.sandbox.todoteriaplus.testDev_doteriaplus50989c0_...
Error: Failed to create application process: Exec format error
Launching application failed
This error indicated that I must change sysroot to armle-v7 and remove Qt mkspec I have used in this dialog (screenshot shamelessly taken from http://qt-project.org/wiki/Qt-Creator-with-BlackBerry-10 ):
After that everything just went through.
My advice for you would be to run sample app http://qt-project.org/wiki/Qt-Creator-with-BlackBerry-10#9502a243840645c318c087ca6b94d95d . It is quite simple and should you give basic idea how to run simple Qml app.
If you still have questions - ask. I will be happy to help.
OK. Your code looks good. What does not work for you? Do you get any error message?
The only thing that you must be aware about: each import creates independent space (or at least that's my impression). It is better to use properties for keeping global state.
I have "solved" problem myself. Instead of using native solution I have based my code on https://github.com/blackberry/Cascades-Samples/tree/master/paymentservice and it works very nice. Actually I like it better because I have to write less code and "bb::platform" code does not look cascades specific (I hope it will remain so). Just as help to others here what you should take into account by adopting this cascades solution for Qt app:
Don't forget to add some extra "using namespace bb::platform" or use "bb::platform::" before specific functions.
Add following line to pro file: LIBS += -lbbplatform
If you are writing QtQuick app here is how you should set Window Group id (it works for me so I guess that's correct way):
@QPlatformNativeInterface * const nativeInterface = QApplication::platformNativeInterface();
const QString windowGroupId = static_cast<const char *>(nativeInterface->nativeResourceForWidget("windowGroup", QApplication::topLevelWidgets().first()));
If someone from RIM team is reading and has to add any corrections please do it. While it is working (for me) I don't want incorrect solution to float around.
Finally it works... Thank you! But can you use the debugger now? Every time when I start it it just crashes, says that is has timed out or that it cannot connect, etc.
The app does get packaged and uploaded to the simulator and works though.
I do use Windows. So far I have absolutely no success with the debugger on the simulator.
Is that applicable to Qt Creator/BB10 on Windows?
Anyway... Does anyone have an idea what are the future plans for Qt Quick and Qt Creator on BB10? Will they be officially supported and improved or they are just a byproduct of the Cascades UI development???
If you're creating a new app from scratch, BB recommends to use Cascades, which is QML, except you can't mix the usual QML components with the Cascades ones. Qt QML/C++ work just as you'd expect.
You can port your QML/C++ app very quickly. Most of the time spent would be in setting up compilers, keys, devices, simulators and all that stuff, rather than porting code.