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. GUI Add/delete row button for table widget
Forum Updated to NodeBB v4.3 + New Features

GUI Add/delete row button for table widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 258 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.
  • D Offline
    D Offline
    dgretski76
    wrote on last edited by
    #1

    Hi, I have a code for a GUI that has a table widget, and I'm trying to add buttons that can add and delete a row for that table. Does anyone know how to do this? Here is the code below:

    ChemistryDataTable = QtWidgets.QTableWidget()
    ChemistryDataTable.setRowCount(6)
    ChemistryDataTable.setColumnCount(5)
    ChemistryDataTable.setHorizontalHeaderLabels(["Name", "wt (%)", "T (K)","H (cals/mol)","Xi"])
    for i in range(6):
    for j in range(5):
    ChemistryDataTable.setItem(i,j,QtWidgets.QTableWidgetItem())
    layout = QtWidgets.QHBoxLayout()
    layout.addWidget(ChemistryDataTable)
    tab_layout.addLayout(layout)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Where exactly do you store them ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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