#ifndef WIRELESSWIDGET_H #define WIRELESSWIDGET_H #include #include #include #include #include #include #include #include #include #include #include #include /** * @brief 无线通讯设置页面 * 提供4G和WIFI通讯配置功能 */ class WirelessWidget : public QWidget { Q_OBJECT public: explicit WirelessWidget(QWidget *parent = nullptr); signals: void backRequested(); private slots: void onWifiScan(); void onWifiConnect(); void onWifiDisconnect(); void onWifiItemClicked(QListWidgetItem *item); void on4GConnect(); void on4GDisconnect(); void onRefreshStatus(); void onTabChanged(int index); private: void setupUI(); QWidget *createTitleBar(); QWidget *createTabBar(); QWidget *createWifiPanel(); QWidget *create4GPanel(); QWidget *createStatusPanel(); void updateWifiList(); void updateConnectionStatus(); // 标题栏 QLabel *m_titleLabel; QPushButton *m_backBtn; // Tab栏 QList m_tabButtons; QStackedWidget *m_contentStack; int m_currentTab; // WiFi面板 QListWidget *m_wifiList; QPushButton *m_wifiScanBtn; QPushButton *m_wifiConnectBtn; QPushButton *m_wifiDisconnectBtn; QLineEdit *m_wifiPasswordEdit; QLabel *m_wifiStatusLabel; QProgressBar *m_wifiSignalBar; // 4G面板 QComboBox *m_apnCombo; QLineEdit *m_apnEdit; QLineEdit *m_4gUsernameEdit; QLineEdit *m_4gPasswordEdit; QPushButton *m_4gConnectBtn; QPushButton *m_4gDisconnectBtn; QLabel *m_4gStatusLabel; QProgressBar *m_4gSignalBar; QLabel *m_simStatusLabel; // 状态面板 QLabel *m_connectionTypeLabel; QLabel *m_ipAddressLabel; QLabel *m_macAddressLabel; QLabel *m_signalStrengthLabel; QLabel *m_uploadSpeedLabel; QLabel *m_downloadSpeedLabel; // 刷新定时器 QTimer *m_statusTimer; // 样式常量 static const QString BUTTON_STYLE; static const QString PRIMARY_BUTTON_STYLE; static const QString DANGER_BUTTON_STYLE; static const QString INPUT_STYLE; static const QString GROUP_STYLE; static const QString TAB_STYLE; static const QString TAB_ACTIVE_STYLE; }; #endif // WIRELESSWIDGET_H