Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Passing Data to a Slot

$
0
0
Let’s say that I have a method with a connection to a slot: myMethod() { int x = 5; connect(TheButton, SIGNAL, this, SLOT)); <— SIGNAL contains clicked() and SLOT contains myHandler(), but the editor eats it. } myHandler() { // Do something } How do I pass x to the slot? In the real problem, the value of x wouldn’t be fixed as in this example. Please don’t ask me why I need to pass the data. I promise, I need to. Thanks.

Viewing all articles
Browse latest Browse all 18427

Trending Articles