FemaLocalSoftware/mainwindow.h

68 lines
1.3 KiB
C
Raw Normal View History

2024-11-24 09:48:52 +00:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
2024-12-16 08:38:04 +00:00
#include "flowlayout.h"
#include "sensorwidget.h"
#include "sensorservice.h"
#include "httpclient.h"
2024-11-24 09:48:52 +00:00
#include <QMainWindow>
#include <QPixmap>
#include <QVBoxLayout>
2024-11-28 18:34:00 +00:00
#ifdef Q_OS_WIN
#include <Qlabel>
2024-11-28 18:34:00 +00:00
#elif defined(Q_OS_LINUX)
#include <QLabel>
2024-11-28 18:34:00 +00:00
#endif
2024-11-24 09:48:52 +00:00
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
2024-11-28 18:34:00 +00:00
struct TabImageData
{
QLabel *label;
QPixmap pixmap;
QSize originalSize;
};
2024-11-24 09:48:52 +00:00
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
Ui::MainWindow *ui;
private:
2024-12-16 08:38:04 +00:00
HttpClient *httpClient;
QWidget *widgetContainer;
FlowLayout *layout;
SensorService *sensorService;
private:
2024-12-16 08:38:04 +00:00
//dialog windows
void showSensorDialog(SensorWidget *sensor);
void onSensorDialogFinished(int result);
//api requests
void loadSensors(const QString& group);
void loadSensorGroups();
//update sensor widgets
void updateDisplayedWidgets();
void onSearchTextChanged(const QString &text);
void onGroupSelected(int index);
void onShowHiddenSelected(int index);
//sensor tab utility
void startSensorTabRefreshTimer();
void SetupSensorTab();
2024-11-24 09:48:52 +00:00
};
#endif // MAINWINDOW_H