MythTV  master
mythpainter_qt.h
Go to the documentation of this file.
1 #ifndef MYTHPAINTER_QT_H_
2 #define MYTHPAINTER_QT_H_
3 
4 #include <list>
5 
6 #include "mythpainter.h"
7 #include "mythimage.h"
8 
9 #include "libmythbase/compat.h"
10 
11 class QPainter;
12 
13 class MythQtPainter : public MythPainter
14 {
15  public:
16  MythQtPainter() = default;
17  ~MythQtPainter() override;
18 
19  QString GetName(void) override // MythPainter
20  { return QString("Qt"); }
21  bool SupportsAnimation(void) override // MythPainter
22  { return false; }
23  bool SupportsAlpha(void) override // MythPainter
24  { return true; }
25  bool SupportsClipping(void) override // MythPainter
26  { return true; }
27 
28  void Begin(QPaintDevice *parent) override; // MythPainter
29  void End() override; // MythPainter
30 
31  void SetClipRect(QRect clipRect) override; // MythPainter
32 
33  void DrawImage(QRect r, MythImage *im, QRect src,
34  int alpha) override; // MythPainter
35 
36  protected:
37  MythImage* GetFormatImagePriv(void) override; // MythPainter
38  void DeleteFormatImagePriv(MythImage *im) override; // MythPainter
39 
40  void DeletePixmaps(void);
41 
42  QPainter *m_painter {nullptr};
43  QRegion m_clipRegion;
44 
45  std::list<QPixmap *> m_imageDeleteList;
47 };
48 
49 #endif
MythQtPainter::DrawImage
void DrawImage(QRect r, MythImage *im, QRect src, int alpha) override
Definition: mythpainter_qt.cpp:114
MythQtPainter::SupportsAnimation
bool SupportsAnimation(void) override
Definition: mythpainter_qt.h:21
MythQtPainter
Definition: mythpainter_qt.h:13
MythQtPainter::GetFormatImagePriv
MythImage * GetFormatImagePriv(void) override
Creates a reference counted image, call DecrRef() to delete.
Definition: mythpainter_qt.cpp:134
MythQtPainter::GetName
QString GetName(void) override
Definition: mythpainter_qt.h:19
MythQtPainter::DeleteFormatImagePriv
void DeleteFormatImagePriv(MythImage *im) override
Definition: mythpainter_qt.cpp:139
MythQtPainter::m_painter
QPainter * m_painter
Definition: mythpainter_qt.h:42
MythQtPainter::~MythQtPainter
~MythQtPainter() override
Definition: mythpainter_qt.cpp:55
compat.h
mythpainter.h
MythQtPainter::Begin
void Begin(QPaintDevice *parent) override
Definition: mythpainter_qt.cpp:72
MythQtPainter::SupportsAlpha
bool SupportsAlpha(void) override
Definition: mythpainter_qt.h:23
MythQtPainter::m_imageDeleteLock
QMutex m_imageDeleteLock
Definition: mythpainter_qt.h:46
MythQtPainter::m_imageDeleteList
std::list< QPixmap * > m_imageDeleteList
Definition: mythpainter_qt.h:45
mythimage.h
MythQtPainter::MythQtPainter
MythQtPainter()=default
MythPainter
Definition: mythpainter.h:34
MythImage
Definition: mythimage.h:36
MythQtPainter::SupportsClipping
bool SupportsClipping(void) override
Definition: mythpainter_qt.h:25
MythQtPainter::End
void End() override
Definition: mythpainter_qt.cpp:89
MythQtPainter::m_clipRegion
QRegion m_clipRegion
Definition: mythpainter_qt.h:43
MythQtPainter::DeletePixmaps
void DeletePixmaps(void)
Definition: mythpainter_qt.cpp:61
MythQtPainter::SetClipRect
void SetClipRect(QRect clipRect) override
Definition: mythpainter_qt.cpp:97