QT使用过程中碰到的问题,想问问各位,为什么这部分运行的时候,粗体部分的两个函数会出现没有运行,反而调用了别的函数的情况
if(cntnum < 5600)
{
if(cntnum == 10)
{
///*发送配置命令*/
}
else if(cntnum == 5010)
{
///*保存数据到文件*/
TestTimer->stop();
**voltageSaveFile();**
TestTimer->start(10);
}
else if(cntnum == 5510)
{
///*处理数据测试*/
TestTimer->stop();
**disposeVoltageData();**
TestTimer->start(10);
}
}
最后发现不是信号与曹的问题。只要把代码中调用两个函数执行改为直接在定时器函数中执行,运行混乱的问题就解决了,出现这种问题的原因还没找到。
QPushButton{//默认样式
border-radius:10px;//圆角
color: rgb(255, 255, 255);//按钮文字颜色
background-color: rgb(124, 200, 78);//按钮颜色
outline: none;//边框设置为无,否则会有一个虚线框
}
QPushButton:pressed{//按下之后的效果
background-color: rgb(112, 185, 68);
}
QPushButton:disabled{//禁用按钮的效果
background-color: rgb(167, 164, 170);
}
你确定这个if 分支一定能进来吗? 这个是在哪个槽函数里吗?