kdeui
KRootPixmap Class Reference
Creates pseudo-transparent widgets. More...
#include <krootpixmap.h>
Public Slots | |
void | enableExports () |
static QString | pixmapName (int desk) |
void | repaint () |
void | repaint (bool force) |
void | setCustomPainting (bool enable) |
void | setFadeEffect (double opacity, const QColor &color) |
virtual void | start () |
virtual void | stop () |
Signals | |
void | backgroundUpdated (const QPixmap &pm) |
Public Member Functions | |
KDE_DEPRECATED bool | checkAvailable (bool) |
const QColor & | color () const |
int | currentDesktop () const |
bool | customPainting () const |
bool | isActive () const |
bool | isAvailable () const |
KRootPixmap (QWidget *target, QObject *parent, const char *name=0) | |
KRootPixmap (QWidget *target, const char *name=0) | |
double | opacity () const |
virtual | ~KRootPixmap () |
Protected Member Functions | |
virtual bool | eventFilter (QObject *, QEvent *) |
virtual void | updateBackground (KSharedPixmap *) |
Detailed Description
Creates pseudo-transparent widgets.A pseudo-transparent widget is a widget with its background pixmap set to that part of the desktop background that it is currently obscuring. This gives a transparency effect.
To create a transparent widget, construct a KRootPixmap and pass it a pointer to your widget. That's it! Moving, resizing and background changes are handled automatically.
Instead of using the default behavior, you can ask KRootPixmap to emit a backgroundUpdated(const QPixmap &) signal whenever the background needs updating by using setCustomPainting(bool). Alternatively by reimplementing updateBackground(KSharedPixmap*) you can take complete control of the behavior.
- Version:
- Id
- krootpixmap.h 345292 2004-09-09 20:07:27Z staniek
Definition at line 46 of file krootpixmap.h.
Constructor & Destructor Documentation
KRootPixmap::KRootPixmap | ( | QWidget * | target, | |
const char * | name = 0 | |||
) |
Constructs a KRootPixmap.
The KRootPixmap will be created as a child of the target widget so it will be deleted automatically when the widget is destroyed.
- Parameters:
-
target A pointer to the widget that you want to make pseudo transparent. name The internal name of the pixmap
Definition at line 46 of file krootpixmap.cpp.
Constructs a KRootPixmap where the parent QObject and target QWidget are different.
Definition at line 52 of file krootpixmap.cpp.
KRootPixmap::~KRootPixmap | ( | ) | [virtual] |
Member Function Documentation
void KRootPixmap::backgroundUpdated | ( | const QPixmap & | pm | ) | [signal] |
Emitted when the background needs updating and custom painting (see setCustomPainting(bool) ) is enabled.
- Parameters:
-
pm A pixmap containing the new background.
KDE_DEPRECATED bool KRootPixmap::checkAvailable | ( | bool | ) | [inline] |
const QColor& KRootPixmap::color | ( | ) | const [inline] |
int KRootPixmap::currentDesktop | ( | ) | const |
bool KRootPixmap::customPainting | ( | ) | const [inline] |
Returns true if custom painting is enabled, false otherwise.
- See also:
- setCustomPainting(bool)
Definition at line 93 of file krootpixmap.h.
void KRootPixmap::enableExports | ( | ) | [slot] |
Asks KDesktop to export the desktop background as a KSharedPixmap.
This method uses DCOP to call KBackgroundIface/setExport(int).
Definition at line 268 of file krootpixmap.cpp.
Reimplemented to filter the events from the target widget and track its movements.
Reimplemented from QObject.
Definition at line 141 of file krootpixmap.cpp.
bool KRootPixmap::isActive | ( | ) | const [inline] |
bool KRootPixmap::isAvailable | ( | ) | const |
Checks if pseudo-transparency is available.
- Returns:
true
if transparency is available,false
otherwise.
Definition at line 247 of file krootpixmap.cpp.
double KRootPixmap::opacity | ( | ) | const [inline] |
QString KRootPixmap::pixmapName | ( | int | desk | ) | [static, slot] |
Returns the name of the shared pixmap (only needed for low level access).
Definition at line 256 of file krootpixmap.cpp.
void KRootPixmap::repaint | ( | ) | [slot] |
Repaints the widget background.
Normally, you shouldn't need this as it is handled automatically. This is equivalent to calling repaint( false ).
Definition at line 202 of file krootpixmap.cpp.
void KRootPixmap::repaint | ( | bool | force | ) | [slot] |
Repaints the widget background.
Normally, you shouldn't need this as it is handled automatically.
- Parameters:
-
force Force a repaint, even if the contents did not change.
Definition at line 208 of file krootpixmap.cpp.
void KRootPixmap::setCustomPainting | ( | bool | enable | ) | [inline, slot] |
Enables custom handling of the background painting.
If custom painting is enabled then KRootPixmap will emit a backgroundUpdated() signal when the background for the target widget changes, instead of applying the new background.
Definition at line 157 of file krootpixmap.h.
void KRootPixmap::setFadeEffect | ( | double | opacity, | |
const QColor & | color | |||
) | [slot] |
Sets the fade effect.
This effect will fade the background to the specified color.
- Parameters:
-
opacity A value between 0 and 1, indicating the opacity of the color. A value of 0 will not change the image, a value of 1 will use the fade color unchanged. color The color to fade to.
Definition at line 127 of file krootpixmap.cpp.
void KRootPixmap::start | ( | ) | [virtual, slot] |
void KRootPixmap::stop | ( | ) | [virtual, slot] |
void KRootPixmap::updateBackground | ( | KSharedPixmap * | spm | ) | [protected, virtual] |
Called when the pixmap has been updated.
The default implementation applies the fade effect, then sets the target's background, or emits backgroundUpdated(const QPixmap &) depending on the painting mode.
Definition at line 303 of file krootpixmap.cpp.
The documentation for this class was generated from the following files: