我有一个循环来显示一个带有按钮的表格。
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;
}问题在于信号的绑定。
如何将循环按钮信号连接到函数?
发布于 2015-04-16 00:27:18
看起来process()的签名与您试图绑定到它的参数不匹配: WString vs WString *。它是否适用于
void ClassName::process( Wstring str ){
cout << str << endl;
}https://stackoverflow.com/questions/29026707
复制相似问题