c++ - Converting QString to std::string -
i've seen several other posts converting qstring std::string, , should simple. somehow i'm getting error. my code compiled vs project using cmake (i'm using vs express), there's no issue qt libraries, , gui wrote works besides part. i have qcombobox cb holds names objects, , qlineedit lineedit allows me specify name of object looking for. should run function tested , working when press go button, input qcombobox , lineedit arguments. here's code when go button clicked: void gui::on_go_clicked(){ std::string str(cb->currenttext().tostdstring()); //std::cout << str << "\n"; //qstring qstr = lineedit->text(); //std::cout<<lineedit->text().tostdstring(); updatedb(str, lineedit->text().tostdstring()); } the first line, creating str , works fine. i.e. there's no problem library functions or tostdstring() . when executes function, program breaks, , it's not becuase of function, it's b...