list - QList in classes with QT Creator/c++ -


how can make qlist so,that list contain information more 1 class (the classes operated 2 map-containers)?

these 4 classes:

class lecture:

  class veranstaltung     {     private:        qmap<qstring, lv >mylv;      public:     veranstaltung() {}     void listlv(qtextstream& out) const;      ...    };      #endif //  

class professorships

    list_h       class professurlist     {     private:         qmap<qstring, professur> myprofessuren;      public:         professurlist() {} //kann man weglassen         void addprof(qtextstream& in,qtextstream& out);         void listprof(qtextstream& out) const; //warum const?        ...     };      #endif // proflist_h 

another class lectures,where private , public defined:

#ifndef lv_h #define lv_h  class lv { private:     qstring mynummer;     qstring mybezeichnung;     qstring mytyp; public:     lv(const qstring& nummer, const qstring& bezeichnung, const qstring& typ):         mynummer(nummer), mybezeichnung(bezeichnung), mytyp(typ)      {}     qstring nummer() const { return mynummer;}      ... }; qtextstream& operator<<(qtextstream& out, const lv& l);   #endif // lv_h 

another class proffessorships private , pubic defined:

  #ifndef prof_h     #define prof_h       class professur     {     private:     qstring mykuerzel;     qstring myname;     qstring mylehrstuhlinhaber;     public:     professur(const qstring& kuerzel, const qstring& name, const qstring& lehrstuhlinhaber):         mykuerzel(kuerzel), myname(name), mylehrstuhlinhaber(lehrstuhlinhaber)     {}     ...     };     qtextstream& operator<<(qtextstream& out, const professur& pr);      #endif // prof_h 

can't create struct x object? like:

struct professorsandlecturs {    veranstaltung v;    lectures l;    ... }; professorsandlecturs pal; pal.v = ...; pal.l = ...;  qlist<professorsandlecturs> list; list.append(pal); 

and later:

list.at(0).l; etc. 

if it's ask for.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -