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. How to split QStringList in two columns for QStringListModel?

How to split QStringList in two columns for QStringListModel?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 1.1k Views
  • 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.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by Engelard
    #1

    Hi everybody!

    I have tableView, it should have only two columns, but enormous amount of rows. I know already that i can use QStandardItemModel and append QStandardItem's instead pure strings(using QStringListModel), but i do need a performance and speed, so i want to ask. Is it possible to add two columns with QStringListModel instead of single-first-one?

    Because for my assumption, appending data in to lists using bitwise fastest operators is much better then create hundreds thousands objects.

    strList << "maString";                         // appending to QStringList
    
    stdItems->append(new QStandardItem("maString"));    // appending to QList<QStandardItem>
    
    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      StringListModel is only one column and multi rows. If you have huge data sets, better you write the custom model using QAbstractListModel.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      6
      • S Offline
        S Offline
        Slawomir_Piernikowski
        wrote on last edited by
        #3

        @Engelard said in How to split QStringList in two columns for QStringListModel?:

        ("maString

        In Qt doumentation is written:
        "The model provides all the standard functions of an editable model, representing the data in the string list as a model with one column and a number of rows equal to the number of items in the list."

        1 Reply Last reply
        3

        • Login

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