笔记"/>
qt pushbutton笔记
- 多个按钮连接到一个槽函数
//查询时哪个按键被按下
QPushButton* pBtn= qobject_cast<QPushButton*>(sender());if(pBtn==ui.open_drive)
{cout << "open drive" << endl;
}else if(pBtn==ui.open_slam){cout << "open slam" << endl;
}else if (pBtn==ui.open_other0){cout << "open open_other0" << endl;
}else if (pBtn==ui.open_other1){cout << "open open_other1" << endl;
}else if (pBtn==ui.open_other2){cout << "open open_other2" << endl;
}
- 按钮自锁(按下去不弹出)
checkable 属性打开
更多推荐
qt pushbutton笔记
发布评论