]> git.lyx.org Git - features.git/commitdiff
Cache QTextLayout objects with Qt/Mac
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 18 Apr 2017 12:02:31 +0000 (14:02 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 15 May 2017 08:14:42 +0000 (10:14 +0200)
It seems that the internal Qt5 caching does not work well here,
especially in the case of Herbrew documents.

src/frontends/qt4/GuiFontMetrics.cpp

index 585933a328a11d93903ab5be9089849b191f8af4..8381dd1ee38396353cdb8f07290f38db4b3289ba 100644 (file)
@@ -61,7 +61,8 @@ namespace frontend {
 int cache_metrics_width_size = 1 << 19;
 int cache_metrics_breakat_size = 1 << 19;
 // Qt 5.x already has its own caching of QTextLayout objects
-#if (QT_VERSION < 0x050000)
+// but it does not seem to work well on MacOS X.
+#if (QT_VERSION < 0x050000) || defined(Q_OS_MAC)
 int cache_metrics_qtextlayout_size = 500;
 #else
 int cache_metrics_qtextlayout_size = 0;