如何从 Qtreeview 中删除项目?
基本上我想从继承的 dropEvent(QDropEvent *event) 上的 Qtreeview 中删除项目 在 qtreeview 子类中。 最好的方法是什么?
basically i want to remove item from Qtreeview on the dropEvent(QDropEvent *event) inherited
in a qtreeview subclass.
what is the best way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过 http://doc.trolltech.com/4.7/qabstractitemview 访问模型。 html#model 方法。您可以使用 http://doc.trolltech.com/4.7/ 获取当前鼠标位置下的索引qabstractitemview.html#indexAt 方法。最后您可以使用 http://doc.trolltech.com/4.7/qabstractitemmodel.html #removeRow 删除所需的索引
You can get to the model with http://doc.trolltech.com/4.7/qabstractitemview.html#model method. You can get index under current mouse pos with http://doc.trolltech.com/4.7/qabstractitemview.html#indexAt method. At the end you can use http://doc.trolltech.com/4.7/qabstractitemmodel.html#removeRow to remove desired index