資源簡介
QT屬性表改變值操作demo

代碼片段和文件信息
#include?“log.h“
#include?
#include?????
#include??
#include?
void?Log::defaultLogHandle(LogLevel?level?const?char?*msg){
std::cout?<}
FILE?*?Log::mFp?=?NULL;
LogLevel?Log::mLevel?=?Info;
void(*Log::mCallback)(LogLevel?level?const?char*)?=?NULL;
bool?Log::init(const?char*logFn?LogLevel?level?void(*callback)(LogLevel?level?const?char?*msg)){
mLevel?=?level;
if?(callback?!=?NULL)
mCallback?=?callback;
if?(NULL?!=?mFp){
fclose(mFp);
mFp?=?NULL;
}
mFp?=?fopen(logFn?“w“);
return??mFp?!=?NULL;
}
#define?MAX_LOG_LENGTH?1024
void?Log::write(LogLevel?level?const?char?*msg?...){
if?(mFp?==?NULL?||?level? return;
const?char?*typeNames[3]?=?{?“DBG“?“INF“?“ERR“?};
va_list?args;
va_start(args?msg);
char?buf[MAX_LOG_LENGTH];
time_t?tNowTime;
time(&tNowTime);
tm*?tLocalTime?=?localtime(&tNowTime);
strftime(buf?30?“[%Y-%m-%d?%H:%M:%S]?“?tLocalTime);
int?tLen?=?strlen(buf);
vsnprintf(buf?+?tLen?MAX_LOG_LENGTH?-?tLen?msg?args);
char?finalOutBuf[MAX_LOG_LENGTH];
sprintf(finalOutBuf?“%s?%s\n“?typeNames[(int)level]?buf);
fprintf(mFp?finalOutBuf);
fflush(mFp);
if?(NULL?!=?mCallback)
{
(*mCallback)(level?finalOutBuf);
}
va_end(args);
}
void?Log::close()
{
if?(NULL?!=?mFp)
fclose(mFp);
mFp?=?NULL;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????117563??2017-03-16?10:46??property\property\Debug\log.obj
?????文件?????196093??2017-03-16?10:46??property\property\Debug\main.obj
?????文件?????195830??2017-03-16?10:46??property\property\Debug\moc_propertychanged.obj
?????文件?????146967??2017-03-16?10:46??property\property\Debug\moc_qtpropertybrowserutils_p.obj
?????文件???????2270??2017-03-16?10:46??property\property\Debug\property.Build.CppClean.log
?????文件???????3776??2017-03-16?10:46??property\property\Debug\property.log
?????文件??????16384??2017-03-16?10:46??property\property\Debug\property.tlog\cl.command.1.tlog
?????文件?????282678??2017-03-16?10:46??property\property\Debug\property.tlog\CL.read.1.tlog
?????文件???????4696??2017-03-16?10:46??property\property\Debug\property.tlog\CL.write.1.tlog
?????文件??????15006??2017-03-16?10:46??property\property\Debug\property.tlog\custombuild.command.1.tlog
?????文件???????2492??2017-03-16?10:46??property\property\Debug\property.tlog\custombuild.read.1.tlog
?????文件???????3102??2017-03-16?10:46??property\property\Debug\property.tlog\custombuild.write.1.tlog
?????文件???????3316??2017-03-16?10:46??property\property\Debug\property.tlog\li
?????文件???????5416??2017-03-16?10:46??property\property\Debug\property.tlog\li
?????文件???????1518??2017-03-16?10:46??property\property\Debug\property.tlog\li
?????文件????????145??2017-03-16?10:46??property\property\Debug\property.tlog\property.lastbuildstate
?????文件?????332258??2017-03-16?10:46??property\property\Debug\propertychanged.obj
?????文件?????430214??2017-03-16?10:46??property\property\Debug\qtbuttonpropertybrowser.obj
?????文件????3008832??2017-03-16?10:46??property\property\Debug\qteditorfactory.obj
?????文件?????396091??2017-03-16?10:46??property\property\Debug\qtgroupboxpropertybrowser.obj
?????文件?????746755??2017-03-16?10:46??property\property\Debug\qtpropertybrowser.obj
?????文件?????423804??2017-03-16?10:46??property\property\Debug\qtpropertybrowserutils.obj
?????文件????2068708??2017-03-16?10:46??property\property\Debug\qtpropertymanager.obj
?????文件?????493922??2017-03-16?10:46??property\property\Debug\qttreepropertybrowser.obj
?????文件????1807789??2017-03-16?10:46??property\property\Debug\qtvariantproperty.obj
?????文件????4689920??2017-03-16?10:46??property\property\Debug\vc120.pdb
?????文件???????3860??2017-03-16?10:46??property\property\GeneratedFiles\Debug\moc_propertychanged.cpp
?????文件???????6032??2017-03-16?10:46??property\property\GeneratedFiles\Debug\moc_qtbuttonpropertybrowser.cpp
?????文件??????61861??2017-03-16?10:46??property\property\GeneratedFiles\Debug\moc_qteditorfactory.cpp
?????文件???????4023??2017-03-16?10:46??property\property\GeneratedFiles\Debug\moc_qtgroupboxpropertybrowser.cpp
............此處省略129個文件信息
- 上一篇:snort-2.9.11源碼
- 下一篇:datcom 計算導彈氣動參數2011版
評論
共有 條評論