2024-02-06 06:27:07 +00:00
|
|
|
|
#ifndef PATTERNSELECTWIDGET_H
|
|
|
|
|
#define PATTERNSELECTWIDGET_H
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
#include <QDir>
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
|
|
|
|
#include "mybutton.h"
|
|
|
|
|
#include "items/fileitem.h"
|
|
|
|
|
#include "setcontrolstyle.h"
|
|
|
|
|
//#include "Include/datafiledst.h"
|
|
|
|
|
//#include "Include/datafilecomb.h"
|
|
|
|
|
//#include "Include/embdata.h"
|
|
|
|
|
#include "datafile/datafiledst.h"
|
|
|
|
|
#include "datafile/datafiledsr.h"
|
|
|
|
|
#include "promptdialog.h"
|
|
|
|
|
#include <QMouseEvent>
|
|
|
|
|
#include <QDateTime>
|
|
|
|
|
#include "mctype/mainwidgetfunction.h"
|
|
|
|
|
|
|
|
|
|
#define EMBALLOWNEEDLELIMIT 2000000 //绣作允许最大针数上限
|
|
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class PatternSelectWidget;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class PatternSelectWidget : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit PatternSelectWidget(QWidget *parent = 0);
|
|
|
|
|
~PatternSelectWidget();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Ui::PatternSelectWidget *ui;
|
|
|
|
|
int m_itemPerPage;//花样选择界面每页图片数
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void initControl();//初始化窗体控件,包括位置、尺寸、样式
|
|
|
|
|
void initResolution1910();//初始化窗体控件为1920x1080分辨率
|
|
|
|
|
void initResolution1006();
|
|
|
|
|
void initControlStyle();//初始化窗体控件样式
|
|
|
|
|
void initArabControlPos();//设置阿拉伯语时控件对齐方式
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QString m_firstFilePath;//文件一级目录
|
|
|
|
|
QString m_curFilePath;//当前选择目录
|
|
|
|
|
QList<FileItem> m_fileItemList;//花样选择界面花样文件列表
|
|
|
|
|
|
|
|
|
|
int m_curPages;//花样选择界面当前页数
|
|
|
|
|
int m_backUpDirPages;//上一级当前页数
|
|
|
|
|
int m_pageNums;//总页数
|
|
|
|
|
int m_selectedPattenIdx;//被选中的花版号
|
|
|
|
|
u8 m_beadSequinTable[BEADSEQUINTYPE]; // 珠片码与散珠/亮片动作码对应表
|
|
|
|
|
QList<MyButton*> m_imageButtonList;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void initialize();//初始化
|
|
|
|
|
void initPattern();//初始化花样
|
|
|
|
|
void getDirPatternFiles(QString dirPath);//获取路径下的花样
|
|
|
|
|
void refreshPageUi();//刷新界面显示
|
|
|
|
|
void refreshCheckedPage();//刷新条目选中状态
|
|
|
|
|
void refreshChecked();//刷新条目选中状态
|
|
|
|
|
void clickItem(int idx);//点击花样图片
|
|
|
|
|
void clearFileInfo();//清空花样信息
|
|
|
|
|
void getFileInfo(QString filePath, QString suffix);//获取花样信息
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
void setTypeLogo(QString tStyle);//设置类型图标
|
|
|
|
|
void setMainTitle(QString str);//设置主title
|
|
|
|
|
void setSubTitle(QString str);//设置副title
|
|
|
|
|
void createCurDirPatterns();//生成当前路径花样
|
|
|
|
|
inline u8* getBeadSequinTable(){return m_beadSequinTable;} // 得到珠片码位图
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
QSize getImageSize();//获取绘图区域大小
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
//点击图片按钮事件
|
|
|
|
|
void on_buttonImage1_clicked();
|
|
|
|
|
void on_buttonImage2_clicked();
|
|
|
|
|
void on_buttonImage3_clicked();
|
|
|
|
|
void on_buttonImage4_clicked();
|
|
|
|
|
void on_buttonImage5_clicked();
|
|
|
|
|
void on_buttonImage6_clicked();
|
|
|
|
|
void on_buttonImage7_clicked();
|
|
|
|
|
void on_buttonImage8_clicked();
|
|
|
|
|
void on_buttonImage9_clicked();
|
|
|
|
|
void on_buttonImage10_clicked();
|
|
|
|
|
void on_buttonBackUpDir_clicked();
|
|
|
|
|
void on_buttonPgUp_clicked();
|
|
|
|
|
void on_buttonPgDn_clicked();
|
|
|
|
|
void on_buttonOk_clicked();
|
|
|
|
|
void on_buttonCancel_clicked();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void siSelectPattern(QString filePath, s16 showFlag = 0);//选择花样并点击确定按钮
|
2024-03-01 07:57:37 +00:00
|
|
|
|
void siPatchPattern(QString filePath,s16 showFlag = 0);//贴补绣花样并点击确定按钮
|
2024-02-06 06:27:07 +00:00
|
|
|
|
|
|
|
|
|
//鼠标事件
|
|
|
|
|
protected:
|
|
|
|
|
void mousePressEvent(QMouseEvent *e);
|
|
|
|
|
void mouseReleaseEvent(QMouseEvent *e);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int m_mousePressX;
|
|
|
|
|
int m_mousePressY;
|
|
|
|
|
int m_mouseReleaseX;
|
|
|
|
|
int m_mouseReleaseY;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // PATTERNSELECTWIDGET_H
|