Qt almost same main menu entries

Posted by user1671710 on Stack Overflow See other posts from Stack Overflow or by user1671710
Published on 2012-10-22T10:38:06Z Indexed on 2012/10/22 11:00 UTC
Read the original article Hit count: 128

Filed under:
|
|

I'm using c++ Qt library and I want to do something which would do :

connect(actionB11, SIGNAL(triggered()), this, SLOT(SetSomething(1, 1)));
connect(actionB12, SIGNAL(triggered()), this, SLOT(SetSomething(1, 2)));
connect(actionB21, SIGNAL(triggered()), this, SLOT(SetSomething(2, 1)));
connect(actionB22, SIGNAL(triggered()), this, SLOT(SetSomething(2, 2)));

The code above doesnt work because SIGNAL function has to have same number and argument types as SLOT function.

Does exist a way how to do it? I dont want to have about 20 function as SetSomething11, SetSomething12 calling SetSomething(1, 1) etc.

© Stack Overflow or respective owner

Related posts about qt

Related posts about menu