zoukankan      html  css  js  c++  java
  • qt model view 编程总结

    看不见的root的 QModelIndex() 是 无效的

    list 和table 的index 函数中的parent参数就只要 root QModelIndex 就可以,因为没有层级概念

    • Model indexes give views and delegates information about the location of items provided by models in a way that is independent of any underlying data structures.
    • Items are referred to by their row and column numbers, and by the model index of their parent items.
    • Model indexes are constructed by models at the request of other components, such as views and delegates.
    • If a valid model index is specified for the parent item when an index is requested using index(), the index returned refers to an item beneath that parent item in the model. The index obtained refers to a child of that item.
    • If an invalid model index is specified for the parent item when an index is requested using index(), the index returned 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 are used to access items in the model. The row, column, and parent model index are needed to specify the item.
    • To access top-level items in a model, specify a null model index as the parent index with QModelIndex().
    • Items contain data for different roles. To obtain the data for a particular role, both the model index and the role must be supplied to the model.
     
  • 相关阅读:
    k8s二进制部署
    k8s二进制部署
    k8s二进制部署
    k8s二进制部署
    微信小程序 学习笔记5 使用WeUI组件弹出对话框.
    微信小程序 学习笔记4 小程序API调用 wx.login
    微信小程序 学习笔记3 页面跳转
    微信小程序 学习笔记2 button
    微信小程序 学习笔记1 初识
    Python pyautogui 模拟鼠标键盘
  • 原文地址:https://www.cnblogs.com/cute/p/4453130.html
Copyright © 2011-2022 走看看