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. QAbstractItemModel::Span
Qt 6.11 is out! See what's new in the release blog

QAbstractItemModel::Span

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 4.0k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    I would like to use:
    http://doc.trolltech.com/4.7/qabstractitemmodel.html#span, but it says "Note: Currently, span is not used."

    I have looked into previous releases, and it seems that span has been unimplemented for a long time. Why is this the case? Is there any way around this if I want to add something that will span multiple columns?

    Thanks,
    Marc

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      The API is there in QAbstractItemModel from the start (since it's virtual, it couldn't have been added at a later point), but indeed no views implement it.

      I used span() in KDReports (http://www.kdab.com/products/kd-reports), which creates tables in a report (using QTextDocument internally), in order to support spans.

      But as long as QTableView does not implement it, you don't really have a solution for a tableview. All you can do is vote on http://bugreports.qt.nokia.com/browse/QTBUG-6508 :-)

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Ah, I forgot: currently to achieve span in QTableView you can use:
        void QTableView::setSpan ( int row, int column, int rowSpanCount, int columnSpanCount )

        This is not as nice as having this information come from the model, but it's a way to get things done.

        Not available in a QTreeView though (you didn't specify which one you were using).

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          I am using a QTreeView, meaning this will not work for the column span I wanted. Thanks for your reply.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Ah OK, then it's rather http://bugreports.qt.nokia.com/browse/QTBUG-2117 that you want to vote for :-)

            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