From 5354c64b273eac7b869ca44436db7088d8c73bb4 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 18 Apr 2017 14:02:31 +0200 Subject: [PATCH] Cache QTextLayout objects with Qt/Mac It seems that the internal Qt5 caching does not work well here, especially in the case of Herbrew documents. --- src/frontends/qt4/GuiFontMetrics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiFontMetrics.cpp b/src/frontends/qt4/GuiFontMetrics.cpp index 585933a328..8381dd1ee3 100644 --- a/src/frontends/qt4/GuiFontMetrics.cpp +++ b/src/frontends/qt4/GuiFontMetrics.cpp @@ -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; -- 2.39.2