Files
energy_storage/src/qt/MainApp.h

53 lines
876 B
C
Raw Normal View History

2025-09-22 20:01:41 +08:00
#include <QMainWindow>
#include <QLabel>
#include <QPushButton>
#include <QHBoxLayout>
#include <string>
using namespace std;
class LabelPair
{
public:
LabelPair(QWidget* parent, int x, int y, int w, int h)
{
title.setParent(parent);
value.setParent(&title);
title.setGeometry(x, y, w, h);
value.setGeometry(80, 0, w-80, h);
title.show();
value.show();
}
void setTitle(std::string text)
{
title.setText(text.c_str());
}
void setValue(std::string text)
{
value.setText(text.c_str());
}
QLabel title;
QLabel value;
};
class MainApp : public QWidget
{
Q_OBJECT
public:
MainApp();
void setMyLayout();
struct {
std::shared_ptr<LabelPair> weburl {};
} ui;
struct {
std::shared_ptr<QGridLayout> main;
} layout;
};