Home > Rant > Just a short thought on Qt

Just a short thought on Qt

Qt has (sometimes huge) design mistakes in my opinion but it’s far from bad. But try to look up unrelated information about it, and you’ll find the fanboys defending every silly thing about it.

For example, when you design a window in the Qt Designer, it creates an XML file with the .ui extension. That file is then translated to source files. The generated header has code like this:

class Ui_MainForm
{
    // ... Declarations of widgets and some helper functions.
}

below it another class is generated in this exact way:

namespace Ui {
    class MainForm: public Ui_MainForm {};
} // namespace Ui

The class in the Ui namespace can then be used as a private member in another header file, which is provided for the programmer to change: (because the code above is auto generated)

class MainForm : public QMainWindow
 {
    // ... some things you add here
private:
    Ui::MainForm ui;
}

Not one, but more people asked why is there a Ui::MainForm generated, when there is also a Ui_MainForm, which is the exact same thing. They were just curious and asked politely but the fanboys attacked. “It seems to me you do not get what namespaces are” (exact quote).

(This is the end of the post. If you don’t understand why I’m troubled by such reactions you are either not a programmer (it’s normal then, not your fault), or you are smarter than I am and the way Qt does this appears right to you.)

Advertisements
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: