UPDATE: I published this one day too late, but here it is anyway:)
I’m writing this blog post from Fosdem. It’s my last day here and it feels that I’m already waiting for the next Fosdem. I must say that it’s amazing what volunteers can achieve. Thousands of developers, hundreds of presentations and a lot of beer. Great work I must say!
I actually came to Fosdem to keep a presentation about QML mobile application development and I demoed how to abstract platform dependencies away so that it’s easier to port your mobile app to different platforms. The showcase part was demoed on Sailfish OS. I think the feedback I got from the presentation was very nice. So thank you for that!
Some time ago I wrote a post how to port QtQuick1.X extensions to Qt5. In that post, I wrote how I created a VideoWidget QMLExtensionPlugin on Qt 4.7 and then what it takes to make it run on Qt5 too. Well, things has changed a bit since that post an I thought that I should share what it takes now to make it work again.
Step 1: You can remove deprecated macro Q_EXPORT_PLUGIN2() from your plugin code
Step 2: Add a new macro Q_PLUGIN_METADATA(IID “module.uri” FILE “yourfile.json”) after Q_OBJECT macro in your extension plugin class.
I’ve been playing with QML quite a long time, even though it’s a young technology. I bet, I’m not the only one who has noticed that when building an application with QML, you may end up having a bunch of views and then you should figure you a way to navigate between them.
You can of course create all the views in the beginning and then switch between them based on user’s interaction. This may lead you to the situation where your app eats memory and your “Main.qml” is rather large. Another way is to build your own framework which provides an infrastructure for creating and displaying those views. The third way would be to use a ready-made framework such as Qt-Components. The third way, may not be always an option because it may work only on certain platforms, therefore you’ll end up building something of your own.
I decided to give a try and build something of my own. I call it “d-touch” framework. I had the following list in my mind how the framework should work:
Transitions between views must be dynamic i.e. I want to be able to change from slide transition to something else without touching a code at all.
I don’t want to create all the views in the beginning in my main. Instead I want to load them dynamically on demand.
The first requirement was solved using shaders. To be more precise, I use only fragment shaders at the moment. This lead me to a solution that I don’t need to define “positions” for views and then do transitions e.g. from (x1,y2) to (x2,y2) coordinates. Instead, I just make them to be in a “view stack” and actual transition has been implemented using Qt5′s ShaderEffect element.
The second requirement is solved by providing functionality (functions) for creating views dynamically. View management is handled fully by d-touch framework. Views just define, what QML files needs to be opened or closed and the framework handles the rest.
Here’s a short video where I demonstrate how shader based transitions work and all the views are created only when needed.
Things ain’t go always like you plan and therefore I’m starting to look for a new job. If you have read my blog, I’m pretty sure that you know I like Qt. So here’s my wish list what I’d like to do and what I’ve done:
I like to use Qt and Linux / Mac
I’m a ScrumMaster and I like scrum, so I like working in teams
I’m used to of multinational and distributed environments
Job should be in Finland so hear me Jolla, Digia, Futurice, etc:)
I can keep Qt / QML trainings too
I like people, so I’m used to of working near to clients
I have worked both on mobile (Nokia N9) and on industrial side
I’ve released few apps to iOS side too
(update) I added my QML portfolio here too. It doesn’t include all the stuff, but the coolest ones. The last three videos are stuff that I’ve done for my previous employer.
If you are interested in to hire me, you can download my CV below or send me email directly to marko(dot)a(dot)mattila(at)gmail(dot)com. Oh yes, and I could start my new job (most likely) in the beginning of September.
I thought, that I should write about this topic, because it’s time to start my self-education project again and see how I can take new features of Qt in use. I’m not sure how useful this blog post is because there already is a nice wiki page available about the same topic on qt-project.org. But for those, who haven’t read the wiki page, this might be a bit shock – Yes, in Qt5 there is a new syntax for connecting signals and slots!
Don’t worry, your old code (Qt 4.x) doesn’t break and Trolls will continue the support of the old, string-based connection. So what’s new in the new signal-slot syntax then? Basically you can connect signals and slots using the following style shown in by the example below. Note that you still have to have Q_OBJECT macro defined in a class, which introduces signals or slots.
Instead of using SIGNAL() and SLOT() macros, you can now also use C++ function pointers to connect signals and slots. In Qt5, you can connect signals to any member function of a class i.e. they don’t need to be slots. Note that in the end, Qt slots are only class’ member functions. The “slots” keyword is only an empty define and used only by MOC (Meta Object Compiler) when parsing headers.