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. QTableWidget how to add new rows automatically :)
Forum Updated to NodeBB v4.3 + New Features

QTableWidget how to add new rows automatically :)

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 16.9k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    mmallad
    wrote on last edited by
    #1

    In QTableWidget how can we add new rows like in C# grid view.

    Dpak Malla

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Santosh Reddy
      wrote on last edited by
      #2

      Can you show sample C# grid view code

      SS

      1 Reply Last reply
      0
      • L Offline
        L Offline
        leon.anavi
        wrote on last edited by
        #3

        You can add a new row using method "QTableWidget::insertRow":http://qt-project.org/doc/qt-5.0/qtwidgets/qtablewidget.html#insertRow After that you can use "QTableWidget::setItem":http://qt-project.org/doc/qt-5.0/qtwidgets/qtablewidget.html#setItem to set items inside the new row.

        http://anavi.org/

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          mmallad@
          Can you remind me when you add a new row to a grid view is added to the database too?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mmallad
            wrote on last edited by
            #5

            Ya it should be added to database.
            [quote author="qxoz" date="1362115617"]mmallad@
            Can you remind me when you add a new row to a grid view is added to the database too?[/quote]

            Dpak Malla

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mmallad
              wrote on last edited by
              #6

              What i actually need is when you write in the cell the rows should be added automatically. So is there any way to do that. I am from .Net environment so there was that feature. Means you dont have to add row manually.
              [quote author="leon.anavi" date="1362083040"]You can add a new row using method "QTableWidget::insertRow":http://qt-project.org/doc/qt-5.0/qtwidgets/qtablewidget.html#insertRow After that you can use "QTableWidget::setItem":http://qt-project.org/doc/qt-5.0/qtwidgets/qtablewidget.html#setItem to set items inside the new row.[/quote]

              Dpak Malla

              1 Reply Last reply
              0
              • Q Offline
                Q Offline
                qxoz
                wrote on last edited by
                #7

                In this case use QTableView with QSqlTableModel.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mmallad
                  wrote on last edited by
                  #8

                  thanx :)
                  [quote author="qxoz" date="1362117824"]In this case use QTableView with QSqlTableModel.[/quote]

                  Dpak Malla

                  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