All pastes #1588423 Raw Edit

Mine

public diff v1 · immutable
#1588423 ·published 2009-10-01 21:52 UTC
rendered paste body
Index: mythpainter_qt.cpp===================================================================--- mythpainter_qt.cpp	(revision 21990)+++ mythpainter_qt.cpp	(working copy)@@ -16,21 +16,32 @@     void SetChanged(bool change = true);     QPixmap *GetPixmap(void) { return &m_Pixmap; } +    bool NeedsRegen(void) { return m_bRegenPixmap; }+    void RegeneratePixmap(void);+   protected:     QPixmap m_Pixmap;+    bool m_bRegenPixmap; };  void MythQtImage::SetChanged(bool change) {     if (change)-        m_Pixmap = QPixmap::fromImage(*((QImage *)this));+        m_bRegenPixmap = true;      MythImage::SetChanged(change); } +void MythQtImage::RegeneratePixmap(void)+{+    m_Pixmap = QPixmap::fromImage(*((QImage *)this));+    m_bRegenPixmap = false;+}+ MythQtPainter::MythQtPainter() :     MythPainter(),-    painter(0)+    painter(0),+    m_bRegenPixmap(false) { } @@ -79,6 +90,11 @@      MythQtImage *qim = reinterpret_cast<MythQtImage *>(im); +    if (qim->NeedsRegen())+    {+       qim->RegeneratePixmap();+    }+     painter->drawPixmap(r.topLeft(), *(qim->GetPixmap()), src); }