The VTextManager class this class is used to determine whether a collection of text lines can fit into specified bounding box and with what font size. More...
#include <vtextmanager.h>
Public Member Functions | |
VTextManager () | |
VTextManager::VTextManager constructor. More... | |
virtual | ~VTextManager ()=default |
VTextManager (const VTextManager &text) | |
VTextManager & | operator= (const VTextManager &text) |
virtual int | GetSpacing () const |
GetSpacing returns the vertical spacing between the lines. More... | |
void | setFont (const QFont &font) |
SetFont set the text base font. More... | |
const QFont & | GetFont () const |
GetFont returns the text base font. More... | |
void | SetFontSize (int iFS) |
SetFontSize sets the font size. More... | |
void | FitFontSize (qreal fW, qreal fH) |
VTextManager::FitFontSize sets the font size just big enough, so that the text fits into rectangle of size (fW, fH) More... | |
QList< TextLine > | GetAllSourceLines () const |
int | GetSourceLinesCount () const |
VTextManager::GetSourceLinesCount returns the number of input text lines. More... | |
const TextLine & | GetSourceLine (int i) const |
VTextManager::GetSourceLine returns the reference to i-th text line. More... | |
void | Update (const QString &qsName, const VPieceLabelData &data) |
VTextManager::Update updates the text lines with detail data. More... | |
void | Update (VAbstractPattern *pDoc) |
VTextManager::Update updates the text lines with pattern info. More... | |
Private Attributes | |
QFont | m_font |
QList< TextLine > | m_liLines |
Static Private Attributes | |
static QList< TextLine > | m_patternLabelLines = QList<TextLine>() |
The VTextManager class this class is used to determine whether a collection of text lines can fit into specified bounding box and with what font size.
Definition at line 65 of file vtextmanager.h.
VTextManager::VTextManager | ( | ) |
VTextManager::VTextManager constructor.
Definition at line 183 of file vtextmanager.cpp.
|
virtualdefault |
VTextManager::VTextManager | ( | const VTextManager & | text | ) |
Definition at line 188 of file vtextmanager.cpp.
void VTextManager::FitFontSize | ( | qreal | fW, |
qreal | fH | ||
) |
VTextManager::FitFontSize sets the font size just big enough, so that the text fits into rectangle of size (fW, fH)
fW | rectangle width |
fH | rectangle height |
Definition at line 280 of file vtextmanager.cpp.
References TextLine::bold, GetSourceLine(), GetSourceLinesCount(), TextLine::italic, m_font, TextLine::m_iFontSize, TextLine::m_text, MIN_FONT_SIZE, and SetFontSize().
Referenced by VTextGraphicsItem::correctLabel().
const QFont & VTextManager::GetFont | ( | ) | const |
GetFont returns the text base font.
Definition at line 229 of file vtextmanager.cpp.
References m_font.
Referenced by VLayoutPiece::createLabelItem(), VTextGraphicsItem::getFontSize(), VTextGraphicsItem::mouseReleaseEvent(), operator=(), and VTextGraphicsItem::paint().
const TextLine & VTextManager::GetSourceLine | ( | int | i | ) | const |
VTextManager::GetSourceLine returns the reference to i-th text line.
i | index of the requested line |
Definition at line 266 of file vtextmanager.cpp.
References m_liLines.
Referenced by VLayoutPiece::createLabelItem(), FitFontSize(), VTextGraphicsItem::paint(), and anonymous_namespace{vlayoutpiece.cpp}::PieceLabelText().
int VTextManager::GetSourceLinesCount | ( | ) | const |
VTextManager::GetSourceLinesCount returns the number of input text lines.
Definition at line 255 of file vtextmanager.cpp.
References m_liLines.
Referenced by VLayoutPiece::createLabelItem(), FitFontSize(), VTextGraphicsItem::getTextLines(), VTextGraphicsItem::paint(), and anonymous_namespace{vlayoutpiece.cpp}::PieceLabelText().
|
virtual |
GetSpacing returns the vertical spacing between the lines.
Definition at line 209 of file vtextmanager.cpp.
Referenced by VLayoutPiece::createLabelItem(), and VTextGraphicsItem::paint().
VTextManager & VTextManager::operator= | ( | const VTextManager & | text | ) |
Definition at line 193 of file vtextmanager.cpp.
References GetAllSourceLines(), GetFont(), m_font, and m_liLines.
void VTextManager::setFont | ( | const QFont & | font | ) |
SetFont set the text base font.
font | text base font |
Definition at line 219 of file vtextmanager.cpp.
References m_font.
Referenced by VTextGraphicsItem::setFont().
void VTextManager::SetFontSize | ( | int | iFS | ) |
SetFontSize sets the font size.
iFS | font size in pixels |
Definition at line 239 of file vtextmanager.cpp.
References m_font, and MIN_FONT_SIZE.
Referenced by FitFontSize().
void VTextManager::Update | ( | const QString & | qsName, |
const VPieceLabelData & | data | ||
) |
VTextManager::Update updates the text lines with detail data.
qsName | detail name |
data | reference to the detail data |
Definition at line 339 of file vtextmanager.cpp.
References VPieceLabelData::GetLabelTemplate(), anonymous_namespace{vtextmanager.cpp}::InitPiecePlaceholders(), m_liLines, anonymous_namespace{vtextmanager.cpp}::PrepareLines(), anonymous_namespace{vtextmanager.cpp}::PreparePlaceholders(), qApp, and anonymous_namespace{vtextmanager.cpp}::ReplacePlaceholders().
Referenced by VTextGraphicsItem::updateData().
void VTextManager::Update | ( | VAbstractPattern * | pDoc | ) |
VTextManager::Update updates the text lines with pattern info.
pDoc | pointer to the abstract pattern object |
Definition at line 361 of file vtextmanager.cpp.
References VAbstractPattern::getPatternLabelTemplate(), VAbstractPattern::GetPatternWasChanged(), m_liLines, m_patternLabelLines, anonymous_namespace{vtextmanager.cpp}::PrepareLines(), anonymous_namespace{vtextmanager.cpp}::PreparePlaceholders(), anonymous_namespace{vtextmanager.cpp}::ReplacePlaceholders(), and VAbstractPattern::SetPatternWasChanged().
|
private |
Definition at line 90 of file vtextmanager.h.
Referenced by FitFontSize(), GetFont(), operator=(), setFont(), and SetFontSize().
Definition at line 91 of file vtextmanager.h.
Referenced by GetAllSourceLines(), GetSourceLine(), GetSourceLinesCount(), operator=(), and Update().
Definition at line 93 of file vtextmanager.h.
Referenced by Update().