LeechCraft  0.6.70-3565-g2d86529
Modular cross-platform feature rich live environment.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
The GUI utilities

General GUI widgets and classes. More...

Classes

class  LeechCraft::Util::AutoResizeMixin
 Automatically moves a widget to fit a rectangle on resize. More...
 
class  LeechCraft::Util::ClearLineEditAddon
 Provides a "clear text" action for line edits. More...
 
class  LeechCraft::Util::ColorButton
 A button for choosing a color. More...
 
class  LeechCraft::Util::FindNotification
 A horizontal bar with typical widgets for text search. More...
 
class  LeechCraft::Util::FindNotificationWk
 A helper class to aid connecting FindNotification with Qt WebKit. More...
 
class  LeechCraft::Util::FlowLayout
 A simple flow layout implementation. More...
 
class  LeechCraft::Util::LineEditButtonManager
 Manages additional overlay buttons in a QLineEdit. More...
 
class  LeechCraft::Util::PageNotification
 A horizontal widget embedding into the parent layout of the passed parent widget. More...
 
class  LeechCraft::Util::SelectableBrowser
 A "browser" that shows HTML either via QTextBrowser or a browser plugin. More...
 
class  LeechCraft::Util::UnhoverDeleteMixin
 Allows to hide a widget or popup after mouse leave. More...
 

Enumerations

enum  LeechCraft::Util::FitFlag {
  LeechCraft::Util::NoFlags,
  LeechCraft::Util::NoOverlap = 0x01
}
 

Functions

QPoint LeechCraft::Util::FitRectScreen (QPoint pos, const QSize &size, FitFlags flags=NoFlags, const QPoint &shiftAdd=QPoint(0, 0))
 Tries to fit a rectangle (like a dialog or popup) into screen. More...
 
QPoint LeechCraft::Util::FitRect (QPoint pos, const QSize &size, const QRect &geometry, FitFlags flags=NoFlags, const QPoint &shiftAdd=QPoint(0, 0))
 Tries to fit a rectangle (like a dialog or popup) into geometry. More...
 
QLabel * LeechCraft::Util::ShowPixmapLabel (const QPixmap &pixmap, const QPoint &pos=QPoint())
 Shows a pixmap at the given pos. More...
 

Detailed Description

General GUI widgets and classes.

Enumeration Type Documentation

Additional fitting options used by FitRect() and FitRectScreen().

Enumerator
NoFlags 

Default fitting options.

NoOverlap 

The fitted rectangle should never overlap with the original top left position.

This option may be useful if a menu or tooltip is fitted, since it's generally undesirable to cover the corresponding UI element with the menu or tooltip.

Definition at line 48 of file util.h.

Function Documentation

UTIL_GUI_API QPoint LeechCraft::Util::FitRect ( QPoint  pos,
const QSize &  size,
const QRect &  geometry,
FitFlags  flags = NoFlags,
const QPoint &  shiftAdd = QPoint(0, 0) 
)

Tries to fit a rectangle (like a dialog or popup) into geometry.

This function tries to move the rectangle with top left point at pos and with given size so that it fits completely into the rectangle given by the geometry parameter. It leaves the size intact, instead returning the new top left position.

If the rectangle is actually moved by this function, the shiftAdd parameter is used to customize how it is moved: the shiftAdd.x() component is added to the result iff pos.x() is changed, and shiftAdd.y() is added to the result iff pos.y() is changed.

Parameters
[in]posThe original top left position of the rect to fit.
[in]sizeThe size of the rectangle to fit.
[in]geometryThe rectangle into which the source rectangle should be fitted.
[in]flagsAdditional fitting parameters.
[in]shiftAddAdditional components to be added if the rectangle is actually moved in the corresponding directions.
Returns
The new top left position of the rectangle.
See Also
FitRectScreen()

Definition at line 49 of file util.cpp.

References LeechCraft::Util::NoOverlap.

Referenced by LeechCraft::Util::FitRectScreen().

+ Here is the caller graph for this function:

UTIL_GUI_API QPoint LeechCraft::Util::FitRectScreen ( QPoint  pos,
const QSize &  size,
FitFlags  flags = NoFlags,
const QPoint &  shiftAdd = QPoint(0, 0) 
)

Tries to fit a rectangle (like a dialog or popup) into screen.

This function tries to move the rectangle with top left point at pos and with given size so that it fits completely into the available geometry of the screen that contains the point pos. It leaves the rectangle size intact, instead returning the new top left position.

Calling this function is equivalent to calling FitRect() with the geometry parameter set to QDesktopWidget::availableGeometry(pos). See the documentation for FitRect() for more details.

Parameters
[in]posThe original top left position of the rect to fit.
[in]sizeThe size of the rectangle to fit.
[in]flagsAdditional fitting parameters.
[in]shiftAddAdditional components to be added if the rectangle is actually moved in the corresponding directions.
Returns
The new top left position of the rectangle.
See Also
FitRect()

Definition at line 44 of file util.cpp.

References LeechCraft::Util::FitRect().

+ Here is the call graph for this function:

UTIL_GUI_API QLabel * LeechCraft::Util::ShowPixmapLabel ( const QPixmap &  pixmap,
const QPoint &  pos = QPoint() 
)

Shows a pixmap at the given pos.

This function shows a dialog with the given pixmap at the given position. If the pixmap is too big, it is scaled down. A QLabel created with window decorations is used as the dialog. The created label is returned from the function, so one could also set the window title and further customize the label.

This function is useful to display full version of album art in a media player or a user avatar in an IM application.

Parameters
[in]pixmapThe pixmap to show.
[in]posThe position where the dialog should be shown.
Returns
The created dialog.

Definition at line 119 of file util.cpp.