Qt 5中的宏"QT_BEGIN_NAMESPACE"是什么意思?
what is the Macro "QT_BEGIN_NAMESPACE" mean in Qt 5?
在qt 5.6示例" basic layout"中,有一个宏" qt_begin_namespace",我尝试在qt文档中搜索它,但是我仍然无法得到答案。QT中的含义?
相关代码在这里:
#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
这些是宏,如果要在特定名称空间中构建QT,可以重新定义。
这在非常特殊的情况下可能很有用,例如,如果您想在" externalframework :: qt :: qt :: QT :: QT :: QT :: QT :: QT :: version5"名称空间。
中具有所有QT的定义。99.99%的时间,您无需更改空白的默认值。(没有名称空间)
相关文章:
- 来自 std::list 的迭代器 .end() 按预期返回"0xcdcdcdcdcdcdcdcd"但 .begin()
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- 调用'begin(int [n])'没有匹配函数
- "using namespace std;"在C++的作用是什么?
- 使用模板进行堆栈实现; "name followed by :: must be a class or namespace"
- 为constchar*定义std::begin合法吗
- constexpr begin of a std::array
- remove(str.begin(), str.end(), );无法正常工作(我正在使用视觉工作室 2012)
- 为什么我需要做'using namespace std'而不是"使用 std::cout"?
- 'using namespace'实现细节的便捷方法(仅标头库)?
- 了解向量中的 .begin 和 .end
- C++中"typedef"、"using"、"namespace"和"using namespace"有什么区别?
- 混淆 Begin() 方法作为参数
- std::ranges::begin 和 std::begin 有什么区别?
- C++ const char with .begin() and .end()
- C++ "using tcp=x"到"namespace tcp=x"有什么区别
- 如何解决"'mutex' in namespace 'std' does not name a type"?
- 有没有函数可以在擦除 c++ 中获取 deque.begin() 的 int 值?
- 为什么 string::begin() 在即时窗口中输出整个字符串
- 如果没有重新散列,为什么 unordered_set::begin() 会改变?