1 #ifndef ABOUNTWIDGET_H 2 #define ABOUNTWIDGET_H 3 4 #include <QWidget> 5 #include "iwidget.h" 6 #include <QThread> 7 8 namespace Ui { 9 class AboutWidget; 10 } 11 12 class FetcherSystem; 13 class AbountWidget : public IWidget 14 { 15 Q_OBJECT 16 Q_PLUGIN_METADATA(IID PLUGIN_INTERFACE_iid FILE "about.json") 17 18 public: 19 explicit AbountWidget(QWidget *parent = 0); 20 ~AbountWidget(); 21 virtual QString id()override; 22 virtual void loadData(const QDomElement &head, const QDomElement &body) override; 23 private: 24 Ui::AboutWidget *ui; 25 FetcherSystem *m_fetcher; 26 bool m_bQuit; 27 }; 28 29 class FetcherSystem : public QThread 30 { 31 Q_OBJECT 32 public: 33 FetcherSystem(QObject *parent=Q_NULLPTR); 34 void getInfomartion( QString &storage, 35 QString &memTotal, 36 QString &memFree, 37 QString &memAvailable, 38 QString &kerVersion, 39 QString &userCpu); 40 41 protected: 42 virtual void run(); 43 44 private: 45 QString m_storage; 46 QString m_memTotal; 47 QString m_memFree; 48 QString m_memAvailable; 49 QString m_kerVersion; 50 QString m_userCpu; 51 }; 52 53 #endif // ABOUNTWIDGET_H 54