免费同城空降app入口在哪
您当前位置:网站首页 >> 知识专区
案例分享:Qt政务标签设计器,标签排版软件定制与打印
文章来源:CSDN 长沙红胖子网络科技有限公司  上传时间:2021-8-20  浏览量:1132

本文链接:https://blog.csdn.net/qq21497936/article/details/119730466

本文章博客地址:https://hpzwl.blog.csdn.net/article/details/119730466
红胖子(红模仿)的博文大全:开发技术集合(包含Qt实用技术、树莓派、三维、OpenCV、OpenGL、ffmpeg、OSG、单片机、软硬结合等等)持续更新中…(点击传送门)

合作案例专栏:案例分享(体验Demo可下载,只定制)


需求

  1.标签设计器;
  2.具备文字排版功能;
  3.支持六种排版格式;
  4.排版后可以输出打印(demo中不包含);
  5.排版后可以输出标签的指定协议文本FBD格式;
  6.可以调整对应标签的一些位置,x,y,宽度,高度,横向间距,纵向间距;
  7.支持排版后的标签预览;
  8.标签排版文本错误提示;


Demo v1.6.0

  在这里插入图片描述
  在这里插入图片描述
  在这里插入图片描述
  在这里插入图片描述
  在这里插入图片描述
  在这里插入图片描述
  在这里插入图片描述

体验下载地址

  CSDN(粉丝免积分下载):https://download.csdn.net/download/qq21497936/21109751
  QQ群:1047134658(点击“文件”搜索“labelDesigner ”,群内与博文同步更新)


模块化

  模块化设计构架:
  在这里插入图片描述


核心源码头文件

Widget.h

#ifndef WIDGET_H 
#define WIDGET_H
#include <QTextCodec> 
#include <QWidget> 
#include <QAbstractButton> 
#include <QFileDialog> 
#include <QMessageBox> 
#include "LabelWidget.h" 
namespace Ui { class Widget; } 
class Widget : 
public QWidget {
 Q_OBJECT public:
 explicit Widget(QWidget *parent = 0); 
~Widget(); 
protected: void initControls();
 void createLabelWidgets(); 
void updateLabelWidgets(); 
void updateScale(); 
QStringList parseNames(QString content); 
protected slots: void slot_updateScale(); 
void slot_buttonClicked(QAbstractButton *pAbstractButton); 
protected: void resizeEvent(QResizeEvent *event); 
private slots: 
void on_spinBox_x_valueChanged(int arg1); 
void on_spinBox_y_valueChanged(int arg1); 
void on_spinBox_xNumber_valueChanged(int arg1); 
void on_spinBox_yNumber_valueChanged(int arg1); 
void on_spinBox_labelWidth_valueChanged(int arg1); 
void on_spinBox_labelHeight_valueChanged(int arg1); 
void on_doubleSpinBox_scale_valueChanged(double arg1); 
void on_spinBox_labelVerticallSpace_valueChanged(int arg1); 
void on_spinBox_labelHorizalSpace_valueChanged(int arg1); 
void on_textEdit_names_textChanged(); 
void on_pushButton_createLabel_clicked(); 
void on_pushButton_export_clicked(); 
private: Ui::Widget *ui; 
private: QList<LabelWidget *> _listLabelWidget;
 QStringList _listNames; QStringList _listErrorNames;
 int _xMM; int _yMM; int _widthMM; 
int _heightMM; int _widthSpace; 
int _heightSpace; int _widthNumber; int _heightNumber; 
bool _firstRotate180; bool _secondRotate180; 
bool _showFontVertical; int _fontPt; }; 
#endif // WIDGET_H 

			

ScreenManager.h

#ifndef SCREENMANAGER_H 
#define SCREENMANAGER_H 
#include <QObject> 
class ScreenManager :
 public QObject { Q_OBJECT public: 
explicit ScreenManager(QObject *parent = nullptr); signals: public slots: 
public: static float getScreenWidthMM(); 
static float getScreenHeightMM(); 
static float getScreenWidthMM(int width); 
static float getScreenHeightMM(int height); 
static int getWidth(); static int getHeight(); 
static int getWidth(float widthMM); 
static int getHeight(float heightMM); 
private: static float inchToMMScale; }; #endif // SCREENMANAGER_H 


			

LabelWidget.h

#ifndef LABELWIDGET_H
#define LABELWIDGET_H 
#include <QWidget> 
#include <QTimer> 
#include <QtMath> 
namespace Ui { class LabelWidget; } 
class LabelWidget : public QWidget { 
Q_OBJECT public: explicit LabelWidget(QWidget *parent = 0); 
~LabelWidget(); public: float getXMM() const; float getYMM() const; 
float getLabelWidthMM() const; 
float getLabelHeightMM() const; 
int getVerticalLabelsNumber() const; 
int getHorizalLabelNumber() const; 
float getScale() const; 
float getLabelHorizalSpaceMM() const; 
float getLabelVerticalSpaceMM() const;
 QStringList getListName() const; 
bool getFirstLabelRotate180() const; 
bool getSecondLabelRotate180() const; 
int getFontPt() const; 
bool getShowFontVertical() const; 
public: void setXMM(float xMM); 
void setYMM(float yMM);
 void setLabelWidthMM(float labelWidthMM); 
void setLabelHeightMM(float labelHeightMM); 
void setVerticalLabelsNumber(int verticalLabelsNumber);
 void setHorizalLabelNumber(int horizalLabelNumber); 
void setScale(float scale); 
void setLabelHorizalSpaceMM(float labelHorizalSpaceMM); 
void setLabelVerticalSpaceMM(float labelVerticalSpaceMM); 
void setLabelsNames(QStringList listName); 
void setFirstLabelRotate180(bool firstLabelRotate180); 
void setSecondLabelRotate180(bool secondLabelRotate180); 
void setFontPt(int fontPt);
void setShowFontVertical(bool showFontVertical); protected:
void initControls(); 
void updateSize(); 
protected slots: 
void slot_initScale(); // 用于规避初始化位置偏差 
protected: void paintEvent(QPaintEvent *event); 
void resizeEvent(QResizeEvent *event); 
protected:
void drawBackground(QPainter *painter); 
void drawLabelBorder(QPainter *painter); 
void drawLabel(QPainter *painter);
private: Ui::LabelWidget *ui; private: 
QColor _backgroundColor; 
QColor _labelBorderColor; 
int _labelBorderWidth; 
float _labelWidthMM; 
float _labelHeightMM; 
float _labelHorizalSpaceMM; 
float _labelVerticalSpaceMM; 
int _verticalLabelsNumber; 
int _horizalLabelNumber; 
float _xMM; 
float _yMM; 
float _pageWidthMM; 
float _pageHeightMM; 
float _scale; 
int _x; 
int _y; 
int _labelWidth; 
int _labelHeight; 
int _pageWidth; 
int _pageHeight; 
int _labelHorizalSpace; 
int _labelVerticalSpace; 
bool _firstLabelRotate180; 
bool _secondLabelRotate180; 
int _fontPt; bool _showFontVertical; 
QStringList _listName; }; #endif 

若该文为原创文章,转载请注明原文出处
本文章博客地址:https://hpzwl.blog.csdn.net/article/details/119730466

30

2022-12

微信附近人200元2小时约一次服务呢--百科

微信附近人200元2小时约一次服务呢--百科

10

2023-03

陌生怎么找附近卖的附近约400钱一次-

陌生怎么找附近卖的附近约400钱一次-

30

2022-12

【腾讯云原生】Eunomia云原生资源编排优化

【腾讯云原生】Eunomia云原生资源编排优化

28

2021-07

有了这7款浏览器插件,浏览器居然“活了”?!

有了这7款浏览器插件,浏览器居然“活了”?!

18

2022-02

静态路由简介及配置

静态路由简介及配置

10

2022-06

DeepMind爆发史:决定AI高峰的“游戏玩家”|深度学习崛起十年

DeepMind爆发史:决定AI高峰的“游戏玩家”|深度学习崛起十年

21

2022-10

9篇分布式机器学习系统经典论文;深度学习硬件的黄金十年|AI系统前沿动态...

9篇分布式机器学习系统经典论文;深度学习硬件的黄金十年|AI系统前沿动态...

15

2021-07

Spring中Bean的作用域与生命周期

Spring中Bean的作用域与生命周期
返回顶部
客服电话
免费同城空降app入口在哪
用微信扫一扫关注我们
请各公司推销人员注意:我单位拒绝任何方式、任何形式的电话推销,请勿拔打我单位客服热线进行电话推销,谢谢合作!
公司名称:免费同城空降app入口在哪里_
免费同城空降app入口在哪里_全国同城约会服务平台_同城快餐wx交流群_同城约茶服务网站,接私活,人到付款,00元3小时上门服务电话,上门服务电话号码、叫小妹服务,100/200/300/400/500/6789、本地同城附近服务,品茶,喝茶,过夜,酒店宾馆,qq,微信,会所,同城包小妹


关键词:知识专区:案例分享:Qt政务标签设计器,标签排版软件定制与打印,免费同城空降app入口在哪里_全国同城约会服务平台_同城快餐wx交流群_同城约茶服务网站,接私活,人到付款,同城服务,品茶,喝茶,过夜,酒店宾馆,qq,做完付款,新茶,微信.查询网上新闻,不限次数,00元,小时,约小姐,上门服务,小妹,100/200/300/400/500/6789,服务 ,喝茶工作室,可约可空降,快餐,联系电话,空降服务附近约茶,品茶,24小时,约会交友,附近喝茶,免费上门,上门服务,接单,小妹电话,上门卖身,个人接单上门服务,二维码,人到付款,微信,qq
云南网站建设,云南网页设计,昆明网站建设,昆明网页设计  网站管理

【版权声明】本站部分内容由互联网用户自行发布,著作权或版权归原作者所有。如果侵犯到您的权益请发邮件致info@ynjwz.com,我们会第一时间进行删除并表示歉意。