<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # QResource Class Reference ## [[QtCore](index.htm) module] 該QResource類提供??一個接口,用于直接從資源閱讀。[More...](#details) ### Methods * `__init__ (self, QString?fileName?=?QString(), QLocale?locale?=?QLocale())` * `QString absoluteFilePath (self)` * `QStringList children (self)` * `str data (self)` * `QString fileName (self)` * `bool isCompressed (self)` * `bool isDir (self)` * `bool isFile (self)` * `bool isValid (self)` * `QLocale locale (self)` * `setFileName (self, QString?file)` * `setLocale (self, QLocale?locale)` * `int size (self)` ### Static Methods * `addSearchPath (QString?path)` * `bool registerResource (QString?rccFileName, QString?mapRoot?=?QString())` * `bool registerResourceData (str?rccData, QString?mapRoot?=?QString())` * `QStringList searchPaths ()` * `bool unregisterResource (QString?rccFileName, QString?mapRoot?=?QString())` * `bool unregisterResourceData (str?rccData, QString?mapRoot?=?QString())` * * * ## Detailed Description 該QResource類提供??一個接口,用于直接從資源閱讀。 QResource是一個對象,它表示與一個單一的資源實體的一組數據(和可能的兒童)。 QResource提供直接訪問其原始格式的字節。通過這種方式直接訪問允許讀取數據,而無需緩沖復制或間接。間接常常是有用的資源實體進行交互,就好像它是一個文件時,這可以實現與[QFile](qfile.html)。數據和子后面的QResource通常編譯成一個應用程序/庫,但是,也可以裝入一個資源在運行時。當在運行時的資源文件將通過引用到資源樹被加載為一個大的數據集,然后在片給出了加載。 一個QResource既可以裝載一個絕對路徑,要么被視為植根與文件系統`/`字符,或紮根與資源符號`:`字符。相對資源也可以打開,將在由返回路徑的列表中找到[QDir.searchPaths](qdir.html#searchPaths)( ) 。 這是代表一個文件中的QResource將有數據支持它,這些數據都不可能被壓縮,在這種情況下,[qUncompress](index.htm#qUncompress)()必須被用于訪問實際數據;這種情況發生隱式通過一個訪問時[QFile](qfile.html)。這是代表一個目錄中的QResource將只有孩子和沒有數據。 ### Dynamic Resource Loading 資源可以被排除應用程序的二進制文件,當它需要在運行時使用的加載[registerResource](qresource.html#registerResource)()函數。傳遞到資源文件[registerResource](qresource.html#registerResource)( )必須是一個二進制資源由RCC所創建。有關二進制資源的更多信息可參見[The Qt Resource System](index.htm)文檔。 這個加載一大組的基礎上設置了可以改變應用圖標時,或者可以由用戶進行編輯和重新購買是非常有用。該資源被立即加載到內存中,無論是作為一個單獨的文件讀取操作的結果,或者作為內存映射文件。 這種方法可以被證明是一個顯著的性能提升,因為只有一個單一的文件將被加載,數據塊將通過所要求的路徑給出了[setFileName](qresource.html#setFileName)( ) 。 該[unregisterResource](qresource.html#unregisterResource)( )函數刪除一個引用到一個特定的文件。如果有QResources目前引用涉及到未登記的文件的資源,它們將繼續是有效的,但在資源文件本身將來自資源根部除去,因而沒有進一步QResource可以創建指向到該資源的數據。資源本身會從什么時候指向它的最后QResource被破壞內存中映射。 * * * ## Method Documentation ``` QResource.__init__ (self, QString?fileName?=?QString(), QLocale?locale?=?QLocale()) ``` 構造一個[QResource](qresource.html)指著_file_。_locale_用于加載一個資源的數據的具體定位。 **See also** [QFileInfo](qfileinfo.html),[QDir.searchPaths](qdir.html#searchPaths)( )[setFileName](qresource.html#setFileName)()和[setLocale](qresource.html#setLocale)( ) 。 ``` QString QResource.absoluteFilePath (self) ``` 返回的真實路徑,這[QResource](qresource.html)表示,如果資源是通過發現[QDir.searchPaths](qdir.html#searchPaths)()將被顯示在路徑中。 **See also** [fileName](qresource.html#fileName)( ) 。 ``` QResource.addSearchPath (QString?path) ``` ``` QStringList QResource.children (self) ``` 返回所有資源的列表在此目錄中,如果資源表示一個文件列表將是空的。 **See also** [isDir](qresource.html#isDir)( ) 。 ``` str QResource.data (self) ``` 返回直接訪問只讀數據段的該資源代表。如果資源被壓縮的數據返回被壓縮,并[qUncompress](index.htm#qUncompress)()必須被用來訪問數據。如果該資源是一個目錄,則返回0 。 **See also** [size](qresource.html#size)( )[isCompressed](qresource.html#isCompressed)()和[isFile](qresource.html#isFile)( ) 。 ``` QString QResource.fileName (self) ``` 返回完整的文件路徑,這[QResource](qresource.html)代表,因為它獲得通過。 **See also** [setFileName](qresource.html#setFileName)()和[absoluteFilePath](qresource.html#absoluteFilePath)( ) 。 ``` bool QResource.isCompressed (self) ``` 返回True如果資源表示一個文件,并支持它是一種壓縮格式,否則返回False的數據。 **See also** [data](qresource.html#data)()和[isFile](qresource.html#isFile)( ) 。 ``` bool QResource.isDir (self) ``` 如果資源表示一個目錄,因此可能有,則返回True[children](qresource.html#children)( )在里面, False,如果它代表一個文件。 **See also** [isFile](qresource.html#isFile)( ) 。 ``` bool QResource.isFile (self) ``` 返回True如果資源表示一個文件,因此有數據支持的,虛假的,如果它表示一個目錄。 **See also** [isDir](qresource.html#isDir)( ) 。 ``` bool QResource.isValid (self) ``` 返回True如果資源在資源層次,假確實存在,否則。 ``` QLocale QResource.locale (self) ``` [](qlocale.html) [返回用于查找數據的區域設置](qlocale.html)[QResource](qresource.html)。 **See also** [setLocale](qresource.html#setLocale)( ) 。 ``` bool QResource.registerResource (QString?rccFileName, QString?mapRoot?=?QString()) ``` 寄存器的資源與給定的_rccFileName_在由指定的資源樹中的位置_mapRoot_,并返回True,如果該文件被成功打開,否則返回False 。 **See also** [unregisterResource](qresource.html#unregisterResource)( ) 。 ``` bool QResource.registerResourceData (str?rccData, QString?mapRoot?=?QString()) ``` ``` QStringList QResource.searchPaths () ``` ``` QResource.setFileName (self, QString?file) ``` 設置[QResource](qresource.html)指向_file_。_file_可以是絕對的,在這種情況下,它直接打開,如果相對則該文件將嘗試在被發現[QDir.searchPaths](qdir.html#searchPaths)( ) 。 **See also** [fileName](qresource.html#fileName)()和[absoluteFilePath](qresource.html#absoluteFilePath)( ) 。 ``` QResource.setLocale (self, QLocale?locale) ``` 設置[QResource](qresource.html)僅加載資源的本地化,為_locale_。如果沒有找到針對特定語言環境的資源,然后在C語言環境使用。 **See also** [locale](qresource.html#locale)()和[setFileName](qresource.html#setFileName)( ) 。 ``` int QResource.size (self) ``` 返回備份的資源數據的大小。 **See also** [data](qresource.html#data)()和[isFile](qresource.html#isFile)( ) 。 ``` bool QResource.unregisterResource (QString?rccFileName, QString?mapRoot?=?QString()) ``` 注銷資源與給定_rccFileName_在由指定的資源樹中的位置_mapRoot_,并返回True,如果該資源被成功卸載,并沒有引用的資源存在,否則返回False 。 **See also** [registerResource](qresource.html#registerResource)( ) 。 ``` bool QResource.unregisterResourceData (str?rccData, QString?mapRoot?=?QString()) ```
                  <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>

                              哎呀哎呀视频在线观看