panelPixmap() to retrieve the cached rendered panel (and render if it's
not in the cache) svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=866437
This commit is contained in:
parent
5f51803436
commit
53c1c1cdbe
11
panelsvg.cpp
11
panelsvg.cpp
@ -371,6 +371,17 @@ void PanelSvg::clearCache()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPixmap PanelSvg::panelPixmap()
|
||||||
|
{
|
||||||
|
PanelData *panel = d->panels[d->prefix];
|
||||||
|
if (!panel->cachedBackground) {
|
||||||
|
d->generateBackground(panel);
|
||||||
|
Q_ASSERT(panel->cachedBackground);
|
||||||
|
}
|
||||||
|
|
||||||
|
return *panel->cachedBackground;
|
||||||
|
}
|
||||||
|
|
||||||
void PanelSvg::paintPanel(QPainter* painter, const QRectF& target, const QRectF& source)
|
void PanelSvg::paintPanel(QPainter* painter, const QRectF& target, const QRectF& source)
|
||||||
{
|
{
|
||||||
PanelData *panel = d->panels[d->prefix];
|
PanelData *panel = d->panels[d->prefix];
|
||||||
|
@ -223,6 +223,15 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
|||||||
*/
|
*/
|
||||||
void clearCache();
|
void clearCache();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a pixmap of the SVG represented by this object.
|
||||||
|
*
|
||||||
|
* @arg elelementId the ID string of the element to render, or an empty
|
||||||
|
* string for the whole SVG (the default)
|
||||||
|
* @return a QPixmap of the rendered SVG
|
||||||
|
*/
|
||||||
|
Q_INVOKABLE QPixmap panelPixmap();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Paints the loaded SVG with the elements that represents the border
|
* Paints the loaded SVG with the elements that represents the border
|
||||||
* @arg painter the QPainter to use
|
* @arg painter the QPainter to use
|
||||||
|
Loading…
Reference in New Issue
Block a user