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 can i save and open (write saved file) data in a table widget

how can i save and open (write saved file) data in a table widget

Scheduled Pinned Locked Moved Solved General and Desktop
qt 4.8.3qtablewidgetsaveload
5 Posts 2 Posters 2.8k 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.
  • S Offline
    S Offline
    srikanth
    wrote on 26 Sept 2016, 05:37 last edited by
    #1

    Hi all,

    I have built a QTableWidget that the user fills table by using combo box & spin delegates, and a menu named as file with open,save,clear & exit .
    here clear and exit options in menu are working fine but I cannot find how to SAVE & OPEN the data of a table .

    Could you point me in the right direction. I will continue trying to find an example in the meantime!

    Thanks

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 26 Sept 2016, 06:11 last edited by
      #2

      Hi
      What do you plan to save?
      the texts?

      This post has save & load function.
      https://forum.qt.io/topic/23764/solved-save-qtablewidget/3

      S 1 Reply Last reply 26 Sept 2016, 06:43
      3
      • M mrjj
        26 Sept 2016, 06:11

        Hi
        What do you plan to save?
        the texts?

        This post has save & load function.
        https://forum.qt.io/topic/23764/solved-save-qtablewidget/3

        S Offline
        S Offline
        srikanth
        wrote on 26 Sept 2016, 06:43 last edited by
        #3

        @mrjj but in that save is working when in make this command as a comment
        strList <<
        "" " +
        ui->textEdit->toPlainText().toUtf8() +
        "" ";

        but coming to load it is showing an error
        " Unhandled exception at 0x52061aad (QtGuid4.dll) in tablewidget with delegates.exe: 0xC0000005: Access violation reading location 0x0000000000000000."

        with break load ignore options

        don't know what to do

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 26 Sept 2016, 06:45 last edited by mrjj
          #4

          Hi
          You must debug it.
          Place break point at load function and find the line
          where you crash by single step through the code.

          From the error
          Access violation reading location 0x0000000000000000."

          Seems like a dangling pointer to me.

          S 1 Reply Last reply 26 Sept 2016, 06:49
          0
          • M mrjj
            26 Sept 2016, 06:45

            Hi
            You must debug it.
            Place break point at load function and find the line
            where you crash by single step through the code.

            From the error
            Access violation reading location 0x0000000000000000."

            Seems like a dangling pointer to me.

            S Offline
            S Offline
            srikanth
            wrote on 26 Sept 2016, 06:49 last edited by
            #5

            @mrjj

            i replace this line
            ui->tableWidget->item(x,y)->setText(rowData[y]);
            with
            ui->tableWidget->setItem(x-1,y,new QTableWidgetItem(rowData[y]));
            loading is working fine now thanks problem solved

            1 Reply Last reply
            2

            2/5

            26 Sept 2016, 06:11

            • Login

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