QT Model View Programming summary

Source: Internet
Author: User

Invisible root qmodelindex () is invalid

The parent parameter in the index function of list and table is as long as root qmodelindex, because there is no hierarchical concept

    • Model indexes give views and delegates information on the location of items provided by models in a-to-be indepen Dent of any underlying data structures.
    • Items are referred through their row and column numbers, and by the model index of their parent items.
    • Model indexes is constructed by models at the request of all components, such as views and delegates.
    • If a valid model index is specified for the parent item, the index is requested using index (), the index retur Ned refers to a item beneath that parent item in the model. The index obtained refers to a child of this item.
    • If an Invalid model index was specified for the parent item, a index is requested using index (), the index re Turned refers to a top-level item in the model.
    • The role distinguishes between the different kinds of data associated with an item.

    • The dimensions of a model can be found using RowCount () and ColumnCount (). These functions generally require a parent model index to be specified.
    • Model indexes is used to access items in the model. The row, column, and parent model index is needed to specify the item.
    • To access top-level items in a model, specify a NULL model index as the parent index with Qmodelinde X ().
    • Items contain data for different roles. To obtain the data for a particular role, both the model index and the role must being supplied to the model.

QT Model View Programming summary

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.