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;
}
問題在於信號的綁定。
如何將循環按鈕信號連接到一個函數?