Delving into Qt Quick/QML, states and transitions

My apologies if the video is a big too long in terms of height. I’ve been working really hard to get my app out there, yet the more I move closer to my goals the more there is to do. I’m not sad about that though, if anything this has been one hell of a productive week.

C++/QML interaction

I feel like I should start talking about the interactions between Qt Quick/QML types with your C++ backend. I must say that I’ve had the wrong idea since the beginning. Why? Well, if you must ask I will tell you a nightmare prone story where my entry CPP file began with searching QObjects from the QML engine to establish a connection between my backend and the visual aspect(types) of my app.

At first sight it doesn’t sound bad, but it is. When you use QtQuick/QML (referred from here on as QML) the main idea is to provide a rich dynamic interface and have it all typed up with almost no effort. Yet, one of the questions you always ask yourself is “how to interact with the backend” and in the documentation it explicitly starts talking about finding children in the QML engine root object so you can connect them with your backend.

Depending on the type of your app there’s one huge problem: What if my app is too dynamic and the types/elements of it are always getting destroyed and recreated due to wanting to free memory?

The answer lies within either making the root object a hub of communication OR extending QML with new providers type. If you have read the documentation at some point you will come across an example that starts with creating a QML Type called Message and that message will provide and contain said message through its usage. After you are done designing the properties and members of Message object in your CPP backend you can register it with qmlRegisterType. A bit more info here, to those who are interested.


I have found that I have more control making my qml types have states or certain properties that hints the internals of my app of when to do certain things. States in QML helps a lot in that, while it’s commonly used in transition I can also see it as a semaphore to control the flow of how you want to direct the user.

As you saw in the video at the start of this post you can see I’m also using states.

Nothing is certain

Right now there’s just no right way to write your qml files. There’s no “best practices” excluding the memory management part in the documentation as it’s exclusively for memory management. How you lay out the visual objects and how you communicate and bridge it with your backend is up to you. I don’t really know if this is really good or bad, you just have to come up with an “efficient” way of not compromising the performance of your app.

All in all, it’s been a pretty nice experience. I just wish the documentation improved.

DuckDuckGo, you still need better search results.

Recently I’ve been a bit annoyed by the search results DuckDuckGo provides. I ended up switching to another search engine that’s quite underrated called StartPage. The results from StartPage comes from Google, sadly. I say sadly due to one major problem, most search engines sucks and that itself is a big issue as Google is a monopoly itself when it comes to search engine territory.

StartPage is better, however, it’s just a short-term solution to a bigger problem.

Then there’s My mission is to decentralize what I do, what I write, what I receive. Break yourself free from Google services by decentralizing Search, Mail, and other services (such as Google Docs, although Office online is a beast). The options are out there, you just need to adapt.

I should reiterate how awesome FastMail is, love its interface!

What I’d like to see in static generators

If you are

  • a blog addict
  • a web developer
  • someone who keeps up with recent trends

Then by now you should know about these things called static generators. In a nutshell, a static generator is a often small application that will render a document written in Markdown, Textile, or other type of markup syntax, create a whole HTML out of a designed template (or theme) and with the generated output you can upload it straight to your site.

Sounds very easy, right? Most static generators don’t have databases and most of them are platform-independent making it easier for the user to write his/her documents with ease and generate the HTML whenever the possibility is given.

Static generators, imho, have one of the biggest pros right now is that they don’t rely on any interpreter to gush out the HTML, meaning it doesn’t need PHP, Python, Java in the server-side.

There’s one thing that the static generators fail and that is providing a sane user interface. Ghost has gotten “good” with it, and by good is that they haven’t made any progress to go against an interface like WordPress, or any other easy-to-use CMS, blog software, etc.

They all lack in the user interface/usability department

At first I thought “hey, maybe Ghost is really gonna be that WordPress killer we have been waiting so far”. Sadly it turns out that even their template system is pretty primitive. I personally created a theme for Ghost, most of it was pretty straightforward but there wasn’t really anything that screamed “flexible”.

Beyond Ghost I don’t know any other contender that has actually tried to make an impact by being a static generator with a human user interface. Most static generators are written in a way that requires command line interaction to please the neckbeards, a few nerds here and there; that alone already disqualify it from being usable by the average user.

Which brings me to…

A question I have to ask is “What if the blogger is so active he/she can gush out over 400-800 articles within a year?” Taking in consideration how long X generator takes to generate an output of a large amount of articles written… any small tweak to the structure of the theme means the person has to reupload everything from scratch, in which dynamic solutions have the upper hand without a doubt. (a lot of variables varies here)

Bugs, bugs everywhere!

You know one of the most excruciating experience is when you are new to something the first thoughts you will have after analyzing an specification is:

  • Ok, I got this. All I need is this, this and that.

In web development, to me, it became something like that. I already knew what to do, how to do it and how to put the pieces together. Now with C++/Qt everyday is a challenge. Most stems from the lack of familiarization of Qt Framework API, and C++ standard library. Everything is so alien, yet so exciting at the same time, and so, so exhausting since you burn yourself a bit in the process.

Sometimes I like to take some time off and explore other languages, other frameworks/platforms. Recently I’ve found a need to learn C# and Visual C++ ^^. I will eventually learn them, my struggle begins with designing the application… and I’m guilty of over-complicating this task. Why? I have to keep repeating “we can always refactor it later”.

I guess, I’m just overwhelmed by all these things. I have worked and invested so much time, sometimes I have to wonder if it’ll be enough to get hired in a decent software development workshop. Hopefully next year I’ll find out after I graduate, but for now I must keep learning as much as I can and put my knowledge in practice.

As for my app? Decent progress, I’ve done a lot of bug fixes mostly related to the XML parser as for some reason Qt’s XML stream parser can drive you nuts. There’s still a lot to do, yet, the backend is more or less shaping up to be stable enough and the data from the parser has been inserting with no problems, meaning once I get the backend stabilized all I have to do is finish the frontend then the testing begins.

The alternatives I chose

This week have been pretty nice so far. As I keep educating myself in things the regards privacy I started developing my app, well, resuming development of my app. I got to the point that the decisions so far are sound.

The technologies/services I chose to replace of what I used to use so far…

  • over Dropbox (note, it has a referrer tag. Nothing will happen if you click the link, it will just earn me free space just like Dropbox)
  • FastMail over Gmail
  • Chromium over Google Chrome. I should note that you can indeed get Chromium for Windows. You have to install PepperFlash (easy peasy) for flash support. Go get it!
  • DuckDuckGo over Google

In terms of applications I’ve more or less stayed the same. If it wasn’t for friends and family I would have chosen to get rid of Skype. I think I have taken care of the most crucial parts.

My e-mail service makes me uncomfortable

Ever since we had the privilege to use Gmail (Googlemail) e-mail service back in 2004 Google became our favorite search engine, and truly our favorite e-mail service dethroning hotmail, yahoo, and other popular services by introducing a fresh look.

Its feature rich web interface and the features it offered made me rave in delight for days and weeks. Over the years, the hidden price of using such service unfolded to see it plagued with privacy issues.

This type of issue may make some throw hands up while rolling your eyes with a “here we go again…”. Truth? Most of us have nothing to hide, yes. Having “nothing to hide” is the go-to response to privacy concern issue in which I find quite short-sighted as it’s enabling Google as a company to keep this practice.

Perhaps I am too paranoid, maybe. I’d also like to keep whatever I talk to between my colleagues, friends, relatives in private and not be part of Google’s targeted ads. Which reminds me, did you know that anything you talk through Google Hangouts is also used for ads? No? Give it a try.

All in all, I am cursed. You hear me right, I am cursed because for many many years I have used the same e-mail address in services like Amazon, Ebay, PayPal, Facebook, you name it. And now I am “forever” tied to Google ads machine. What I fear is not the Ads machine but what comes after it.

  • Profiling your behavior
  • Search behaviors

