1 Star 0 Fork 0

奇天/OFDeditor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
paper.h 1.69 KB
一键复制 编辑 原始数据 按行查看 历史
张康康 提交于 2019-07-04 14:56 . first project, just to remember
#ifndef PAPER_H
#define PAPER_H
#include <QTextEdit>
#include <QTextDocument>
#include <QTextFrame>
#include <QTextFrameFormat>
#include <QDebug>
#include <QImage>
#include <QImageReader>
#include <QMimeData>
#include <QFileInfo>
//ofd文件按照正常值*5的比例进行变化存取
const double A4width = 210*5;
const double A4height = 297*5;
const double B5width = 210*5;
const double B5height = 276*5;
const double A5width = 148*5;
const double A5height = 210*5;
typedef struct paperMargin
{
double topMargin;
double bottomMargin;
double leftMargin;
double rightMargin;
}PaperMargin;
class Paper : public QTextEdit
{
Q_OBJECT
public:
Paper(QWidget *parent = 0);
void initPaper();
void setHeight(double);
void setWidth(double);
double getHeight();
double getWidth();
void setPaperMargin(double, double, double, double);
void setLeftMargin(double);
void setRightMargin(double);
void setTopMargin(double);
void setBottomMargin(double);
void setFrameMargin();
void setLineDistance(double);
void setLetterDistanceScale(double);
double getLetterDistanceScale();
double getLineDistance();
PaperMargin getPaperMargin();
QTextDocument* getPaperDocument();
void insertImage(QString, double, double);
int getPaperNum();
void setPaperNum(int);
private:
QTextDocument *doc;
QTextFrame *rootFrame;
PaperMargin paperMargin;
double height;
double width;
int num; //加载htmlye'm页面时计数用
double lineDistance;
double letterDistanceScale; //字距比例
signals:
void textEditIsEmpty();
public slots:
void ifIsEmpty();
void resetPaper();
};
#endif // PAPER_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chuck_wilson/OFDeditor.git
[email protected]:chuck_wilson/OFDeditor.git
chuck_wilson
OFDeditor
OFDeditor
master

搜索帮助