From 91208a2f798fac4d82145f49d4194042fecaa72b Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 10 Nov 2010 15:35:56 +0000 Subject: [PATCH] Fix the 100% cpu load problem when previewing with Qt 4.2 and 4.3. Now it works fine again with those Qt versions. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36235 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 38 +++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 4048dcfa36..19482579bc 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -497,6 +497,7 @@ QVector GuiView::GuiViewPrivate::guiWorkAreas() } +#if QT_VERSION >= 0x040400 void GuiView::setCursorShapes(Qt::CursorShape shape) { QVector areas = d.guiWorkAreas(); @@ -549,7 +550,6 @@ void GuiView::processingThreadStarted() void GuiView::processingThreadFinished() { -#if (QT_VERSION >= 0x040400) QFutureWatcher const * watcher = static_cast const *>(sender()); message(watcher->result()); @@ -558,10 +558,41 @@ void GuiView::processingThreadFinished() d.processing_cursor_timer_.stop(); restoreCursorShapes(); d.indicates_processing_ = false; -#endif +} + +#else + +void GuiView::setCursorShapes(Qt::CursorShape) +{ +} + + +void GuiView::restoreCursorShapes() +{ } +void GuiView::saveCursorShapes() +{ +} + + +void GuiView::indicateProcessing() +{ +} + + +void GuiView::processingThreadStarted() +{ +} + + +void GuiView::processingThreadFinished() +{ +} +#endif + + void GuiView::saveLayout() const { QSettings settings; @@ -2942,12 +2973,12 @@ bool GuiView::GuiViewPrivate::asyncBufferProcessing( if (!used_buffer) return false; - gv_->processingThreadStarted(); string format = argument; if (format.empty()) format = used_buffer->getDefaultOutputFormat(); #if EXPORT_in_THREAD && (QT_VERSION >= 0x040400) + gv_->processingThreadStarted(); if (!msg.empty()) { progress_->clearMessages(); gv_->message(msg); @@ -2972,7 +3003,6 @@ bool GuiView::GuiViewPrivate::asyncBufferProcessing( !used_buffer->params().getIncludedChildren().empty(); return (used_buffer->*syncFunc)(format, true, update_unincluded); } else if (previewFunc) { - // TODO includeall must be false or we get a 100% busy thread, a bug? return (used_buffer->*previewFunc)(format, false); } (void) asyncFunc; -- 2.39.2