MythTV  master
mythuishape.h
Go to the documentation of this file.
1 #ifndef MYTHUISHAPE_H_
2 #define MYTHUISHAPE_H_
3 
4 // QT headers
5 #include <QColor>
6 #include <QPen>
7 #include <QBrush>
8 #include <QLinearGradient>
9 
10 // Mythui headers
11 #include "mythuitype.h"
12 
13 class MythImage;
14 
22 {
23  public:
24  MythUIShape(MythUIType *parent, const QString &name);
25 
26  void SetCropRect(int x, int y, int width, int height);
27  void SetCropRect(const MythRect &rect);
28  void SetFillBrush(QBrush fill);
29  void SetLinePen(QPen pen);
30 
31  protected:
32  void DrawSelf(MythPainter *p, int xoffset, int yoffset,
33  int alphaMod, QRect clipRect) override; // MythUIType
34 
35  bool ParseElement(const QString &filename, QDomElement &element,
36  bool showWarnings) override; // MythUIType
37  void CopyFrom(MythUIType *base) override; // MythUIType
38  void CreateCopy(MythUIType *parent) override; // MythUIType
39 
40  private:
41  QString m_type {"box"};
42  QBrush m_fillBrush {Qt::NoBrush};
43  QPen m_linePen {Qt::NoPen};
44  int m_cornerRadius {10};
45  MythRect m_cropRect {0,0,0,0};
46 
47  friend class MythUIProgressBar;
48  friend class MythUIEditBar;
49  friend class SubtitleFormat;
50 };
51 
52 #endif
MUI_PUBLIC
#define MUI_PUBLIC
Definition: mythuiexp.h:9
MythUIEditBar
A narrow purpose widget used to represent cut positions and regions when editing a video.
Definition: mythuieditbar.h:17
MythRect
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:18
MythUIType::CreateCopy
virtual void CreateCopy(MythUIType *parent)
Copy the state of this widget to the one given, it must be of the same type.
Definition: mythuitype.cpp:1209
MythUIType::DrawSelf
virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect)
Definition: mythuitype.cpp:464
MythUIProgressBar
Progress bar widget.
Definition: mythuiprogressbar.h:13
hardwareprofile.config.p
p
Definition: config.py:33
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
MythUIType::CopyFrom
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
Definition: mythuitype.cpp:1152
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:85
MythUIShape
A widget for rendering primitive shapes and lines.
Definition: mythuishape.h:22
MythPainter
Definition: mythpainter.h:33
MythImage
Definition: mythimage.h:37
SubtitleFormat
Definition: subtitlescreen.cpp:131
MythUIType::ParseElement
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
Definition: mythuitype.cpp:1218
mythuitype.h