查看完整版本: [-- 请问QAbstractItemView的子类中是否必须一定要声明:indexAt() --]

QTCN开发网 -> Qt基础编程 -> 请问QAbstractItemView的子类中是否必须一定要声明:indexAt() [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

ceiwei 2017-02-13 14:49

请问QAbstractItemView的子类中是否必须一定要声明:indexAt()

我在一个历程中看到了QModelIndex HistogramView::indexAt(const QPoint &point)const


其中,我没有发现indexAt被程序其他任何代码引用,我就是这删除它,但删除后编译出现moc_histogramview.cpp:-1: error: undefined reference to `HistogramView::indexAt(QPoint const&) const'

那么,是不是就证明indexAt(const QPoint &point)const必须要使用,它的作用又是什么?

15145093145 2017-02-14 09:41
他是纯虚的


virtual QModelIndex
indexAt(const QPoint &point) const = 0


你一定要实现他~


查看完整版本: [-- 请问QAbstractItemView的子类中是否必须一定要声明:indexAt() --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled