我想转发delcare此嵌套类,我已经尝试过,但我没有工作。 当我尝试着声明我得到倾斜存取权限私有成员的错误,所以我想我做错了什么。
#ifndef PLAYERHOLDER_H
#define PLAYERHOLDER_H
#include <QtCore>
#include <player.h>
#include <datasource.h>
class PLAYERHOLDER
{
private:
class CONTACTMODEL : public QAbstractTableModel
{
public:
explicit CONTACTMODEL(PLAYERHOLDER* holder);
int rowCount( const QModelIndex &parent ) const;
int columnCount( const QModelIndex &parent ) const;
QVariant data( const QModelIndex &index, int role ) const;
QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
void update();
private:
static PLAYERHOLDER* m_playerHolder;
};
public:
static PLAYERHOLDER* getInstance();
void createPlayer(PLAYER *player);
void updatePlayer(int id);
void deletePlayer(int id);
PLAYER* findPlayer(int id);
void loadPlayers(int teamid);
QAbstractItemModel* model() ;
private:
PLAYERHOLDER();
static PLAYERHOLDER *thePlayerholder;
QHash<int, PLAYER*> playerlist;
DATASOURCE *datasource;
mutable CONTACTMODEL *m_model;
};
#endif // PLAYERHOLDER_H
但我不知道怎么做了,我四处搜寻,仍然不知道它:(是否有可能转发申报呢?