例子程序QtExample/tutorials/modelview/5_edit中有一个函数无法定位
如题。我在学习Qt的过程中遇到了这样一个怪事。附带的例子程序5_edit中MyEdit类的成员函数editCompleted()无法定位。在文档中也鲜有提及。这个成员函数究竟是怎么回事呢?
以上是例子程序mymodel.h
#ifndef MYMODEL_H
#define MYMODEL_H
//! [Quoting ModelView Tutorial]
// mymodel.h
#include <QAbstractTableModel>
#include <QString>
const int COLS= 3;
const int ROWS= 2;
class MyModel : public QAbstractTableModel
{
Q_OBJECT
public:
MyModel(QObject *parent);
int rowCount(const QModelIndex &parent = QModelIndex()) const ;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
Qt::ItemFlags flags(const QModelIndex & index) const ;
private:
QString m_gridData[ROWS][COLS]; //holds text entered into QTableView
signals:
void editCompleted(const QString &);
};
//! [Quoting ModelView Tutorial]
#endif // MYMODEL_H