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)

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 4 Sept 2017, 07:06 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 1 Reply Last reply 4 Sept 2017, 07:08
    0
    • L Lasith
      4 Sept 2017, 07:06

      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 Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 4 Sept 2017, 07:08 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 4 Sept 2017, 07:15
      2
      • J J.Hilk
        4 Sept 2017, 07:08

        @Lasith
        QString::split

        L Offline
        L Offline
        Lasith
        wrote on 4 Sept 2017, 07:15 last edited by
        #3

        @J.Hilk Thanx alot

        1 Reply Last reply
        0

        1/3

        4 Sept 2017, 07:06

        • 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