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. Getting contents of qtablewidget cell to qstring array removing commas(splitting)
QtWS25 Last Chance

Getting contents of qtablewidget cell to qstring array removing commas(splitting)

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtcreatorc++splitarray
3 Posts 2 Posters 1.7k 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.
  • L Offline
    L Offline
    Lasith
    wrote on last edited by
    #1

    I have a qtablewidget with 3 cells in each row! I won't to get the contents of the 1st row 3 rd column into string array. The 3rd column has several words separated by commas! I want to get each word into the array with out the comma! How can I achieve it?

    QString strarray[]= {ui->tableWidget_2->item(0,2)->text()};

    from the above code I can get the entire content of the 3rd cell into a string array as a single index along with commas! But I wont each word having a single index and no commas in the array!

    J.HilkJ 1 Reply Last reply
    0
    • L Lasith

      I have a qtablewidget with 3 cells in each row! I won't to get the contents of the 1st row 3 rd column into string array. The 3rd column has several words separated by commas! I want to get each word into the array with out the comma! How can I achieve it?

      QString strarray[]= {ui->tableWidget_2->item(0,2)->text()};

      from the above code I can get the entire content of the 3rd cell into a string array as a single index along with commas! But I wont each word having a single index and no commas in the array!

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @Lasith
      QString::split


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      L 1 Reply Last reply
      2
      • J.HilkJ J.Hilk

        @Lasith
        QString::split

        L Offline
        L Offline
        Lasith
        wrote on last edited by
        #3

        @J.Hilk Thanx alot

        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