Basic JSON RESTful client fetching items from a local server at application start and adding them to the model.

This commit is contained in:
2026-01-25 10:47:19 +01:00
parent e1bc779791
commit e29cd0aebf
8 changed files with 178 additions and 3 deletions

View File

@ -10,6 +10,7 @@ class QString;
class TableModel;
class GeneralSortFilterModel;
class ServerCommunicator;
class GenericCore : public QObject {
Q_OBJECT
@ -32,6 +33,14 @@ class GenericCore : public QObject {
void importCSVFile(const QString& filePath);
bool exportCSVFile(const QString& filePath);
bool isSyncServerSetup() const;
public slots:
void onItemsFetched(const QByteArray jsonDoc);
void onItemsFetchFailure(const QString errorString);
void onPostRequestSuccessful(const QString message);
void onPostRequestFailure(const QString errorString);
signals:
void displayStatusMessage(QString message);
@ -46,6 +55,10 @@ class GenericCore : public QObject {
void initModelData();
QString getMaintenanceToolFilePath() const;
/// Network communication
std::unique_ptr<ServerCommunicator> m_serverCommunicator;
void setupServerConfiguration();
};
#endif // GENERICCORE_H