mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Due to a nebulous QPicture-related bug, added a compile-time option to enable the cached rendering of titleblock templates.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1534 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -163,3 +163,11 @@ unix {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# From Qt 4.8, we disable the QPicture-based cache for titleblock rendering
|
||||||
|
# because it leads to bad rendering then crash.
|
||||||
|
contains(QT_VERSION, ^4\\.[0-7]\\..*) {
|
||||||
|
message("Detected Qt < 4.8: disabling QPicture-based cache for titleblock rendering.")
|
||||||
|
DEFINES += QET_TBT_USE_QPICTURE_BASED_CACHE
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ int TitleBlockTemplateRenderer::height() const {
|
|||||||
void TitleBlockTemplateRenderer::render(QPainter *provided_painter, int titleblock_width) {
|
void TitleBlockTemplateRenderer::render(QPainter *provided_painter, int titleblock_width) {
|
||||||
if (!titleblock_template_) return;
|
if (!titleblock_template_) return;
|
||||||
|
|
||||||
|
#ifdef QET_TBT_USE_QPICTURE_BASED_CACHE
|
||||||
// Do we really need to calculate all this again?
|
// Do we really need to calculate all this again?
|
||||||
if (titleblock_width != last_known_titleblock_width_ || rendered_template_.isNull()) {
|
if (titleblock_width != last_known_titleblock_width_ || rendered_template_.isNull()) {
|
||||||
renderToQPicture(titleblock_width);
|
renderToQPicture(titleblock_width);
|
||||||
@@ -69,6 +70,9 @@ void TitleBlockTemplateRenderer::render(QPainter *provided_painter, int titleblo
|
|||||||
provided_painter -> save();
|
provided_painter -> save();
|
||||||
rendered_template_.play(provided_painter);
|
rendered_template_.play(provided_painter);
|
||||||
provided_painter -> restore();
|
provided_painter -> restore();
|
||||||
|
#else
|
||||||
|
titleblock_template_ -> render(*provided_painter, context_, titleblock_width);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user