c++ - Creating a text editor in Qt with QTableWidget -


i want create gui allow user open desired .txt file pressing browse button. text file should loaded gui further processing @ later stage.

void dictionary::on_browsebutton_clicked() {     qstringlist filenames = qfiledialog::getopenfilenames(this, tr("open file"),"/path/to/file/",tr("txt files (*.txt)"));     ui->tablewidget->additems(filenames); } 

the error class 'qtablewidget' has no member name 'additems'.

what 'qtablewidget'?

i new working classes , hoping explain went wrong.

i'm assuming gui has table widget, hence qtablewidget. take @ qtablewidget class documentation; there's no additems() method, why you're getting error.

whatever code you're working expecting additems() method add data qtablewidget you'll have implement yourself, , rewrite code doesn't try call additems() qtablewidget. so, you'll need use qtablewidgetitem class , setitem() method, in example code (taken qtablewidget documentation):

qtablewidgetitem *newitem = new qtablewidgetitem(tr("%1").arg((row+1)*(column+1))); tablewidget->setitem(row, column, newitem); 

Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -