Qt 项目图片压缩库环境配置教程
适用平台:Windows (MinGW) / macOS (Apple Silicon)
涉及库:libpng · zlib · libimagequant
用途:Qt 项目中对 PNG 进行缩放后有损压缩,效果接近 tinypng
适用平台:Windows (MinGW) / macOS (Apple Silicon)
涉及库:libpng · zlib · libimagequant
用途:Qt 项目中对 PNG 进行缩放后有损压缩,效果接近 tinypng
今天在项目中需要添加一个柱状图,但由于我们的项目是 QT 4.8 的所以不支持 QtCharts。查询了下发现有 QCustomPlot 可以完美的实现需求,使用方法也很简单。
官网:https://www.qcustomplot.com/
下载:https://www.qcustomplot.com/index.php/download
当一个数据复制为兼容格式的类型时,隐式转换可以自动完成。
请看下面示例:
double a = 100.1;
int b;
b = a;
cout << b << endl;
//output:
//100 在实际使用中发现对字符串的运用是一个容易混乱的地方,尤其是使用指针指向一个字符串数组的时候。下面做一些简单分析。
一个简单的测试:
const char* test1 = "abc";
const string test2 = "abc";
cout << test1 << endl;
cout << *test1 << endl;
cout << test2 << endl;
cout << sizeof (test1) << endl;
cout << sizeof (test2) << endl;输出如下:
abc
a
abc
8
24 在 c++ 中,一个 Macro 就是一段代码的聚合。使用这个 macro 名称就代表着对应的代码段。
有两种常见的 macro:object 形式,function 形式。可以定义任意有效的字符作为 macro 名称,甚至是 c 关键词。