2015-03-13 17 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; 
}