Somebody help me a way...
Somebody help me a way...
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
You don't create table views with the designer.
Do it like this:
Qt Code:
view->setModel(model); model->setTable(<table name>);To copy to clipboard, switch view to plain text mode
Don't forget the declarations for the model, view and header in the .h file.
Set your header column names with model->setHeaderData(<col>, Qt::Horizontal, "col name");
You can edit the data by clicking in the table cells.
Check out the doc here: http://doc.trolltech.com/4.5/model-v...ogramming.html
Thanks!
I mean that, I want to control it, such as: when users try to edit a cell, the default of this cell is a short name off previous cell, how to do like that?
I'm not quite sure I understand what you are trying to do. But if you are trying to modify the contents of a table cell when a user clicks on it, you first need to determine which cell by using QModelIndexList QItemSelectionModel::selectedIndexes () to get the index of the selected cell.
@waynew: I know that features, but I want to process over default functions.
An example: I want to make a auto complete function for editing
Bookmarks