[qet] [1534] Due to a nebulous QPicture-related bug, added a compile-time option to enable the cached rendering of titleblock templates . |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
- To: qet@xxxxxxxxxxxxxxxxxxx
- Subject: [qet] [1534] Due to a nebulous QPicture-related bug, added a compile-time option to enable the cached rendering of titleblock templates .
- From: subversion@xxxxxxxxxxxxx
- Date: Sun, 26 Feb 2012 19:35:48 +0100
Revision: 1534
Author: xavier
Date: 2012-02-26 19:35:48 +0100 (Sun, 26 Feb 2012)
Log Message:
-----------
Due to a nebulous QPicture-related bug, added a compile-time option to enable the cached rendering of titleblock templates.
Modified Paths:
--------------
branches/0.3/qelectrotech.pro
branches/0.3/sources/titleblocktemplaterenderer.cpp
Modified: branches/0.3/qelectrotech.pro
===================================================================
--- branches/0.3/qelectrotech.pro 2012-02-26 18:34:24 UTC (rev 1533)
+++ branches/0.3/qelectrotech.pro 2012-02-26 18:35:48 UTC (rev 1534)
@@ -163,3 +163,11 @@
}
}
}
+
+# 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
+}
+
Modified: branches/0.3/sources/titleblocktemplaterenderer.cpp
===================================================================
--- branches/0.3/sources/titleblocktemplaterenderer.cpp 2012-02-26 18:34:24 UTC (rev 1533)
+++ branches/0.3/sources/titleblocktemplaterenderer.cpp 2012-02-26 18:35:48 UTC (rev 1534)
@@ -61,6 +61,7 @@
void TitleBlockTemplateRenderer::render(QPainter *provided_painter, int titleblock_width) {
if (!titleblock_template_) return;
+#ifdef QET_TBT_USE_QPICTURE_BASED_CACHE
// Do we really need to calculate all this again?
if (titleblock_width != last_known_titleblock_width_ || rendered_template_.isNull()) {
renderToQPicture(titleblock_width);
@@ -69,6 +70,9 @@
provided_painter -> save();
rendered_template_.play(provided_painter);
provided_painter -> restore();
+#else
+ titleblock_template_ -> render(*provided_painter, context_, titleblock_width);
+#endif
}
/**