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

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

#include <mythrect.h>

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

Public Member Functions

 MythPoint ()
 
 MythPoint (int x, int y)
 
 MythPoint (const QString &sX, const QString &sY)
 
 MythPoint (QPoint point)
 
MythPointoperator= (QPoint other)
 
bool isValid (void) const
 
void CalculatePoint (QRect parentArea)
 
void CalculatePoint (const MythRect &parentArea)
 
void NormPoint (void)
 
void setX (const QString &sX)
 
void setX (int X)
 
void setY (const QString &sY)
 
void setY (int Y)
 
QString getX (void) const
 
QString getY (void) const
 
QString toString (bool details=false) const
 
QPoint toQPoint (void) const
 

Static Private Member Functions

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

Private Attributes

float m_percentX {0.0F}
 
float m_percentY {0.0F}
 
int m_offsetX {0}
 
int m_offsetY {0}
 
bool m_needsUpdate {true}
 
QRect m_parentArea
 
bool m_valid {true}
 

Detailed Description

Wrapper around QPoint allowing us to handle percentage and other relative values for positioning in mythui.

Definition at line 88 of file mythrect.h.

Constructor & Destructor Documentation

◆ MythPoint() [1/4]

MythPoint::MythPoint ( )
inline

Definition at line 92 of file mythrect.h.

◆ MythPoint() [2/4]

MythPoint::MythPoint ( int  x,
int  y 
)
inline

Definition at line 94 of file mythrect.h.

◆ MythPoint() [3/4]

MythPoint::MythPoint ( const QString &  sX,
const QString &  sY 
)

Definition at line 412 of file mythrect.cpp.

◆ MythPoint() [4/4]

MythPoint::MythPoint ( QPoint  point)
inlineexplicit

Definition at line 97 of file mythrect.h.

Member Function Documentation

◆ operator=()

MythPoint & MythPoint::operator= ( QPoint  other)

Definition at line 424 of file mythrect.cpp.

◆ isValid()

bool MythPoint::isValid ( void  ) const
inline

◆ CalculatePoint() [1/2]

void MythPoint::CalculatePoint ( QRect  parentArea)

◆ CalculatePoint() [2/2]

void MythPoint::CalculatePoint ( const MythRect parentArea)

Definition at line 466 of file mythrect.cpp.

◆ NormPoint()

void MythPoint::NormPoint ( void  )

◆ setX() [1/2]

void MythPoint::setX ( const QString &  sX)

◆ setX() [2/2]

void MythPoint::setX ( int  X)
inline

Definition at line 109 of file mythrect.h.

◆ setY() [1/2]

void MythPoint::setY ( const QString &  sY)

◆ setY() [2/2]

void MythPoint::setY ( int  Y)
inline

Definition at line 111 of file mythrect.h.

◆ getX()

QString MythPoint::getX ( void  ) const

Definition at line 550 of file mythrect.cpp.

Referenced by MythRect::moveTopLeft(), and toString().

◆ getY()

QString MythPoint::getY ( void  ) const

◆ toString()

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

Definition at line 582 of file mythrect.cpp.

◆ toQPoint()

QPoint MythPoint::toQPoint ( void  ) const

◆ parsePosition()

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

parse the position

Returns
true of position is absolute

Definition at line 488 of file mythrect.cpp.

Referenced by setX(), and setY().

Member Data Documentation

◆ m_percentX

float MythPoint::m_percentX {0.0F}
private

Definition at line 123 of file mythrect.h.

Referenced by CalculatePoint(), getX(), NormPoint(), operator=(), and setX().

◆ m_percentY

float MythPoint::m_percentY {0.0F}
private

Definition at line 124 of file mythrect.h.

Referenced by CalculatePoint(), getY(), NormPoint(), operator=(), and setY().

◆ m_offsetX

int MythPoint::m_offsetX {0}
private

Definition at line 125 of file mythrect.h.

Referenced by CalculatePoint(), getX(), NormPoint(), operator=(), and setX().

◆ m_offsetY

int MythPoint::m_offsetY {0}
private

Definition at line 126 of file mythrect.h.

Referenced by CalculatePoint(), getY(), NormPoint(), operator=(), and setY().

◆ m_needsUpdate

bool MythPoint::m_needsUpdate {true}
private

Definition at line 128 of file mythrect.h.

Referenced by CalculatePoint(), operator=(), setX(), and setY().

◆ m_parentArea

QRect MythPoint::m_parentArea
private

Definition at line 130 of file mythrect.h.

Referenced by CalculatePoint(), and operator=().

◆ m_valid

bool MythPoint::m_valid {true}
private

Definition at line 132 of file mythrect.h.

Referenced by CalculatePoint(), and operator=().


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