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?
Forum Updated to NodeBB v4.3 + New Features

How to split QStringList in two columns for QStringListModel?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 3 Posters 966 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.
  • E Offline
    E Offline
    Engelard
    wrote on 19 Nov 2018, 01:24 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
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 19 Nov 2018, 01:39 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 19 Nov 2018, 04:59 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

        1/3

        19 Nov 2018, 01:24

        • Login

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