Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why is QAbstractListModel::columnCount() private?
Forum Updated to NodeBB v4.3 + New Features

Why is QAbstractListModel::columnCount() private?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Danielc
    wrote on last edited by
    #1

    Hi an thanks for reading!

    The title says everything.. I'm using QAbstractListModel and I get error when I try to call columnCount() because it is private. I know I can just cast it to QAbstractItemModel, but I'm wondering why it is private.

    Thank you!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DigitalPioneer
      wrote on last edited by
      #2

      Probably because QAbstractListModel is a 1-dimensional container, so rowCount tells you how many items are in it but columnCount would logically always be 1. It's probably private to prevent you from using it accidentally thinking you were getting rowCount (the number of items in the container).

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Danielc
        wrote on last edited by
        #3

        That's a good reason.. I was using it just to be prepared in case I don't use QAbstractListModel anymore, but I was curious about this..

        Thank you!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved