[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/libs/plasma
From:       Marco Martin <notmart () gmail ! com>
Date:       2008-09-30 20:47:49
Message-ID: 1222807669.024322.5826.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 866437 by mart:

panelPixmap() to retrieve the cached rendered panel (and render if it's
not in the cache)


 M  +11 -0     panelsvg.cpp  
 M  +9 -0      panelsvg.h  


--- trunk/KDE/kdebase/workspace/libs/plasma/panelsvg.cpp #866436:866437
@@ -371,6 +371,17 @@
     }
 }
 
+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)
 {
     PanelData *panel = d->panels[d->prefix];
--- trunk/KDE/kdebase/workspace/libs/plasma/panelsvg.h #866436:866437
@@ -223,6 +223,15 @@
         */
        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
          * @arg painter the QPainter to use
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic