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)
 
bool isValid (void) const
 
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 86 of file mythrect.h.

Constructor & Destructor Documentation

◆ MythPoint() [1/4]

MythPoint::MythPoint ( )
inline

Definition at line 90 of file mythrect.h.

◆ MythPoint() [2/4]

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

Definition at line 92 of file mythrect.h.

◆ MythPoint() [3/4]

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

Definition at line 361 of file mythrect.cpp.

◆ MythPoint() [4/4]

MythPoint::MythPoint ( QPoint  point)
inline

Definition at line 95 of file mythrect.h.

Member Function Documentation

◆ isValid()

bool MythPoint::isValid ( void  ) const
inline

◆ CalculatePoint()

void MythPoint::CalculatePoint ( const MythRect parentArea)

Definition at line 368 of file mythrect.cpp.

Referenced by MythUIType::SetMinSize(), and MythUIType::SetPosition().

◆ 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 104 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 106 of file mythrect.h.

◆ getX()

QString MythPoint::getX ( void  ) const

Definition at line 470 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 502 of file mythrect.cpp.

◆ toQPoint()

QPoint MythPoint::toQPoint ( void  ) const

Definition at line 514 of file mythrect.cpp.

Referenced by MythUIText::CursorPosition(), and MythUIType::HandleMovementPulse().

◆ 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 408 of file mythrect.cpp.

Referenced by setX(), and setY().

Member Data Documentation

◆ m_percentX

float MythPoint::m_percentX {0.0F}
private

Definition at line 118 of file mythrect.h.

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

◆ m_percentY

float MythPoint::m_percentY {0.0F}
private

Definition at line 119 of file mythrect.h.

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

◆ m_offsetX

int MythPoint::m_offsetX {0}
private

Definition at line 120 of file mythrect.h.

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

◆ m_offsetY

int MythPoint::m_offsetY {0}
private

Definition at line 121 of file mythrect.h.

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

◆ m_needsUpdate

bool MythPoint::m_needsUpdate {true}
private

Definition at line 123 of file mythrect.h.

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

◆ m_parentArea

QRect MythPoint::m_parentArea
private

Definition at line 125 of file mythrect.h.

Referenced by CalculatePoint().

◆ m_valid

bool MythPoint::m_valid {true}
private

Definition at line 127 of file mythrect.h.

Referenced by CalculatePoint().


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