Void qxmlquery: setfocus (const qxmlitem & item)
Sets the focus to item. the focus is the set of items that the context item expression and path expressions navigate from. for example, in the expression P/span, the element that P evaluates to is the focus for the following expression, span.
The focus can be accessed using the context item expression, I. e., dot (".").
By default, the focus is not set and is undefined. it will therefore result in a dynamic error, xpdy0002, if the focus is attempted to be accessed. the focus must be set before the query is set with setquery ().
There is no behavior defined for setting an item which is null.
Bool qxmlquery: setfocus (const qurl & documenturi)
This is an overloaded function.
Sets the focus to be the document located at documenturi and returns true. if documenturi cannot be loaded, false is returned. it is undefined at what time the document may be loaded. when loading the document, the message handler and Uri resolver set on this
Qxmlquery are used.
If documenturi is empty or is not a valid Uri, the behavior of this function is undefined.
Bool qxmlquery: setfocus (qiodevice * Document)
Sets the focus to be the document read from the qiodevice and returns true. If document cannot be loaded, false is returned.
Qxmlquery does not take ownership of document. the user guarantees that a document is available from the document device and that the document is not empty. the device must be opened in at least read-only mode. document must stay in scope as long as the current
Query is active.
This is an overloaded function.
Bool qxmlquery: setfocus (const qstring & Focus)
This function behaves identically to calling the setfocus () overload with a qiodevice whose content is focus encoded as UTF-8. That is, focus is treated as if it contained an XML document.
Returns the same result as the overload.
This is an overloaded function.
Example:
UI-> textedit-> setfocus ();