You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# pragma once
# include "iGridRowItem.h"
// 对于有单位的生成,目前默认所有的均有单位,为了对齐
class X_GUI_GRIDPTY_EXPORT iGridRowItemUnt : public iGridRowItem
{
Q_OBJECT
public :
explicit iGridRowItemUnt ( iGridRowItem * pParent = nullptr ) ;
~ iGridRowItemUnt ( ) ;
// 范围
virtual void setBounds ( QRectF & rt ) ; //全局
virtual QRectF getRightBounds_Main ( ) ; //右
virtual QRectF getRightBounds_Unt ( ) ;
// 允许在外部调整参数,主要指的是产量单位,处理方/万方问题
virtual void setShowUnit ( QString sUnit , QString sUnitRaw = " " ) ;
virtual QString getUnit ( bool bUnitRaw = false ) ;
protected :
// 绘图
virtual void paint ( QPainter * pPainter ) ;
// 显示单位文本信息
void _paintItemUnit ( QPainter * pPainter , QString s ) ;
// 原始的Painter drawText模式
// ( 该模式在Qt4下, 对于10^4m^3形式, 数字上标不正常, 字母上标还基本OK)
void _paintItemUnit_ByNormal ( QPainter * pPainter , QString s , QRectF rt ) ;
// TextDocument模式, 采用html模式
void _paintItemUnit_ByRich ( QPainter * pPainter , QString s , QRectF rt ) ;
// 格式化 10^4m^3 根据需要转为html
QString _formatToHtmlText ( const QString & s , \
const bool bItalic , \
const QColor & clr , \
const int nFontSize ) ;
protected :
QString m_sUnit ;
QString m_sUnitRaw ; //20250704
} ;