MythTV  master
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
MythRect Class Reference

Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui. More...

#include <mythrect.h>

Inheritance diagram for MythRect:
Inheritance graph
[legend]
Collaboration diagram for MythRect:
Collaboration graph
[legend]

Public Member Functions

 MythRect ()=default
 
 MythRect (int x, int y, int width, int height)
 
 MythRect (const QString &sX, const QString &sY, const QString &sWidth, const QString &sHeight, const QString &baseRes=QString())
 
 MythRect (QRect rect)
 
MythRectoperator= (QRect other)
 
bool operator== (const MythRect &other) const
 
void Reset (void)
 
void CalculateArea (QRect parentArea)
 
void CalculateArea (const MythRect &parentArea)
 
void NormRect (void)
 
void setRect (const QString &sX, const QString &sY, const QString &sWidth, const QString &sHeight, const QString &baseRes=QString())
 
void setRect (int X, int Y, int w, int h)
 
void setX (const QString &sX)
 
void setX (int X)
 
void setY (const QString &sY)
 
void setY (int Y)
 
void setWidth (const QString &sWidth)
 
void setWidth (int width)
 
void setHeight (const QString &sHeight)
 
void setHeight (int height)
 
QString getX (void) const
 
QString getY (void) const
 
QString getWidth (void) const
 
QString getHeight (void) const
 
MythPoint topLeft (void) const
 
void moveTopLeft (QPoint point)
 
void moveTopLeft (const MythPoint &point)
 
void moveLeft (const QString &sX)
 
void moveLeft (int X)
 
void moveTop (const QString &sY)
 
void moveTop (int Y)
 
QString toString (bool details=false) const
 
QRect toQRect (void) const
 

Static Private Member Functions

static bool parsePosition (float &percent, int &offset, int &absolute, const QString &value, bool is_size)
 parse the position More...
 

Private Attributes

float m_percentWidth {0.0F}
 
float m_percentHeight {0.0F}
 
float m_percentX {0.0F}
 
float m_percentY {0.0F}
 
int m_offsetWidth {0}
 
int m_offsetHeight {0}
 
int m_offsetX {0}
 
int m_offsetY {0}
 
bool m_needsUpdate {true}
 
QRect m_parentArea {0,0,0,0}
 

Detailed Description

Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.

Definition at line 17 of file mythrect.h.

Constructor & Destructor Documentation

◆ MythRect() [1/4]

MythRect::MythRect ( )
default

◆ MythRect() [2/4]

MythRect::MythRect ( int  x,
int  y,
int  width,
int  height 
)
inline

Definition at line 22 of file mythrect.h.

◆ MythRect() [3/4]

MythRect::MythRect ( const QString &  sX,
const QString &  sY,
const QString &  sWidth,
const QString &  sHeight,
const QString &  baseRes = QString() 
)

Definition at line 8 of file mythrect.cpp.

◆ MythRect() [4/4]

MythRect::MythRect ( QRect  rect)
inlineexplicit

Definition at line 26 of file mythrect.h.

Member Function Documentation

◆ operator=()

MythRect & MythRect::operator= ( QRect  other)

Definition at line 20 of file mythrect.cpp.

◆ operator==()

bool MythRect::operator== ( const MythRect other) const

Definition at line 46 of file mythrect.cpp.

◆ Reset()

void MythRect::Reset ( void  )

Definition at line 59 of file mythrect.cpp.

Referenced by MythUIStateType::RecalculateArea().

◆ CalculateArea() [1/2]

void MythRect::CalculateArea ( QRect  parentArea)

◆ CalculateArea() [2/2]

void MythRect::CalculateArea ( const MythRect parentArea)

Definition at line 104 of file mythrect.cpp.

◆ NormRect()

void MythRect::NormRect ( void  )

Definition at line 109 of file mythrect.cpp.

Referenced by XMLParseBase::parseRect().

◆ setRect() [1/2]

void MythRect::setRect ( const QString &  sX,
const QString &  sY,
const QString &  sWidth,
const QString &  sHeight,
const QString &  baseRes = QString() 
)

◆ setRect() [2/2]

void MythRect::setRect ( int  X,
int  Y,
int  w,
int  h 
)
inline

Definition at line 39 of file mythrect.h.

◆ setX() [1/2]

void MythRect::setX ( const QString &  sX)

◆ setX() [2/2]

void MythRect::setX ( int  X)
inline

Definition at line 41 of file mythrect.h.

◆ setY() [1/2]

void MythRect::setY ( const QString &  sY)

◆ setY() [2/2]

void MythRect::setY ( int  Y)
inline

Definition at line 43 of file mythrect.h.

◆ setWidth() [1/2]

void MythRect::setWidth ( const QString &  sWidth)

