12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #ifndef MODELPAGE_H
- #define MODELPAGE_H
- #include <QWidget>
- #include <QTableView>
- #include <QPushButton>
- #include <QStandardItemModel>
- #include <QLabel>
- #include <QLineEdit>
- #include <QHBoxLayout>
- #include <QVBoxLayout>
- #include <QComboBox>
- #include <string>
- #include <QHeaderView>
- #include <QSpacerItem>
- #include <QGridLayout>
- #include <QDialog>
- #include <QFont>
- #include <QDebug>
- struct ModelInfo
- {
- public:
- std::string id;
- std::string name;
- std::string des;
- std::string path;
- std::string type;
- };
- static QList<ModelInfo*> 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
|