#ifndef MODELPAGE_H #define MODELPAGE_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct ModelInfo { public: std::string id; std::string name; std::string des; std::string path; std::string type; }; static QList modelList; class ModelAdd : public QDialog { Q_OBJECT public: explicit ModelAdd(QDialog *parent = nullptr); signals: void addModel(); void sendModel(); private: ModelInfo* mModelInfo; QLineEdit* setModelId ; QLineEdit* setModelName; QLineEdit* setModelDes ; QLineEdit* setModelPath ; QLineEdit* setModelType; }; class ModelPage : public QWidget { Q_OBJECT public: explicit ModelPage(QWidget *parent = nullptr); void cptPageData(int count); void cptSubscripRange(int &mStart,int &mEnd); void setPageInfo(int i,int count,int curr); signals: public slots: void onSearchButtonClick(); void onUpButtonClick(); void onNextButtonClick(); void onEditButtonClick(); void onDelButtonClick(); void onShowNews(); private: void displayTable(int nStart,int nEnd); private: QTableView * modelTable; QStandardItemModel * itemModel; QLabel* mPageInfo; QLineEdit* mSetPage; int mTotalCount = 0 ; //一共多少条 int mTotalPage = 0; //一共多少页 int mCurrPage = 0; //当前第几页 int mPerPageCnt = 9; //每页多少条 bool flag = false; }; #endif // MODELPAGE_H