2015-03-13 18 views
0

我有循环显示按钮的表。Wt ::信号或绑定?

WTable *my_table = new WTable(); 
int row = 0; vector<WPushButton*> buttons; 
for (vector<map<string, string> >::iterator it = data.begin(); it != data.end(); it++) { 
buttons[row] = new WPushButton("E"); 
my_table->elementAt(row, 0)->addWidget(buttons[row]); 
buttons[row]->clicked().connect(boost::bind(&this->process, WString::tr((*it)["id"]))); 
row++; 
} 
...... 
function ClassName::process(Wstring *str){ 
cout << str << endl; 
} 

问题在于信号的绑定。

如何将循环按钮信号连接到一个函数?

回答

1

它看起来像process()的签名不匹配你试图绑定到它的参数:WString vs WString *。它是否与

void ClassName::process(Wstring str){ 
cout << str << endl; 
}