Sunday, 15 June 2014

user interface - What is the rationale behind UI namespace in Qt? -


UI file creates 2 squares with the same definition in the process of creating user interface code from QT.

  class UI_CustomeUIClassFromUIfile {// code is generated from UI file via UI} Namespace Yuri {class CustomeUIClassFromUIFile public: UI_CustomeUIClassFromUIFile {}; } Using namespace UI;  

What is the reason for having 2 squares in the UI namespace and without another one without namspace? Is it for the compiler to support, in which there is no support for namespace, there is a macro like QTNAMESPACE.

The macro is QT_BEGIN_NAMESPACE, which is used if you compile QT to stay inside someone Are there.

For 2 sections, I think you answered it yourself You can use either Ui_XXX or Ui :: XXX . I always prefer the Ui :: method, but for every one.

So I think there is no real answer to me as a logic other than choosing a programmer.


No comments:

Post a Comment