All the searches you have made, all the things you have talked through google services is going to become a carcass of what you may may not do. It takes no genius to realize that the could also be gathering data of the places you visit through the millions and millions of sites that uses Google Analytics, including this site. Has there been a report as such? Not really, at least not yet.

Google have given us ever reason to distrust it. Sadly the giant is so big nobody sees the threat up in the air. As for me I have to find ways to transfer all the services I use to the new e-mail.

To those who wonder which e-mail service protects your privacy:

  • Check out they also do transparency reports and often calls out on authority abuse.
  • Check out fastmail.

A challenge that must never be overlooked: User Interface

Only 2-3 weeks away to finish this college trimester. I’m really excited to know it’s “almost over” as this year has been full of challenges in real life, bumping into personal struggles and family issues can really suck your drive to develop.

My disgust with Ubuntu has been slowly dissipating, as I wrote in Disappointed I ran into issues with it, issues that permanently crippled my computer. As a former linux user, and as someone that loves the linux environment in general you know you will always have those little urges to come back and use linux as it’s pretty much “your home”.

Sadly–no, actually fortunately I’ve been investing a good amount of time learning Windows. Its set of APIs and technology it provides. Let’s sit down and be realistic for a moment that it’s hard and has always been hard to monetize open source projects, any developer will always choose their family over ideals.

So this brings me to today’s subject: Interfaces.

I’ll admit, I suck at designing. I’m good in coming up with interfaces ideas, but putting things together in a very concise manner to provide a decent user interface is incredibly hard. To maintain a balance of usability, functionality, and “modern appearance” of an application these days is hard.

I consider myself to be more of a backend type of person. I like working in the internals parts of the application. I love learning to improves ways of providing metadata so that the user interface can function without the UI being the become the dictator of how the backend should be designed (don’t mix business logic and view, etc) and thus allow me to target multiple platforms and gush out more views to different screens.

As I’ve been designing the application I’ve gone through three or four drafts. Each draft being 20-30% different from each other. Drafting also means that you are dedicating your time to solve possible corner cases, it’s not much about throwing pretty colors, gradients, and call it a day. (I wish.)

During the time I’ve spent drafting/sketching the interfaces I’ve found myself sinking a lot of time in the user interface planning stage. Whether that’s good or bad I don’t know myself. Time will tell, I guess.

So the easiest way is becoming a hardcore fan of your app

I feel like placing myself in the users shoes is MUCH, MUCH easier than sitting as a developer and concluding that I should throw everything in TableViews and TreeViews, with lots of checkboxes and call it a day.

So I began to give each view specific purpose, a mission that a view and its partials needs to complement each other to satisfy the user’s needs. User clicked on new section -> show loading animation -> a new view appears -> new view is a gridview in nature. Hint the user that you can press and hold each grid for more options. Each option complements what to do with said grid cell.

And so on. It’s a very, very tedious process in my humble opinion. Designing applications internally (OOD, modular system, etc) is hard, UX is hard, frontend is hard. Quite the obvious conclusion, I guess.


So recently my laptop(the very one I’m using right now) got crippled by an Ubuntu 15.04 with an error

Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)

Now, see this error appeared out of nowhere after using Kubuntu 15.04 for months, the last update killed it. So fine, I went ahead and reinstalled Ubuntu (not Kubuntu). After using it for a bit and installing all the updates I decide to reboot just to see it cripple again. That’s it, I’m fed up with a few things I’ve been dealing with linux over the years. I’m tired of fixing things that shouldn’t break. Most importantly, I made peace with Microsoft products, I made peace with how I’ll be dealing with frameworks that belongs to big entities like Microsoft, Google, etc.

A few weeks back I got a copy of Windows 10 through Dreamspark program. This was already enticing me to drop linux out of my life, for a short amount of time of course. I love linux, but I’d rather get a Mac than sit through the hell that is fixing rare corner cases. I plan to go back to unix through a mac eventually, either that or wait for Fedora to actually polish their KDE, and for KDE team to fix bugs on Plasma which will take even longer.

All in all, as you might have guessed I installed Windows 10 on my laptop and it has been working splendid. Anything web development related will be done through virtual machines as I just don’t want to spare more of my time fixing things in linux.

