以下成員源於類 QDomDocument 被棄用。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。
(deprecated in 6.8)
bool
|
setContent (QIODevice * dev , QString * errorMsg , int * errorLine = nullptr, int * errorColumn = nullptr) |
(deprecated in 6.8)
bool
|
setContent (const QByteArray & buffer , QString * errorMsg , int * errorLine = nullptr, int * errorColumn = nullptr) |
(deprecated in 6.8)
bool
|
setContent (const QString & text , QString * errorMsg , int * errorLine = nullptr, int * errorColumn = nullptr) |
(deprecated in 6.8)
bool
|
setContent (QIODevice * dev , bool namespaceProcessing , QString * errorMsg = nullptr, int * errorLine = nullptr, int * errorColumn = nullptr) |
(deprecated in 6.8)
bool
|
setContent (QXmlStreamReader * reader , bool namespaceProcessing , QString * errorMsg = nullptr, int * errorLine = nullptr, int * errorColumn = nullptr) |
(deprecated in 6.8)
bool
|
setContent (const QByteArray & data , bool namespaceProcessing , QString * errorMsg = nullptr, int * errorLine = nullptr, int * errorColumn = nullptr) |
(deprecated in 6.8)
bool
|
setContent (const QString & text , bool namespaceProcessing , QString * errorMsg = nullptr, int * errorLine = nullptr, int * errorColumn = nullptr) |
[deprecated in 6.8]
bool
QDomDocument::
setContent
(
QIODevice
*
dev
,
QString
*
errorMsg
,
int
*
errorLine
= nullptr,
int
*
errorColumn
= nullptr)
此函數從 6.8 起棄用。強烈建議在新代碼中不要使用它。
Use the overload returning ParseResult 代替。
此函數讀取 XML 文檔從 IO 設備
dev
,返迴 true 若內容被成功剖析;否則返迴
false
.
不履行名稱空間處理。
這是重載函數。
[deprecated in 6.8]
bool
QDomDocument::
setContent
(const
QByteArray
&
buffer
,
QString
*
errorMsg
,
int
*
errorLine
= nullptr,
int
*
errorColumn
= nullptr)
此函數從 6.8 起棄用。強烈建議在新代碼中不要使用它。
Use the overload returning ParseResult 代替。
此函數讀取 XML 文檔從字節數組 buffer ,返迴 true 若內容被成功剖析;否則返迴 false。
不履行名稱空間處理。
這是重載函數。
[deprecated in 6.8]
bool
QDomDocument::
setContent
(const
QString
&
text
,
QString
*
errorMsg
,
int
*
errorLine
= nullptr,
int
*
errorColumn
= nullptr)
此函數從 6.8 起棄用。強烈建議在新代碼中不要使用它。
Use the overload returning ParseResult 代替。
此函數讀取 XML 文檔從字符串
text
,返迴 true 若內容被成功剖析;否則返迴
false
。由於
text
已經是 Unicode 字符串,不用履行編碼檢測。
也不履行名稱空間處理。
這是重載函數。
[deprecated in 6.8]
bool
QDomDocument::
setContent
(
QIODevice
*
dev
,
bool
namespaceProcessing
,
QString
*
errorMsg
= nullptr,
int
*
errorLine
= nullptr,
int
*
errorColumn
= nullptr)
此函數從 6.8 起棄用。強烈建議在新代碼中不要使用它。
Use the overload taking ParseOptions 代替。
此函數讀取 XML 文檔從 IO 設備
dev
,返迴 true 若內容被成功剖析;否則返迴
false
.
注意: This method will try to open dev in read-only mode if it is not already open. In that case, the caller is responsible for calling close. This will change in Qt 7, which will no longer open dev . Applications should therefore open the device themselves before calling setContent.
這是重載函數。
[deprecated in 6.8]
bool
QDomDocument::
setContent
(
QXmlStreamReader
*
reader
,
bool
namespaceProcessing
,
QString
*
errorMsg
= nullptr,
int
*
errorLine
= nullptr,
int
*
errorColumn
= nullptr)
此函數從 6.8 起棄用。強烈建議在新代碼中不要使用它。
Use the overload taking ParseOptions 代替。
此函數讀取 XML 文檔從
QXmlStreamReader
reader
並剖析它。返迴
true
若內容被成功解析;否則返迴
false
.
若
namespaceProcessing
is
true
,剖析器識彆 XML 文件中的名稱空間並將前綴名稱、本地名稱和名稱空間 URI 設為適當值。若
namespaceProcessing
is
false
,剖析器不處理名稱空間當它讀取 XML 文件時。
若齣現剖析錯誤,錯誤消息放置在
*
errorMsg
,行號在
*
errorLine
和列號在
*
errorColumn
(unless the associated pointer is set to
nullptr
).
這是重載函數。
另請參閱 QXmlStreamReader .
[deprecated in 6.8]
bool
QDomDocument::
setContent
(const
QByteArray
&
data
,
bool
namespaceProcessing
,
QString
*
errorMsg
= nullptr,
int
*
errorLine
= nullptr,
int
*
errorColumn
= nullptr)
此函數從 6.8 起棄用。強烈建議在新代碼中不要使用它。
Use the overload taking ParseOptions 代替。
此函數剖析 XML 文檔從字節數組 data 並將它設為文檔內容。它試著按 XML 規範要求檢測文檔編碼。
若 namespaceProcessing 為 true,剖析器識彆 XML 文件中的名稱空間並將前綴名稱、本地名稱和名稱空間 URI 設為適當值。若 namespaceProcessing 為 false,剖析器不處理名稱空間當它讀取 XML 文件時。
若齣現剖析錯誤,此函數返迴
false
且錯誤消息放置於
*
errorMsg
,行號在
*
errorLine
和列號在
*
errorColumn
(unless the associated pointer is set to
nullptr
); otherwise this function returns
true
.
若 namespaceProcessing 為 true,函數 QDomNode::prefix () 返迴所有元素和屬性的字符串。它返迴空字符串,若元素或屬性沒有前綴。
僅剝離由空白組成的文本節點,且不會齣現在 QDomDocument .
若 namespaceProcessing 為 false,函數 QDomNode::prefix (), QDomNode::localName () 和 QDomNode::namespaceURI () 返迴空字符串。
實體引用處理如下:
這是重載函數。
另請參閱 QDomNode::namespaceURI (), QDomNode::localName (), QDomNode::prefix (), QString::isNull (),和 QString::isEmpty ().
[deprecated in 6.8]
bool
QDomDocument::
setContent
(const
QString
&
text
,
bool
namespaceProcessing
,
QString
*
errorMsg
= nullptr,
int
*
errorLine
= nullptr,
int
*
errorColumn
= nullptr)
此函數從 6.8 起棄用。強烈建議在新代碼中不要使用它。
Use the overloads taking ParseOptions 代替。
此函數讀取 XML 文檔從字符串
text
,返迴 true 若內容被成功剖析;否則返迴
false
。由於
text
已經是 Unicode 字符串,不用做編碼檢測。
這是重載函數。