我想重寫mouseReleaseEvent與一羣QActions和QMenus的...將參數傳遞給插槽
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()。 – 2013-03-07 17:41:12