◆ setWidth() [2/2]

void MythRect::setWidth ( int  width)
inline

Definition at line 45 of file mythrect.h.

◆ setHeight() [1/2]

void MythRect::setHeight ( const QString &  sHeight)

◆ setHeight() [2/2]

void MythRect::setHeight ( int  height)
inline

Definition at line 47 of file mythrect.h.

◆ getX()

QString MythRect::getX ( void  ) const

Definition at line 329 of file mythrect.cpp.

Referenced by topLeft(), and toString().

◆ getY()

QString MythRect::getY ( void  ) const

Definition at line 345 of file mythrect.cpp.

Referenced by topLeft(), and toString().

◆ getWidth()

QString MythRect::getWidth ( void  ) const

Definition at line 361 of file mythrect.cpp.

Referenced by toString().

◆ getHeight()

QString MythRect::getHeight ( void  ) const

Definition at line 377 of file mythrect.cpp.

Referenced by MythNotificationScreen::GetHeight(), and toString().

◆ topLeft()

MythPoint MythRect::topLeft ( void  ) const

◆ moveTopLeft() [1/2]

void MythRect::moveTopLeft ( QPoint  point)

◆ moveTopLeft() [2/2]

void MythRect::moveTopLeft ( const MythPoint point)

Definition at line 303 of file mythrect.cpp.

◆ moveLeft() [1/2]

void MythRect::moveLeft ( const QString &  sX)

◆ moveLeft() [2/2]

void MythRect::moveLeft ( int  X)
inline

Definition at line 58 of file mythrect.h.

◆ moveTop() [1/2]

void MythRect::moveTop ( const QString &  sY)

◆ moveTop() [2/2]

void MythRect::moveTop ( int  Y)
inline

Definition at line 60 of file mythrect.h.

◆ toString()

QString MythRect::toString ( bool  details = false) const

Definition at line 393 of file mythrect.cpp.

◆ toQRect()

QRect MythRect::toQRect ( void  ) const

◆ parsePosition()

bool MythRect::parsePosition ( float &  percent,
int &  offset,
int &  absolute,
const QString &  value,
bool  is_size 
)
staticprivate

parse the position

Returns
true of position is absolute

Definition at line 199 of file mythrect.cpp.

Referenced by moveLeft(), moveTop(), setHeight(), setWidth(), setX(), and setY().

Member Data Documentation

◆ m_percentWidth

float MythRect::m_percentWidth {0.0F}
private

Definition at line 69 of file mythrect.h.

Referenced by CalculateArea(), getWidth(), NormRect(), operator=(), operator==(), and setWidth().

◆ m_percentHeight

float MythRect::m_percentHeight {0.0F}
private

Definition at line 70 of file mythrect.h.

Referenced by CalculateArea(), getHeight(), NormRect(), operator=(), operator==(), and setHeight().

◆ m_percentX

float MythRect::m_percentX {0.0F}
private

Definition at line 71 of file mythrect.h.

Referenced by CalculateArea(), getX(), moveLeft(), NormRect(), operator=(), operator==(), and setX().

◆ m_percentY

float MythRect::m_percentY {0.0F}
private

Definition at line 72 of file mythrect.h.

Referenced by CalculateArea(), getY(), moveTop(), NormRect(), operator=(), operator==(), and setY().

◆ m_offsetWidth

int MythRect::m_offsetWidth {0}
private

Definition at line 73 of file mythrect.h.

Referenced by CalculateArea(), getWidth(), NormRect(), operator=(), operator==(), and setWidth().

◆ m_offsetHeight

int MythRect::m_offsetHeight {0}
private

Definition at line 74 of file mythrect.h.

Referenced by CalculateArea(), getHeight(), NormRect(), operator=(), operator==(), and setHeight().

◆ m_offsetX

int MythRect::m_offsetX {0}
private

Definition at line 75 of file mythrect.h.

Referenced by CalculateArea(), getX(), moveLeft(), NormRect(), operator=(), operator==(), and setX().

◆ m_offsetY

int MythRect::m_offsetY {0}
private

Definition at line 76 of file mythrect.h.

Referenced by CalculateArea(), getY(), moveTop(), NormRect(), operator=(), operator==(), and setY().

◆ m_needsUpdate

bool MythRect::m_needsUpdate {true}
private

Definition at line 78 of file mythrect.h.

Referenced by CalculateArea(), moveLeft(), moveTop(), operator=(), setHeight(), setWidth(), setX(), and setY().

◆ m_parentArea

QRect MythRect::m_parentArea {0,0,0,0}
private

Definition at line 80 of file mythrect.h.

Referenced by CalculateArea(), operator=(), and Reset().


The documentation for this class was generated from the following files: