Set column as not editable in QTableWidget
- connect(ui->widget,SIGNAL(cellDoubleClicked(int,int)),this,SLOT(column_check(int,int)));
- void Saleorder::column_check(int row,int column)
- {
- if( column == 9 )
- {
- if (itemtot && !itemtot->text().isEmpty())
- {
- }
- }
- }
i tried this but the program is crashed.
Any one help me solve the problem.
Is there is any other way to achieve to make the entire column as not editable
Thanks in advance
8 replies
check this [qt-project.org].
i use this but it displays the below error message. saleorder.cpp:98: error: cannot call member function ‘virtual Qt::ItemFlags QSqlTableModel::flags(const QModelIndex&) const’ without object
Read the compiler message.
flags is not a static function and thus needs an object to be called from. So this:
is not valid code.
If saleorder is derived from QSqlTableModel (which i’d doubt) you can do this:
otherwise you need a QSqlTableModel object
- //or
Maybe this will work in your case:
You must log in to post a reply. Not a member yet? Register here!



