128 lines
2.3 KiB
C++
128 lines
2.3 KiB
C++
#ifndef DATEVARSET_H
|
|
#define DATEVARSET_H
|
|
|
|
#include <QWidget>
|
|
#include "ParaSettingUI.h"
|
|
#include <QTextEdit>
|
|
#include <QTextCharFormat>
|
|
#include <QStringList>
|
|
#include <QList>
|
|
|
|
#include "scene/PicDateItem.h"
|
|
#include "scene/ItemGeneralSettings.h"
|
|
|
|
namespace Ui {
|
|
class DateVarSet;
|
|
}
|
|
|
|
class DateVarSet : public QWidget,public ParaSettingUI
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DateVarSet(QWidget *parent = 0);
|
|
~DateVarSet();
|
|
|
|
void getValue(int *varType,int *digitalWidth,unsigned char *splitMode);
|
|
|
|
void init();
|
|
|
|
void initUI();
|
|
|
|
// void applyStyleSheet();
|
|
|
|
void bindSysPara(SysPara *sysPara);
|
|
|
|
void bindTxTEdit(QTextEdit* textEdit);
|
|
|
|
void on_buttonInsertVari_pressed();
|
|
|
|
void edit(PicDateItem* item);
|
|
|
|
DateItemModel dateModel();
|
|
|
|
void setDateModel(const DateItemModel& model);
|
|
|
|
QString getFamilyName(int);
|
|
|
|
void loadMonthShow();
|
|
|
|
void loadDataShow();
|
|
|
|
void loadWeekShow();
|
|
|
|
void loadYearShow();
|
|
|
|
void loadDayShow();
|
|
|
|
void loadHourShow();
|
|
|
|
void getMonthValue();
|
|
|
|
void getYearValue();
|
|
|
|
void getHourValue();
|
|
|
|
void getWeekValue();
|
|
|
|
void getDayValue();
|
|
|
|
void useReplaceInsertVar();
|
|
|
|
void initShowLineEdit();
|
|
|
|
void initReplaceValue();
|
|
|
|
QStringList monthList; //替换的内容 月份
|
|
QStringList dataList; //替换的内容 数据
|
|
QStringList weekList; //周几
|
|
QStringList yearList; //年份
|
|
QList<int> yearInitList;
|
|
QStringList dayList;
|
|
QStringList hourList;
|
|
|
|
// QMap<int,QString> monthMap;
|
|
// QMap<int,QMap<int,QString>> monthMap;
|
|
|
|
|
|
// QMap<int,QStringList> map;
|
|
|
|
private slots:
|
|
void buttonClickedSlot();
|
|
|
|
void on_CBDateFormat1_currentIndexChanged(int index);
|
|
|
|
void on_cb_replaceType_currentIndexChanged(int index);
|
|
|
|
void on_btnUP_clicked();
|
|
|
|
void on_btnDown_clicked();
|
|
|
|
void on_btnPreSetValue_clicked();
|
|
|
|
void slt_handleDigits();
|
|
|
|
void onLineEditReplaceChanged(int i, QString txt);
|
|
|
|
signals:
|
|
void sendButtonClickedSignal(int);
|
|
void backSpaceBtn();
|
|
private:
|
|
Ui::DateVarSet *ui;
|
|
|
|
ItemGeneralSettings* m_generalSettings = nullptr;
|
|
|
|
int digitWidth;
|
|
QTextEdit* m_textEdit;
|
|
QTextCharFormat fmt;
|
|
int varTypeSet;
|
|
QString varHtmlStr;
|
|
int currPage;
|
|
|
|
QXmlStreamAttributes m_backup;
|
|
|
|
void applyStyleSheet(); // 应用样式表
|
|
};
|
|
|
|
#endif // DATEVARSET_H
|