qt/daylite/mainwindow.h

48 lines
993 B
C
Raw Normal View History

2025-05-06 18:28:05 +08:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "gutil/qgui.h"
#include "gutil/qjson.h"
#include <QButtonGroup>
#include <QLineEdit>
#include <QUdpSocket>
struct Card {
QLabel *lbName;
QLineEdit *edName;
QComboBox *edId;
QLabel *lbStatus;
QLabel *lbAlias, *lbCur;
QButtonGroup *btnGrp;
QString id;
QString ip;
std::vector<QToolButton *> btns;
std::vector<QLineEdit *> edits;
bool online = false;
};
class MainWindow : public QWidget {
Q_OBJECT
public:
MainWindow();
~MainWindow();
void readfile();
void addPart(VBox *);
void click();
void edit();
void sendGetInfo();
bool SendAnycastCmd(int, const Card &);
void getNames(const Card &);
JObj cfg;
QPushButton *btnEdit, *btnOK, *btnCcl, *btnChg;
QUdpSocket mUdpSocket;
std::vector<Card> cards;
std::vector<std::vector<QIcon>> iconss;
int timerId = 0;
protected:
void timerEvent(QTimerEvent *event);
};
#endif // MAINWINDOW_H