| | |
| | | |
| | | } |
| | | |
| | | QWidget *FileDialogDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| | | { |
| | | QFileDialog *fd = new QFileDialog(parent); |
| | | return fd; |
| | | } |
| | | //QWidget *FileDialogDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| | | //{ |
| | | // QFileDialog *fd = new QFileDialog(parent); |
| | | // return fd; |
| | | //} |
| | | |
| | | void FileDialogDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| | | { |
| | |
| | | { |
| | | QString fn = ((QFileDialog *)editor)->getOpenFileName(); |
| | | qDebug()<<index<<fn; |
| | | index.model()->setData(index,fn); |
| | | //index.model()->setData(index,fn); |
| | | model->setData(index,fn); |
| | | } |
| | | |
| | | void FileDialogDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const |