I am very disappointed, especially in Ubuntu because of all distributions I never expected it to cripple my laptop.

There are no goals to be reached if there’s no discipline


Goals are meant to be completed, but without discipline a person can easily lose sight of what he or she wants. Losing sight is quite easy, from wanting to build an empire to sitting on the couch watching TV series. I can’t say I blame you if you want to enjoy Breaking Bad, Game of Thrones, and many other awesome series. Take in moderation though.

I haven’t been this focused for a long time. I would say that it feels good to have a clear vision of where I want to initially start, to where I want to be at the end of the journey. Those who know me knows how much I’ve struggled, others can just assume. And yet I move forward, because we really need to move forward regardless of what people think of you or me. Cut them off and carry on as you don’t need them, I would say. I find that surrounding myself with positive individuals can actually be incredibly refreshing than the usual sassy crap you get on the internet. Even if you had the greatest bullshit filter at some point you will inevitable fall for bullshit.

Which is quite amusing, because you don’t know you are being treated like crap until someone starts treating you like a human being, and respect you for what you are. Then you know the difference; it’s why I say “cut them off, you don’t need them”.

As for the picture I’m happy to say that I’ve reached a new milestone on the application I’ve been building. I’ll be re-branding it pretty soon. I’m quite happy with the results I’ve been getting from Qt Quick and I feel like I’ve made the right decision to stick with it.

I’m still amazed at how fast and lean(may not be so lean to others) C++ can be under a language with no garbage collector showed me how amazing and painful it can be. Iterating through a numerical array from 1 to 100,000 in less than a second really makes you think, and yes I know, it’s pretty impractical to use that as a measure of speed.

I’ve more or less taken a liking to C++ and I hope to start a career out of it. I may not be the best, but I sure as hell am pretty fast on taking initiative on things that I don’t know.

Although, remember that learning is not linear. You can pour 2-3 hours a day and do all the activities you want. Grinding 12 hours a day is just a recipe to burnt out quickly.

With that said, I have revitalized my interest in programming and creating user-focused applications whether it’s making a intuitive user interface or bringing a competitive product to the table I’ve never felt so prepared, yet I can’t give in to this feeling as you all know programming is pretty big, incredibly big so I can’t just put my glove off and pretend I’m done learning.

Quick thoughts on GOG client

I’m a fan of GOG, and of course CD Projekt (makers of The Witcher games, Cyberpunk 2077, etc). As a person who will be finishing his bachelor’s degree it would be one a heck of a goal if I were to make it to GOG team. Sadly, I don’t think I have the experience enough to meet their criteria.

Initially, when Origin client came out I noticed one thing. Origin uses Qt, and as you would assume GOG does as well. The two don’t necessarily have to share the same backend. In fact, I think GOG may be a bit different from what I had in mind. For starters, I thought GOG client would be a QML application, which it isn’t. Alright, fine, so maybe it’s a Qt project that uses WebKit, custom JavaScript injections to communicate with the C++ backend back and forth? Close, but not so much!

GOG client apparently is a hybrid composed of Qt and Chromium Embedded Framework which caught me by surprise as including WebKit would be better in the long run, maybe. How are they maintaining the calls from their the HTML5/JS frontend to C++? Well, I have a couple of ideas but nothing concrete to write a small application to provide proof. The idea however shouldn’t be far from WebKit interaction with your Qt application internals.

As far as I know the GOG client is written in AngularJS primarily with some shades of jQuery, some custom fonts (mainly Lato). I would say that when a user wants to download a game either it uses CEF or Qt Network(module). Either way, I’m having a bit of trouble understanding the need of Qt, apart of using it for configuration (settings window).

I find it intriguing that they decided to go HTML5/JS on the frontend and use C++ as the backend. It’s not that different than going full QML (well, actually QML is a whole new world itself).

Update: 08/09/2015

Oh, apparently I’ve been out of the loop as of late. I completely forgot that QtWebkit is going to be deprecated and QtScript to be removed… now all the decisions on GoG client makes sense.