我必须根据目录中的文件系统创建项目。我必须使用QGraphicsView而不是(QTreeView/QListView),这样我才能设法为graphicsScene保存一个QModel。有谁能帮助我建议或引用一个示例,说明我如何用QFileModel加载QGraphicsScene。
发布于 2015-03-16 16:06:21
你不需要QFileModel。使用QDir::entryInfoList获取文件列表,使用QFileSystemWatcher跟踪文件系统的修改。
发布于 2015-03-16 14:01:30
只有一个简单的方法来做到这一点,添加视图与模型到现场。是的,它仍然是QTreeView/QListView,但是您可以获得QGraphicsView和QGraphicsScene的所有优点,例如旋转、交互等。
//fill the model and set model to view
ui->tableView->setParent(0);
QGraphicsProxyWidget * proxyView = ui->graphicsView->scene()->addWidget(ui->tableView);
proxyView->setRotation(45);结果:

https://stackoverflow.com/questions/29074117
复制相似问题