mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Add documentation
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
#include "titleblocktemplate.h"
|
||||
|
||||
/**
|
||||
@brief TitleBlockTemplateRenderer::TitleBlockTemplateRenderer
|
||||
Constructor
|
||||
@param parnet Parent QObject of this renderer
|
||||
@param parent : Parent QObject of this renderer
|
||||
*/
|
||||
TitleBlockTemplateRenderer::TitleBlockTemplateRenderer(QObject *parent) :
|
||||
QObject(parent),
|
||||
@@ -14,12 +15,14 @@ TitleBlockTemplateRenderer::TitleBlockTemplateRenderer(QObject *parent) :
|
||||
}
|
||||
|
||||
/**
|
||||
@brief TitleBlockTemplateRenderer::~TitleBlockTemplateRenderer
|
||||
Destructor
|
||||
*/
|
||||
TitleBlockTemplateRenderer::~TitleBlockTemplateRenderer() {
|
||||
}
|
||||
|
||||
/**
|
||||
@brief TitleBlockTemplateRenderer::titleBlockTemplate
|
||||
@return the titleblock template used for the rendering
|
||||
*/
|
||||
const TitleBlockTemplate *TitleBlockTemplateRenderer::titleBlockTemplate() const {
|
||||
@@ -27,9 +30,11 @@ const TitleBlockTemplate *TitleBlockTemplateRenderer::titleBlockTemplate() const
|
||||
}
|
||||
|
||||
/**
|
||||
@param titleblock_template TitleBlock template to render.
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::setTitleBlockTemplate(const TitleBlockTemplate *titleblock_template) {
|
||||
@brief TitleBlockTemplateRenderer::setTitleBlockTemplate
|
||||
@param titleblock_template : TitleBlock template to render.
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::setTitleBlockTemplate(
|
||||
const TitleBlockTemplate *titleblock_template) {
|
||||
if (titleblock_template != m_titleblock_template) {
|
||||
m_titleblock_template = titleblock_template;
|
||||
invalidateRenderedTemplate();
|
||||
@@ -37,24 +42,26 @@ void TitleBlockTemplateRenderer::setTitleBlockTemplate(const TitleBlockTemplate
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TitleBlockTemplateRenderer::setContext
|
||||
* @param context : Context to use when rendering the titleblock
|
||||
*/
|
||||
@brief TitleBlockTemplateRenderer::setContext
|
||||
@param context : Context to use when rendering the titleblock
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::setContext(const DiagramContext &context) {
|
||||
m_context = context;
|
||||
invalidateRenderedTemplate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TitleBlockTemplateRenderer::context
|
||||
* @return the current diagram context use when render the titleblock
|
||||
*/
|
||||
@brief TitleBlockTemplateRenderer::context
|
||||
@return the current diagram context use when render the titleblock
|
||||
*/
|
||||
DiagramContext TitleBlockTemplateRenderer::context() const {
|
||||
return m_context;
|
||||
}
|
||||
|
||||
/**
|
||||
@return the height of the rendered template, or -1 if no template has been
|
||||
@brief TitleBlockTemplateRenderer::height
|
||||
@return the height of the rendered template,
|
||||
or -1 if no template has been
|
||||
set for this renderer.
|
||||
@see TitleBlockTemplate::height()
|
||||
*/
|
||||
@@ -64,9 +71,10 @@ int TitleBlockTemplateRenderer::height() const {
|
||||
}
|
||||
|
||||
/**
|
||||
@brief TitleBlockTemplateRenderer::render
|
||||
Render the titleblock.
|
||||
@param provided_painter QPainter to use to render the titleblock.
|
||||
@param titleblock_width The total width of the titleblock to render
|
||||
@param provided_painter : QPainter to use to render the titleblock.
|
||||
@param titleblock_width : The total width of the titleblock to render
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::render(QPainter *provided_painter, int titleblock_width) {
|
||||
if (!m_titleblock_template) return;
|
||||
@@ -92,8 +100,9 @@ void TitleBlockTemplateRenderer::renderDxf(QRectF &title_block_rect, int titlebl
|
||||
}
|
||||
|
||||
/**
|
||||
@brief TitleBlockTemplateRenderer::renderToQPicture
|
||||
Renders the titleblock to the internal QPicture
|
||||
@param titleblock_width Width of the titleblock to render
|
||||
@param titleblock_width : Width of the titleblock to render
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::renderToQPicture(int titleblock_width) {
|
||||
if (!m_titleblock_template) return;
|
||||
@@ -108,24 +117,27 @@ void TitleBlockTemplateRenderer::renderToQPicture(int titleblock_width) {
|
||||
}
|
||||
|
||||
/**
|
||||
Invalidates the previous rendering of the template by resetting the internal
|
||||
QPicture.
|
||||
@brief TitleBlockTemplateRenderer::invalidateRenderedTemplate
|
||||
Invalidates the previous rendering of the template
|
||||
by resetting the internal QPicture.
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::invalidateRenderedTemplate() {
|
||||
m_rendered_template = QPicture();
|
||||
}
|
||||
|
||||
/**
|
||||
@param use_cache true for this renderer to use its QPicture-based cache,
|
||||
false otherwise.
|
||||
@brief TitleBlockTemplateRenderer::setUseCache
|
||||
@param use_cache :
|
||||
true for this renderer to use its QPicture-based cache, false otherwise.
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::setUseCache(bool use_cache) {
|
||||
m_use_cache = use_cache;
|
||||
}
|
||||
|
||||
/**
|
||||
@return true if this renderer uses its QPicture-based cache, false
|
||||
otherwise.
|
||||
@brief TitleBlockTemplateRenderer::useCache
|
||||
@return true if this renderer uses its QPicture-based cache,
|
||||
false otherwise.
|
||||
*/
|
||||
bool TitleBlockTemplateRenderer::useCache() const {
|
||||
return(m_use_cache);
|
||||
|
||||
Reference in New Issue
Block a user