我有這個在我的C++頭文件:如何在C++ Qt中填充靜態QMap的值?
#include <QMap>
#include <QString>
class LogEvent {
public:
LogEvent();
enum column_t {TIMESTAMP_COLUMN = 0, TYPE_COLUMN = 1, EVENT_COLUMN = 2,
FILE_COLUMN = 3};
static QMap<column_t, QString> COLUMN_NAMES;
static QMap<column_t, QString> getColumnNames() {
return LogEvent::COLUMN_NAMES;
}
//blah blah blah other functions
};
這是我的C++源文件:
#include "LogEvent.h"
LogEvent::LogEvent()
{
//constructor code
}
//blah blah blah other functions
我要值添加到我的靜態QMAP的欄。我在哪裏以及如何做到這一點?
Qt添加一些C++ 11支持的時間! –