View Single Post
Old 11-29-2010, 03:51 PM   #28
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Starson17 View Post
Do you have any suggestions on the best way to correct such a deficiency? I've read a tutorial and browsed the docs, but I'm still having trouble with Qt. I can add option boxes and menu items, but much more than that and I get lost. I haven't played much with the designer - should I be focusing there more?
You ask a difficult question.

First, I should note that I am continually frustrated by Qt. Its organization and the class hierarchies do not match my mental model, which derives from writing code for Win 3.1 and early smalltalk programs. I have similar problems with Java's class hierarchies. If I didn't have samples (Kovid's code), I would be totally lost.

Regarding getting experience, there are two facets to consider: event-driven programming and the Qt package. If you aren't familiar with the first, then the second is much more problematic.

As regards the first, at the risk of being booed out of town, playing with MS Visual Basic might be a way to go forward, much better that Qt's designer. VB has a rather clean event and form model, so it is easy to get used to writing code that reacts to events instead of code that proactively does something. It supports instant addition and execution of event functions. Qt's designer does not permit easy insertion of event functions, making it harder to use as a learning tool.

As regards the second, what I did (and do) is choose something interesting in the code, then try to understand what is happening. I then try to predict the effect of changes, then test the predictions. In addition, I look at the change logs and the change sets for most GUI changes that Kovid makes, worrying at it until I can describe what the change does, and why. As a side benefit, sometimes I find bugs.

My first real effort with Qt was adding custom columns and user-defined categories to the library view and tag browser. I looked at how Kovid did the standard stuff, and then played with possible changes. I changed the code, submitted it, and then looked at how Kovid changed what I did. I still check the code in 'trunk' against what I submitted, because the differences are instructive.

I suppose that what I am suggesting is that you jump in and try. Of course, this might be impractical if you have a 'real job', because the process is quite time consuming.

BTW: if you are going to do much more development, you might want to consider creating a launchpad account. Managing repositories is much easier if you don't need to deal with patches. I maintain a local shadow of trunk, merge from that, then push changes to my launchpad repository. Kovid takes changes from there. I think that it is easier for Kovid to merge from launchpad repositories as opposed to patches, but I am not sure of that. I know that it is easier for me.
chaley is offline   Reply With Quote