尝试在QTableView中编辑单元格时调用QFileDialog
有没有办法在不使用QItemDelegate的情况下执行此操作?我一直遇到很多麻烦。例如,如果我使用委托:
不会有本机对话框。
我必须实现自己的图像预览,
出于某种原因,我无法调整窗口大小因为setGeometry不起作用等等。
QWidget *createEditor(
QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index
) const {
Q_UNUSED(option);
Q_UNUSED(index);
QFileDialog* editor = new QFileDialog(parent);
editor->setFilter("*.png");
editor->setDirectory(mResources);
editor->setGeometry(0,0,1000,500);
editor->exec() // <--- big file dialog;
return editor; // <--- tiny file dialog;
};
没有找到相关结果
已邀请:
2 个回复
联海
杭难插