i have a new project build in Qt version 6.4.1 The only thing i did was adding 2 new classes "ressource" and "process". Process uses ressources.
When i generated them, directly without any doubt i have an error in my mainwindow?!
#include <QMainWindow> Error: In included file: filed has incomplete type 'QString'
I didnt change anything.
I use MinGW 64Bit
Thank you, its for a project in University -.-
#ifndef RESSOURCE_H
#define RESSOURCE_H
#include <QDebug>
using namespace std;
class Ressource{
private:
    QString name;
    int ressourceId;
    int count;
public:
    int getRessourceId() const;
    void setRessourceId(int ressourceId);
    const QString &getName() const {
        return name;
    }
    void setName(const QString &name) {
        Ressource::name = name;
    }
    int getCount() const {
        return count;
    }
    void setCount(int count) {
        Ressource::count = count;
    }
    Ressource(QString name, int ressourceId, int count);
    void print();
};
#endif // RESSOURCE_H
#ifndef PROCESS_H
#define PROCESS_H
#include <vector>
#include <ressource.h>
using namespace std;
class Process {
private:
    QString name;
    int processId;
public:
    int getProcessId() const;
    void setProcessId(int processId);
private:
    vector<Ressource> neededRessources;
    vector<Ressource> assignedRessources;
public:
    const QString &getName() const {
        return name;
    }
    void setName(const QString &name) {
        Process::name = name;
    }
    const vector<Ressource> &getNeededRessources() const {
        return neededRessources;
    }
    void setNeededRessources(const vector<Ressource> &neededRessources) {
        Process::neededRessources = neededRessources;
    }
    const vector<Ressource> &getAssignedRessources() const {
        return assignedRessources;
    }
    void setAssignedRessources(const vector<Ressource> &assignedRessources) {
        Process::assignedRessources = assignedRessources;
    }
public:
    Process(QString name,int processId, int min, int max);
    void requestRessource(Ressource ressource, int count);
    void releaseRessource(Ressource ressource, int count);
    void print();
};
#endif // PROCESS_H
Its will be a project, which simulates a Deadlock. For that i need Ressources which are used by Processes. The only thing i did was generating the basic structure of those.
