Le 31/07/2015 19:05, Richard Heck a écrit :
On 07/31/2015 12:12 PM, Guillaume Munch wrote:
Improve the performance of the source panel by using a QTimer. Solves
<http://www.lyx.org/trac/ticket/9493>. Please criticise.

 From d25446e1dc4aa62eae239fa95098134a1c71d9c0 Mon Sep 17 00:00:00 2001
From: gadmm<[email protected]>
Date: Fri, 31 Jul 2015 01:05:54 +0100
Subject: [PATCH] Improve the performance of the source panel by using a
  QTimer.

---
  src/frontends/qt4/GuiViewSource.cpp | 32
++++++++++++++++++++++++++------
  src/frontends/qt4/GuiViewSource.h   | 11 ++++++++++-
  2 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/src/frontends/qt4/GuiViewSource.cpp
b/src/frontends/qt4/GuiViewSource.cpp
index 3fcaed9..ede7e3e 100644
--- a/src/frontends/qt4/GuiViewSource.cpp
+++ b/src/frontends/qt4/GuiViewSource.cpp
@@ -46,7 +46,8 @@ namespace frontend {
  ViewSourceWidget::ViewSourceWidget()
      :    bv_(0), document_(new QTextDocument(this)),
          highlighter_(new LaTeXHighlighter(document_)),
-        force_getcontent_(true)
+        force_getcontent_(true),
+        update_timer_(new QTimer(this))

Do we need to delete this in the destructor?

Otherwise, it looks good to me, but I'm not much of an expert on this.

Richard



I understand that Qt takes care of this since update_timer_ is registered as a child. But I don't have much experience with Qt so please tell me if I misinterpreted the docs.

Reply via email to