MythTV  master
Go to the documentation of this file.
1 #ifndef MYTHUISHAPE_H_
2 #define MYTHUISHAPE_H_
4 // QT headers
5 #include <QColor>
6 #include <QPen>
7 #include <QBrush>
8 #include <QLinearGradient>
10 // Mythui headers
11 #include "mythuitype.h"
13 class MythImage;
22 {
23  public:
24  MythUIShape(MythUIType *parent, const QString &name);
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);
31  protected:
32  void DrawSelf(MythPainter *p, int xoffset, int yoffset,
33  int alphaMod, QRect clipRect) override; // MythUIType
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
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};
47  friend class MythUIProgressBar;
48  friend class MythUIEditBar;
49  friend class SubtitleFormat;
50 };
52 #endif
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
virtual void CreateCopy(MythUIType *parent)
Copy the state of this widget to the one given, it must be of the same type.
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:17
A widget for rendering primitive shapes and lines.
Definition: mythuishape.h:21
virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect)
Definition: mythuitype.cpp:465
const char * name
Definition: ParseText.cpp:328
#define MUI_PUBLIC
Definition: mythuiexp.h:9
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
Progress bar widget.
A narrow purpose widget used to represent cut positions and regions when editing a video.
Definition: mythuieditbar.h:16
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.