- 博客(6)
- 收藏
- 关注
原创 QProgressBar样式
无论正确或者错误,保持数值一直在progressBar的右侧,只改变progressBar的进度颜色QProgressBar#updateIpProgressBar[state=true]{ color: green; margin-right:25px; text-align: right;}QProgressBar#updateIpProgressBar[state=false]{ color: red; margin-right:25px; ...
2021-12-30 16:01:12
1923
原创 bat 脚本
int nItemIndex = 0; // 获取索引 QTreeWidgetItemIterator it(ui->treeMaterial); while (*it) { if (*it == items.first()) { break; } ++it; ++nItemIndex; } // 定位 QScrollBar *bar = ui->treeMaterial->verticalScrollBar(); if (bar) {..
2021-05-24 15:45:18
199
原创 qss资源文件使用
#include "mainwindow.h"#include <QApplication>#include <QFile>int main(int argc, char *argv[]){ //create the application and the main window QApplication app(argc, argv); MainWindow w; //open qss file QFile file("path/StyleExample.q.
2021-05-14 18:58:50
430
原创 环境配置中常见的错误
环境:vs2015 update2, qt 5.9.7如果vs和qt都安装完成了,打开之后发现Qt的kits中编译器是空的,此时要打开vs2015,然后new project,然后visual C++中找到需要安装的,都安装一下,记得每次安装完成之后要重启电脑。...
2021-05-14 18:49:16
145
原创 QWindow一直处于Active状态,拦截掉其他QWidget的keyPress事件
同一个QDialog中存在两个以上的QWidget,或者还存在QWindow,并且所有的QWidget都installEventFilter。此时其中一个QWidget一直霸占QEvent的KeyPress,其他的QWidget都收不到Keypress事件。处理办法:1,排除installEventFilter没有写;2,从最外层的QDialog的eventFilter查起,是否能拦截到keypress事件,若拦截不到,继续往外找,从mainwindow层找起。3,如果QDialog能拦截到
2021-04-29 15:05:14
483
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人