PosturePerfection
Data Structures | Functions
GUI Namespace Reference

All code related to the graphical user interface for PosturePerfection. More...

Data Structures

class  Button
 Subclass of QPushButton that allows having a title and subtitle within the button. More...
 
class  Label
 Subclass of QLabel that allows having a title and subtitle within the label. More...
 
class  MainWindow
 Allows for navigation around the application from the main page by letting the user navigate to the data page, settings page and fullscreen page from the main window. More...
 

Functions

void setPointSizeAndResize (QFont *font, QString *text, float pointSize, QRectF rect)
 Calls setPointSize() for the given font. More...
 
QRectF fullRect (int width, int height, size_t padding)
 
QRectF halfRectTop (int width, int height, size_t padding)
 
QRectF halfRectBot (int width, int height, size_t padding)
 

Detailed Description

All code related to the graphical user interface for PosturePerfection.

Function Documentation

◆ fullRect()

QRectF GUI::fullRect ( int  width,
int  height,
size_t  padding 
)

◆ halfRectBot()

QRectF GUI::halfRectBot ( int  width,
int  height,
size_t  padding 
)

◆ halfRectTop()

QRectF GUI::halfRectTop ( int  width,
int  height,
size_t  padding 
)

◆ setPointSizeAndResize()

void GUI::setPointSizeAndResize ( QFont *  font,
QString *  text,
float  pointSize,
QRectF  rect 
)

Calls setPointSize() for the given font.

This function also ensures the text fits within the given bounds and performs resizing as needed. The function works for lines with newline characters in that it resizes to fit the longest line in the text string.

Parameters
fontQFont
textQString& text that will be written with the current font
pointSizeint desired point size
boxWidthint width of the container as returned by Widget.width()
paddingsize_t Desired padding (in pixels) around the text