I need to write some C++ cross-platform GUI code soon, and after umming-and-ahhing about whether to use GTK or Qt, I've decided to try out the latter despite the recent Microsoft buy-out. However, as soon as I started to get into it and write some simple GUI code, I hit a snag; Qt uses what it calls slots to bind buttons to functions, where a function that can be executed as an action is defined as being a slot. To give an example, if you had a integer counter and you wanted to add five to the counter when you clicked the "Plus Five" button, then your onPlusFive function which actually increments the counter would be considered a slot. This is all well and good, until you write the code and it won't compile - instead giving you errors about vtables and such. To fix this, you need to do two things, the first of which is to add the Q_OBJECT macro definition to your QWidget-extending class. Q_WHATNOW? I'm really new to Qt, so any experienced coders might roll their eyes at this - but I expected to be ab More
2011-06-19