#include <cmath>
#include <QApplication>
#include <QDesktopWidget>
#include <QIcon>
#include <QPushButton>
#include <QDebug>
#include "klfutil.h"
#include "klfrelativefont.h"
#include "klfguiutil.h"
Go to the source code of this file.
Functions | |
KLF_EXPORT void | klfDrawGlowedImage (QPainter *p, const QImage &foreground, const QColor &glowcol, int r, bool also_draw_image) |
Draws the given image with a glow effect. | |
QImage | klfImageScaled (const QImage &source, const QSize &newSize) |
Scale image, preserve aspect ratio and meta-information. | |
KLF_EXPORT QRect | klf_get_window_geometry (QWidget *w) |
KLF_EXPORT void | klf_set_window_geometry (QWidget *w, QRect g) |
KLF_EXPORT void | klfHideWindows () |
KLF_EXPORT void | klfRestoreWindows () |
KLF_EXPORT QRect klf_get_window_geometry | ( | QWidget * | w | ) |
Definition at line 527 of file klfguiutil.cpp.
Referenced by KLFWindowGeometryRestorer::eventFilter().
KLF_EXPORT void klf_set_window_geometry | ( | QWidget * | w, |
QRect | g | ||
) |
Definition at line 537 of file klfguiutil.cpp.
References QRect::isValid().
Referenced by KLFWindowGeometryRestorer::eventFilter().
KLF_EXPORT void klfDrawGlowedImage | ( | QPainter * | painter, |
const QImage & | foreground, | ||
const QColor & | glow_color = QColor(128, 255, 128, 8) , |
||
int | radius = 4 , |
||
bool | also_draw_image = true |
||
) |
Draws the given image with a glow effect.
Draws a glow effect for image foreground
by extracting the alpha channel, and creating fills an image of color glow_color
with the same alpha channel. The image is then drawn at all points (x,y) around (0,0) such that |(x,y)-(0,0)| < r
, effectively overlapping the glow image with itself creating a blur effect.
The resulting graphics are painted using the painter painter
, at the reference position (0,0)
. If you want your image drawn at another position, use QPainter::translate().
If also_draw_image
is TRUE, then the image itself is also drawn on top of the glow effect.
Definition at line 461 of file klfguiutil.cpp.
References QImage::convertToFormat(), QPainter::device(), QPaintDevice::devicePixelRatioF(), QPainter::drawImage(), QImage::format(), QImage::height(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, QImage::pixel(), QColor::rgba(), QImage::size(), and QImage::width().
KLF_EXPORT void klfHideWindows | ( | ) |
Definition at line 597 of file klfguiutil.cpp.
References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and klfDbg.
QImage klfImageScaled | ( | const QImage & | source, |
const QSize & | newSize | ||
) |
Scale image, preserve aspect ratio and meta-information.
Calls QImage::scaled(), with instruction to keep aspect ratio, to scale to new size, with a smooth (not fast) transformation.
Then copies the original image's meta-information to the returned image with QImage::setText().
Definition at line 512 of file klfguiutil.cpp.
References QImage::scaled(), QImage::setText(), QList::size(), QImage::text(), and QImage::textKeys().
KLF_EXPORT void klfRestoreWindows | ( | ) |
Definition at line 636 of file klfguiutil.cpp.
References QHash::contains(), KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and klfDbg.