c++ - Selecting the path file for QTableWidgetItem qt -
c++ - Selecting the path file for QTableWidgetItem qt -
hi i'm trying path name link image viewer wont link error on path = (currentdir.absolutefilepath(item->text()) ); can help me. created in qt c++
void window::open(int row, int /* column */) { qtablewidgetitem *item = filestable->item(row, 0); qstring path; path = currentdir.absolutefilepath(item->data(qt::displayrole)).tostring(); qgraphicsview* w = new qgraphicsview(); qgraphicsscene *scn = new qgraphicsscene( w ); w->setscene( scn ); qpixmap pix (path); scn->addpixmap( pix ); w->show(); } `
replace
item->text() with
(item->data(qt::displayrole)).tostring(); and see if works. m not sure.
copy entire line , replace urs. u misplaced brackets thats why u getting error.
path = currentdir.absolutefilepath(( item->data(qt::displayrole) ).tostring()); c++ qt
Comments
Post a Comment