windows 下的qt源代码:
#ifndef QSQL_H<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
#define QSQL_H
#include <QtCore/qglobal.h> //该头文件位于qt\src\corelib\global中,里面全是宏定义,
//应该是所有的宏定义都在里面。包括下面三个宏定义
QT_BEGIN_HEADER //开始定义头文件,这样写的必要性是什么?是否有高手解答?
QT_BEGIN_NAMESPACE //开始定义命名空间
QT_MODULE(Sql)
namespace QSql //声明一个命名空间
{
enum Location //定义定位信息
{
BeforeFirstRow = -1,
AfterLastRow = -2
#ifdef QT3_SUPPORT
, BeforeFirst = BeforeFirstRow,
AfterLast = AfterLastRow
#endif
};
enum ParamTypeFlag //定义参数类型标志
{
In = 0x00000001, //这里为什么要来这么多的0
Out = 0x00000002,
InOut = In | Out,
Binary = 0x00000004
};
Q_DECLARE_FLAGS(ParamType, ParamTypeFlag)
enum TableType //定义表类型
{
Tables = 0x01,
SystemTables = 0x02,
Views = 0x04,
AllTables = 0xff
};
enum NumericalPrecisionPolicy //定义数字精确策略
{
LowPrecisionInt32 = 0x01,
LowPrecisionInt64 = 0x02,
LowPrecisionDouble = 0x04,
HighPrecision = 0
};
#ifdef QT3_SUPPORT
enum Op { //定义操作
None = -1,
Insert = 0,
Update = 1,
Delete = 2
};
enum Confirm { //定义确定取消
Cancel = -1,
No = 0,
Yes = 1
};
#endif
}
Q_DECLARE_OPERATORS_FOR_FLAGS(QSql::ParamType)
QT_END_NAMESPACE
QT_END_HEADER
#endif // QSQL_H
转载于:https://blog.51cto.com/no001/344734