From 92cf54980c6ef40a11cf9ac4a0b7a28f7044b83a Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Mon, 20 May 2019 21:47:44 +0300 Subject: [PATCH] Library: eliminate QPainter warnings There were many run-time warnings in YACReaderLibrary built in Debug mode with hardware acceleration disabled and with ClassicComicsView as the active comics view: QWidget::paintEngine: Should no longer be called QPainter::begin: Paint device returned engine == 0, type: 1 The ComicFlowWidgetSW::paintEvent() implementation now corresponds to ComicFlowWidgetGL::paintEvent(), which has been fixed earlier. QWidget::repaint() calls paintEvent() immediately. PictureFlow::paintEvent() calls d->renderer->paint(). So the d->renderer->paint() call in PictureFlow::updateMarks() was redundant. --- YACReaderLibrary/comic_flow_widget.cpp | 2 +- common/pictureflow.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/YACReaderLibrary/comic_flow_widget.cpp b/YACReaderLibrary/comic_flow_widget.cpp index e96dc684..6c114a54 100644 --- a/YACReaderLibrary/comic_flow_widget.cpp +++ b/YACReaderLibrary/comic_flow_widget.cpp @@ -105,7 +105,7 @@ void ComicFlowWidgetSW::keyPressEvent(QKeyEvent* event) } void ComicFlowWidgetSW::paintEvent(QPaintEvent *event) { - flow->paintEvent(event); + ComicFlowWidget::paintEvent(event); } void ComicFlowWidgetSW::mousePressEvent(QMouseEvent* event) { diff --git a/common/pictureflow.cpp b/common/pictureflow.cpp index edb5149c..ac99f9a0 100644 --- a/common/pictureflow.cpp +++ b/common/pictureflow.cpp @@ -1421,7 +1421,6 @@ void PictureFlow::markSlide(int index, YACReaderComicReadStatus readStatus) void PictureFlow::updateMarks() { d->renderer->init(); - d->renderer->paint(); repaint(); }