3 Star 11 Fork 11

xin-yue / XQt6

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
XQAlgorithm.h 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef XQALGORITHM_H
#define XQALGORITHM_H
#include<QJsonObject>
#include<QString>
#include<QVariantMap>
#include<QWidget>
#include<qrandom.h>
#include"XAlgorithm.h"
#define isQNULLInfo(args,str) args,#args,str ,__FUNCTION__,__FILE__,__LINE__
#define ISQNULL(args,str)(isQNULL(isQNULLInfo(args,str)))
bool isQNULL(const void* args/*参数数值*/, const char* argsName/*参数名字*/, const char* str/*附加参数*/, const char* funcName/*函数名字*/, const char* filePath/*所在文件路径*/, int line/*所在行号*/);
//qt随机数
#define random(min,max) QRandomGenerator::global()->bounded(min, max)
//递归删除文件
void deleteDirectory(const QString& dirPath);
//递归移动目录
bool moveDir(const QString& srcPath, const QString& dstPath);
// 文件大小转换成可读的字符串,后加B,KB,....
QString readableFileSize(quint64 filesize);
//设置css样式表文件到QWidget
void setCssFile(QWidget* widget, const QString& css);
//正则匹配
bool RegexMatch(const QString& test, const QString& pattern);
//字符串分割
QStringList strtok(const QString& Text, const QString& Delimiter, const bool space=false);
//QWidget居中显示
void centerShow(QWidget* showWidget/*需要显示的*/, QWidget* refer/*参照物*/);
//事件循环暂停
void XQDelayEventLoop(qint64 msec);
//QVariantMap转QJsonObject
QJsonObject variantMap_toJsonObject(const QVariantMap& map);
//QVariantMap转json文本
QByteArray variantMap_toJson(const QVariantMap& map);
//QVariantList转QJsonObject
QJsonObject variantList_toJsonObject(const QVariantList& list);
//QVariantList转json文本
QByteArray variantList_toJson(const QVariantList& list);
//gzip压缩
QByteArray gzipCompress(const QByteArray& data,int leve=-1,int BufferSize=1024);
//gzip解压
QByteArray gzipUnCompress(const QByteArray& data, int BufferSize = 1024);
//deflate压缩
QByteArray deflateCompress(const QByteArray& data, int leve = -1);
//deflate解压
QByteArray deflateUnCompress(const QByteArray& data);
#endif
1
https://gitee.com/xin___yue/XQt6.git
git@gitee.com:xin___yue/XQt6.git
xin___yue
XQt6
XQt6
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891