相关疑难解决方法(0)

将参数传递给插槽

我想用一堆QActions和QMenus覆盖mouseReleaseEvent ...

connect(action1, SIGNAL(triggered()), this, SLOT(onStepIncreased()));

connect(action5, SIGNAL(triggered()), this, SLOT(onStepIncreased()));

connect(action10, SIGNAL(triggered()), this, SLOT(onStepIncreased()));

connect(action25, SIGNAL(triggered()), this, SLOT(onStepIncreased()));

connect(action50, SIGNAL(triggered()), this, SLOT(onStepIncreased()));
Run Code Online (Sandbox Code Playgroud)

所以我想把一个参数传递给插槽onStepIncreased(你可以想象它们是1,5,10,25,50).你知道我怎么做吗?

qt qsignalmapper qt-slot

71
推荐指数
3
解决办法
6万
查看次数

标签 统计

qsignalmapper ×1

qt ×1

qt-slot ×1