]> git.lyx.org Git - features.git/commitdiff
disable painting updates when adding/removing a workArea. This fixes these spurious...
authorAbdelrazak Younes <younes@lyx.org>
Fri, 24 Aug 2007 22:15:20 +0000 (22:15 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 24 Aug 2007 22:15:20 +0000 (22:15 +0000)
When opening another document, the following is printed to the console:

QWidget::repaint: recursive repaint detected.
QPixmap::operator=: Cannot assign to pixmap during painting
Painter must be active to set rendering hints
[repeated many times here]
Painter must be active to set rendering hints
QPainter::end: Painter is not active, aborted
QPixmap::operator=: Cannot assign to pixmap during painting
QPixmap::operator=: Cannot assign to pixmap during painting
currentTabChanged 1File/c/work/file2.lyx

and, when closing LyX:

QPixmap::operator=: Cannot assign to pixmap during painting
QPaintDevice: Cannot destroy paint device that is being painted.  Be sure to QPainter::end() painters!

I suspect that solving these issues might also solve the missing close
tab button problem.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19783 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index a8ebf88d77a94813c28184bafa2acb1e7c0d382b..c213c0342fef5f38ffd9ca5dbeb088e29ce39640 100644 (file)
@@ -841,6 +841,7 @@ WorkArea * GuiView::workArea(Buffer & buffer)
 WorkArea * GuiView::addWorkArea(Buffer & buffer)
 {
        GuiWorkArea * wa = new GuiWorkArea(buffer, *this);
+       wa->setUpdatesEnabled(false);
        d.tab_widget_->addTab(wa, toqstr(makeDisplayPath(buffer.fileName(), 30)));
        wa->bufferView().updateMetrics(false);
        if (d.stack_widget_)
@@ -902,6 +903,7 @@ void GuiView::removeWorkArea(WorkArea * work_area)
        updateToc();
 
        GuiWorkArea * gwa = dynamic_cast<GuiWorkArea *>(work_area);
+       gwa->setUpdatesEnabled(false);
        BOOST_ASSERT(gwa);
        int index = d.tab_widget_->indexOf(gwa);
        d.tab_widget_->removeTab(index);