In Qt 5.6 Example "basicLayout",there is a Macro "QT_BEGIN_NAMESPACE",I try to search for it in Qt Documentation,but I still can't get the answer.So what is the meaning in Qt?
The Code related is here:
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
QT_BEGIN_NAMESPACE
class QAction;
class QDialogButtonBox;
class QGroupBox;
class QLabel;
class QLineEdit;
class QMenu;
class QMenuBar;
class QPushButton;
class QTextEdit;
QT_END_NAMESPACE
//! [0]
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog();
private:
void createMenu();
void createHorizontalGroupBox();
void createGridGroupBox();
void createFormGroupBox();
enum { NumGridRows = 3, NumButtons = 4 };
QMenuBar *menuBar;
QGroupBox *horizontalGroupBox;
QGroupBox *gridGroupBox;
QGroupBox *formGroupBox;
QTextEdit *smallEditor;
QTextEdit *bigEditor;
QLabel *labels[NumGridRows];
QLineEdit *lineEdits[NumGridRows];
QPushButton *buttons[NumButtons];
QDialogButtonBox *buttonBox;
QMenu *fileMenu;
QAction *exitAction;
};
//! [0]
#endif // DIALOG_H
These are macro you can redefine if you want to build Qt in a specific namespace.
This can be usefull in very particuliar situations, for example if you want to have all Qt's definitions inside a "ExternalFramework::Qt::Version5" namespace.
99.99% of the time, you don't need to change the default value, which is blank. (no namespace)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With