Use of setfocus () Functions

Source: Internet
Author: User

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 ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.