Home > Rant > Qt my subjective first impressions

Qt my subjective first impressions

I’m going to be very honest straight away. I had a lot of prejudice against Qt before I tried it. Most programs that boast to be cross-platform are bad, including those that use Qt. This is only not true about some projects because they are huge, many coders contribute and the interface is often written separately for each platform.

Qt didn’t turn out to be as bad as I expected it to be though, but I’m still going to take it to pieces here. I’ve only been using it for about two weeks, so I’m sure I’ll figure out easier ways to do things compared to what I do now. I want to write more posts about Qt, so let’s start with “first impressions”. What a newbie (to Qt) will find when he or she first uses it depends on the person. I can only write about my impressions.

I have been coding for some time already and I have seen huge libraries, including many parts of winapi. Qt at the first glance seems huge too. This can be a bad or a good thing. I think that it provides many tools that I need for zkanji, and I’m yet to find things it doesn’t have. It’s very convenient that way and unlike .Net with C# (which I think is a good comparison in this regard)  Qt is C++ and it works fast too. (There’s the so called Quick controls part of Qt which is slow. I’m not using it.) On the negative side, the Qt dlls that you might have to include with your program can take up tens of megabytes. (Just for comparison, .Net installs hundreds.) This might not sound that bad nowadays, but a lot of people still have slow internet connection or artificial bandwidth limits. I’ll have to see what the file size ends up to be once I statically link Qt to my program.

Even if you are used to big libraries, you’ll still have to read a lot of Qt introduction and documentation of very basic features. I guess this is normal, but there are many small things you will have to figure out for yourself. There are many tutorial videos out there. I haven’t seen them because I don’t appreciate videos like that. Coding takes a lot of typing, so I need my information in written form. (I can’t get it how newer generations only understand anything if they saw a video about it.)

As a new user it was mainly the documentation I tried. I might not be your typical new user, because my first idea was to write a new control… I mean, widget. In zkanji (pre-Qt), the area that shows the word results for dictionary searches is an entirely custom made control. I wrote its display code and its input handling from scratch because there was nothing I could use that can display and scroll ten thousand lines in an instant. I was looking in the documentation for “how to write a custom widget”, but it only writes about how to make “properties” for it (that you can manipulate in the designer), what options to add to some files I have never even heard of before and such. Nothing about what you’ll definitely have to inherit etc, which functions should be implemented or anything. I found out things spending my first weekend on this but it turned out that while this approach works, it’s faster to just use one of the existing item view widgets of Qt, namely QTableView. I have many problems with the documentation (which isn’t that bad btw) but this is a first impressions post so I can write about that later.

Qt’s designer is a mess. I have mostly read positive opinions about it, but it’s not as good as the form designer in Visual Studio (which is not available for c++ unfortunately), and even the VS form designer was not as good as the one in Delphi/C++ Builder, which is still way ahead of the competition. The worst crime of the designer is that it can show you something, and when you compile your program what you get is entirely different. Most of the functionality which could be implemented in the designer is not. Whenever I needed something, and I expected a property to exist for it, it didn’t. You have to write many many lines of code to achieve things that were ordinary in the previously mentioned competition.

The layout system, which is used in the designer and in the running program too for placing widgets, was very hard for me to figure out, and I’m still struggling with it every time. It’s very different from what I’m used to, and maybe because I already learned something else, I find it unintuitive. This in itself could fill a whole post, but I think I won’t write about it, because it’d be just complaints about how it’s not what I’m used to.

To close this post, my first impression of Qt is that it is usable. It has convenient parts, and other parts that are so bad you wouldn’t believe it’s part of the same thing. I think I’ll be able to write zkanji using it, but it requires much time to learn.

In the next (probably shorter) post, I plan to write about my struggle to make zkanji with Qt work as a native app (at least on Windows).

Categories: Rant Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: