Forward-Deklaration einer verschachtelten Klasse
Ich versuche, delcare diese verschachtelte Klasse weiterzuleiten, ich habe es bereits versucht, aber ich habe nicht gearbeitet. Wenn ich versuche weiterzuleiten, erkläre ich, dass ich nicht auf private Mitglieder zugreifen kann, also tue ich vermutlich etwas falsch.
#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
Aber ich weiß nicht, wie es geht, ich habe gesucht und weiß es immer noch nicht :( Ist es möglich, dies weiterzuleiten?