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.

States

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 Bing.com. 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.

Another look at elementary OS (Freya)

As a Final Fantasy IX fan sometimes I look at the codename they gave it and grin as I recall the fond memories playing throughout FF9.

I scratched off elementary OS on the grounds that while it was heading towards the right path the terminal lacked customization. Sure, I could have called another terminal …. which I didn’t think of back then.

Screenshot from 2015-12-07 00:54:32

elementary OS is often called a “cheap OSX clone”, I think it’s unjust to just swear off the distribution due to that. I do think that they do have a potential audience to grab with their vision and mission. elementaryOS provides a more sensible user interface that doesn’t hint or give any complex trait that GNU/Linux share throughout its history. And what I mean by this is that compared to Linux Mint’s Cinnamon, eOS is like a complete overhaul of how a Desktop Environment should interact with users. And I feel it’s working for them.

elementaryOS is beautiful

And I might say, simple. Unlike the rather bad decisions GNOME 3 team made when designing the GNOME shell, eOS simplifies the interface providing a grid view of apps or a category-based list.

OSX is strong with this one

Screenshot from 2015-12-07 00:55:15

While I don’t mind the whole OSX gray-ish theme one of the changes they made to dolphin is that it supports a new type of view, you can see folders in a column view, which can be pretty helpful when you are organizing files.

Don’t take this as a review

I might add. This is a pretty “quick” take on elementaryOS. I like it so far and have considered putting it on my laptop a few times yet I don’t really feel like making any drastic change at the moment. Maybe in January, I’m just hoping they release their next iteration already.

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…

  • Sync.com 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 Posteo.de they also do transparency reports and often calls out on authority abuse.
  • Check out fastmail.