<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QPixmapCache Class Reference ## [[QtGui](index.htm) module] 該QPixmapCache類為像素圖的應用范圍的緩存。[More...](#details) ### Types * `class **[Key](index.htm)**` ### Methods * `__init__ (self)` * `__init__ (self, QPixmapCache)` ### Static Methods * `int cacheLimit ()` * `clear ()` * `QPixmap find (QString?key)` * `bool find (QString?key, QPixmap?pixmap)` * `bool find (Key?key, QPixmap?pixmap)` * `bool insert (QString?key, QPixmap)` * `Key insert (QPixmap?pixmap)` * `remove (QString?key)` * `remove (Key?key)` * `bool replace (Key?key, QPixmap?pixmap)` * `setCacheLimit (int)` * * * ## Detailed Description 該QPixmapCache類為像素圖的應用范圍的緩存。 這個類是最優化的繪圖工具[QPixmap](qpixmap.html)。你可以用它來存儲臨時像素圖是昂貴的生成,而無需使用比更多的存儲空間[cacheLimit](qpixmapcache.html#cacheLimit)( ) 。使用[insert](qpixmapcache.html#insert)( )來插入像素圖,[find](qpixmapcache.html#find)()找到他們,[clear](qpixmapcache.html#clear)()來清空緩存。 QPixmapCache不包含成員數據,只有靜態函數來訪問全局像素圖緩存。它創建了一個內部[QCache](index.htm)對象用于緩存的像素圖。 高速緩存關聯一個像素映像與用戶提供的字符串作為密鑰,或與[QPixmapCache.Key](index.htm)高速緩存生成。運用[QPixmapCache.Key](index.htm)鑰匙比使用字符串快。該字符串的API是復雜的鍵很方便,但[QPixmapCache.Key](index.htm)API將是非常有效和方便的一到一個對象到像素圖繪制 - 在這種情況下,你可以存儲密鑰作為一個對象的成員。 如果兩個像素圖被插入到使用相等的鍵緩存,那么最后的pixmap將替代緩存中的第一個像素圖。在此之前的行為[QHash](index.htm)和[QCache](index.htm)類。 當所有的像素圖中的高速緩存的總大小超過緩存已滿[cacheLimit](qpixmapcache.html#cacheLimit)( ) 。初始高速緩存限制為2048 KB桌面平臺( 2 MB )的嵌入式平臺, 10240 KB ( 10 MB) ,你可以通過調用改變這個[setCacheLimit](qpixmapcache.html#setCacheLimit)( )與所需的值。一個像素圖大致需要(_width_*_height_*_depth_) / 8字節的內存。 該_Qt Quarterly_文章[Optimizing with QPixmapCache](http://qt.nokia.com/doc/qq/qq12-qpixmapcache.html)解釋如何使用QPixmapCache通過緩存繪畫的結果,以加快應用程序。 * * * ## Method Documentation ``` QPixmapCache.__init__ (self) ``` ``` QPixmapCache.__init__ (self, QPixmapCache) ``` ``` int QPixmapCache.cacheLimit () ``` 返回高速緩存的限制(以KB為單位) 。 默認的緩存限制為2048 KB的嵌入式平臺, 10240 KB桌面平臺。 **See also** [setCacheLimit](qpixmapcache.html#setCacheLimit)( ) 。 ``` QPixmapCache.clear () ``` 刪除所有像素圖從緩存。 ``` QPixmap QPixmapCache.find (QString?key) ``` [ 查找與給定關聯的緩存像素圖_key_在緩存中。如果找到了像素圖,函數集_pixmap_到像素圖,并返回True,否則它的葉子_pixmap_獨自返回False 。 例如: ](qpixmap.html) ``` QPixmap pm; if (![QPixmapCache](qpixmapcache.html).find("my_big_image", &pm)) { pm.load("bigimage.png"); [QPixmapCache](qpixmapcache.html).insert("my_big_image", pm); } painter->drawPixmap(0, 0, pm); ``` 此功能被引入Qt的4.6 。 ``` bool QPixmapCache.find (QString?key, QPixmap?pixmap) ``` ``` bool QPixmapCache.find (Key?key, QPixmap?pixmap) ``` 查找與給定關聯的緩存像素圖_key_在緩存中。如果找到了像素圖,函數集_pixmap_到像素圖,并返回True,否則它的葉子_pixmap_獨自返回False 。如果未找到該像素圖,它表示該_key_不再有效,因此它會被釋放下一個插入。 此功能被引入Qt的4.6 。 ``` bool QPixmapCache.insert (QString?key, QPixmap) ``` 插入的像素圖的副本_pixmap_與相關聯的_key_到緩存中。 通過Qt庫中插入的所有像素映射有一個主要的出發用“ $ QT” ,所以你自己的像素映射的鍵應該永遠不會開始“$ QT” 。 當一個像素映射插入和緩存將要超過它的極限,它消除了像素圖,直到有足夠的空間將被插入的像素圖。 當需要更多空間的最古老的像素圖(最近最少在緩存中訪問)都將被刪除。 如果該對象被插入到緩存中的函數返回True,否則返回False 。 **See also** [setCacheLimit](qpixmapcache.html#setCacheLimit)( ) 。 ``` Key QPixmapCache.insert (QPixmap?pixmap) ``` [ 插入給定的一個副本_pixmap_到緩存中,并返回可用于對其進行檢索的密鑰。 當一個像素映射插入和緩存將要超過它的極限,它消除了像素圖,直到有足夠的空間將被插入的像素圖。 當需要更多空間的最古老的像素圖(最近最少在緩存中訪問)都將被刪除。 此功能被引入Qt的4.6 。 ](index.htm) [**See also**](index.htm) [setCacheLimit](qpixmapcache.html#setCacheLimit)()和[replace](qpixmapcache.html#replace)( ) 。 ``` QPixmapCache.remove (QString?key) ``` 刪除關聯的像素圖_key_從高速緩存中。 ``` QPixmapCache.remove (Key?key) ``` 刪除關聯的像素圖_key_從高速緩存中,并釋放鍵為未來的插入。 此功能被引入Qt的4.6 。 ``` bool QPixmapCache.replace (Key?key, QPixmap?pixmap) ``` 替換與給定關聯的像素圖_key_與_pixmap_規定。返回True如果_pixmap_已正確插入到緩存中,否則返回False 。 此功能被引入Qt的4.6 。 **See also** [setCacheLimit](qpixmapcache.html#setCacheLimit)()和[insert](qpixmapcache.html#insert)( ) 。 ``` QPixmapCache.setCacheLimit (int) ``` 設置緩存的限制_n_千字節。 默認設置為2048 KB的嵌入式平臺, 10240 KB桌面平臺。 **See also** [cacheLimit](qpixmapcache.html#cacheLimit)( ) 。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看