Quark  0.1
UiUtils Class Reference

A collection of UI-specific utility functions. More...

#include <UiUtils.h++>

Static Public Member Functions

static void centerWidget (QWidget *widget, QWidget *other=NULL)
 Centers a widget on-screen or within the bounds of another widget. More...
 
static QPoint cascadeWidget (QWidget *widget, const QPoint &from, int offset)
 Cascades a widget off of a screen position. More...
 
static void appendShortcutToTooltip (QAbstractButton *button)
 Appends the textual representation of a button's shortcut, in parentheses, to that button's tooltip text. More...
 
static QIcon makeColorSwatch (const QColor &color, const QSize &size)
 Constructs a color swatch icon. More...
 

Detailed Description

A collection of UI-specific utility functions.

Author
Mark Lindner

Member Function Documentation

◆ appendShortcutToTooltip()

static void appendShortcutToTooltip ( QAbstractButton *  button)
static

Appends the textual representation of a button's shortcut, in parentheses, to that button's tooltip text.

Parameters
buttonThe button.

◆ cascadeWidget()

static QPoint cascadeWidget ( QWidget *  widget,
const QPoint &  from,
int  offset 
)
static

Cascades a widget off of a screen position.

Parameters
widgetThe widget to cascade.
fromThe screen coordinates of the point to cascade from.
offsetThe offset, relative to the cascade point, at which to place the widget.
Returns
The cascaded position at which the widget was placed.

◆ centerWidget()

static void centerWidget ( QWidget *  widget,
QWidget *  other = NULL 
)
static

Centers a widget on-screen or within the bounds of another widget.

Parameters
widgetThe widget to center.
otherThe widget to center within, or NULL to center on-screen.

◆ makeColorSwatch()

static QIcon makeColorSwatch ( const QColor &  color,
const QSize &  size 
)
static

Constructs a color swatch icon.

Parameters
colorThe fill color.
sizeThe icon size.
Returns
The QIcon.

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