mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-30 14:54:13 +02:00
Remove titleblocktemplate cahing remains.
This commit is contained in:
@@ -8,8 +8,7 @@
|
||||
*/
|
||||
TitleBlockTemplateRenderer::TitleBlockTemplateRenderer(QObject *parent) :
|
||||
QObject(parent),
|
||||
m_titleblock_template(nullptr),
|
||||
m_last_known_titleblock_width(-1)
|
||||
m_titleblock_template(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -38,7 +37,6 @@ void TitleBlockTemplateRenderer::setTitleBlockTemplate(
|
||||
const TitleBlockTemplate *titleblock_template) {
|
||||
if (titleblock_template != m_titleblock_template) {
|
||||
m_titleblock_template = titleblock_template;
|
||||
invalidateRenderedTemplate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +46,6 @@ void TitleBlockTemplateRenderer::setTitleBlockTemplate(
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::setContext(const DiagramContext &context) {
|
||||
m_context = context;
|
||||
invalidateRenderedTemplate();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,30 +103,3 @@ void TitleBlockTemplateRenderer::renderDxf(QRectF &title_block_rect,
|
||||
file_path, color);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief TitleBlockTemplateRenderer::renderToQPicture
|
||||
Renders the titleblock to the internal QPicture
|
||||
@param titleblock_width : Width of the titleblock to render
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::renderToQPicture(int titleblock_width) {
|
||||
if (!m_titleblock_template) return;
|
||||
|
||||
// we render the template on our internal QPicture
|
||||
QPainter painter(&m_rendered_template);
|
||||
|
||||
m_titleblock_template -> render(painter, m_context, titleblock_width);
|
||||
|
||||
// memorize the last known width
|
||||
m_last_known_titleblock_width = titleblock_width;
|
||||
}
|
||||
|
||||
/**
|
||||
@brief TitleBlockTemplateRenderer::invalidateRenderedTemplate
|
||||
Invalidates the previous rendering of the template
|
||||
by resetting the internal QPicture.
|
||||
*/
|
||||
void TitleBlockTemplateRenderer::invalidateRenderedTemplate()
|
||||
{
|
||||
m_rendered_template = QPicture();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user