#ifndef SET_H #define SET_H #include #include #include #include #include "mydevice.h" #include "ui_mydevice.h" #include #include #include #include #include "wireless/wirelessmodel.h" #include #include #include "flyme/flyme.h" #include "timer/switchbutton.h" #include QT_BEGIN_NAMESPACE namespace Ui { class set; } QT_END_NAMESPACE class SwitchButton; class mydevice; class FloatingButton; class Comnet : public QObject { Q_OBJECT public: explicit Comnet(QObject *parent = nullptr); Q_INVOKABLE void getValFromQml(int v) { qDebug() << "value from qml is :" << v; emit valueFromCpp(123); } signals: void valueFromCpp(int val); }; class set : public QMainWindow { Q_OBJECT public: int i; set(QWidget *parent = nullptr); ~set(); private slots: void on_pushButton_2_clicked(); void on_pushButton_3_clicked(); private: Ui::set *ui; /*监控按键 */ SwitchButton *switchButton; /* 我的设备对象 */ mydevice *device; /* 声明 QPushButton 对象 */ QPushButton *pushButton[5]; /* 声明 label 对象 */ QLabel *label[6]; /* 声明 PushButton添加图案 */ void setButtonImage(QPushButton *button, QString image); /* 布局初始化 */ void layout_init(); /* 布局初始化qml */ QQmlApplicationEngine *m_engine; bool m_windowShow; bool m_realLoad; QProcess *cmd; QProcess *cmd_stop; FloatingButton *floatingbutton; private slots: /* 开关按钮点击 */ void switchButtonClicked(bool); void readoutput(); void readerror(); /*悬浮球 */ void onButtonPressed(); /*悬浮球 */ // void wifi(); signals: void set_close(bool t); }; #endif // SET_H