ich habe hier eine einfache Klasse mit einigen Attributen und Get-Methoden. Wirklich nichts besonderes:
Code: Alles auswählen
class plItem
{
public:
plItem();
plItem(q_int32 tId, q_int32 tLon, q_int32 tLat);
plItem(q_int32 tId, QString tName, q_int32 tCat, q_int32 tLon, q_int32 tLat);
~plItem(void);
q_int32 getID();
QString getplName();
q_int32 getplCat();
q_int32 getplLon();
q_int32 getplLat();
private:
q_int32 plID;
QString plName;
q_int32 plCat;
q_int32 plLon;
q_int32 plLat;
};
Code: Alles auswählen
#pragma once
#include <QtGui>
#include <QString>
#include <QHash>
#include "plItem.h"
class PL_Controller
{
public:
PL_Controller(void);
~PL_Controller(void);
void addNewPL(q_int32, QString, q_int32, q_int32, q_int32);
private:
QHash<q_int32, plItem> dynamicPOIs;
};
Code: Alles auswählen
#include "PL_Controller.h"
PL_Controller::PL_Controller(void)
{
dynamicPOIs = new QHash();
}
void PL_Controller::addNewPL(pi_int32 tID, SDString tName, pi_int32 tCat, pi_int32 tLon, pi_int32 tLat)
{
//
plItem tPI = new plItem(tID, tName, tCat, tLon, tLat);
this->dynamicPOIs.insert(tID, tPI);
}
POI_Controller::~POI_Controller(void)
{
}
Ich danke für alle Hinweise!1>------ Build started: Project: AT_mod_Pl, Configuration: Debug Win32 ------
1>Compiling...
1>PL_Controller.cpp
1>.\PL_Controller.cpp(5) : error C2955: 'QHash' : use of class template requires template argument list
1> c:\qt\qt-win-opensource-src-4.5.0\include\qtcore\../../src/corelib/tools/qhash.h(253) : see declaration of 'QHash'
1>.\PL_Controller.cpp(5) : error C2512: 'QHash' : no appropriate default constructor available
1>.\PL_Controller.cpp(11) : error C2440: 'initializing' : cannot convert from 'plItem *' to 'plItem'
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>CPLDockWidget.cpp
1>M:\Eigene Dateien\project\srcz\AT_plugins\AT_mod_Pl\CPLDockWidget.cpp(97) : error C2248: 'CModPl::importPls' : cannot access private member declared in class 'CModPl'
1> m:\eigene dateien\project\srcz\AT_plugins\AT_mod_Pl\CModPl.h(127) : see declaration of 'CModPl::importPls'
1> m:\eigene dateien\project\srcz\AT_plugins\AT_mod_Pl\CModPl.h(45) : see declaration of 'CModPl'
1>Generating Code...
1>Build log was saved at "C:\Eigene Dateien\project\build-vs9-wPl\AT_mod_Pl\AT_mod_Pl.dir\Debug\BuildLog.htm"
1>AT_mod_Pl - 4 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
Achja: Visual Studio 2008 mit Qt.
Mfg Huck