【发布时间】:2011-07-06 09:45:09
【问题描述】:
我想用一堆 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()));
所以我想将参数传递给插槽onStepIncreased(您可以想象它们是 1、5、10、25、50)。你知道我该怎么做吗?
【问题讨论】:
-
考虑分析信号内部的sender(),而不是传递参数。
标签: qt qsignalmapper qt-slot