背景:单线程下,进行加载文件或者其他耗时长的任务时,需要边进行边实时显示进度条。由于单进程原因,直接对QProgressBar 或者其他ui 设值时不能直接在界面上刷新显示。 方案:设值后,调用QCoreApplication::processEvents(),用于在当前事件循环中处理所有当前未处理 Read More
posted @ 2024-06-25 17:54 北冥没有鱼 Views(6) Comments(0) Diggs(0) Edit
一般为了节省内存,一个unsigned char占8bit,分bit进行存储。存储时单个bit对外可以使用bool值,多个连续的bit可以使用unsigned char。 获取/设置单个bit值方法 获取/设置多个连续bit值方法 static bool getBitValue(unsigned c Read More
posted @ 2024-03-27 16:53 北冥没有鱼 Views(14) Comments(0) Diggs(0) Edit
QDialog通过setWindowFlags(Qt::Dialog | Qt:: WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); 可以在Windows下正常显示最大化最小化按钮,但是在Linux下不会显示。 解决方案: setWindow Read More
posted @ 2024-02-29 14:23 北冥没有鱼 Views(105) Comments(0) Diggs(0) Edit
重载QPushButton的paintEvent(QPaintEvent *e) void paintEvent(QPaintEvent *e) { QPushButton::paintEvent(e); //设置画布 QPainter painter(this); //设置原点,默认原点为左上角 Read More
posted @ 2022-01-07 18:06 北冥没有鱼 Views(529) Comments(0) Diggs(0) Edit
1.创建工程 #设置工程名 project($(project_name)) #设置临时变量/修改变量名 set(variable_name variable_value,variable_value1,.. CACHE )#cache可以缓存 #设置工程文件显示分组 SOURCE_GROUP("s Read More
posted @ 2021-12-15 17:25 北冥没有鱼 Views(388) Comments(0) Diggs(0) Edit
posted @ 2021-11-18 16:29 北冥没有鱼 Views(23) Comments(0) Diggs(0) Edit