Python Forum
[PyQt] [Solved]Help getting variable from Function in PyQt
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] [Solved]Help getting variable from Function in PyQt
#6
You know how to load data into an existing table view. You are doing it already.
        # Create a new table view
        self.CategoryTableView = QTableView()
        self.CategoryTableView.setStyleSheet("background-color: rgb(255, 255, 255);")
        self.CategoryTableView.clicked.connect(self.findrow)
        self.CategoryTableView.selectionModel().selectionChanged.connect(self.getCellText)

        # Load the data
        self.CategoryTableView.setModel(self.model)
The purpose of the model is to update the view to reflect the data. If the model is working correctlyl, the view should automatically update when the data changes. When you modify the model data it should emit a dataChanged signal. When this happens the view will redraw itself to show the new data.
Reply


Messages In This Thread
RE: Help getting variable from Function in PyQt - by deanhystad - Jul-05-2022, 11:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] [Solved]Add a SpinBox to MsgBox or Carry Variable Over? Extra 6 1,916 Jun-05-2022, 09:32 PM
Last Post: Extra
  [Tkinter] Passing variable to function. KDog 2 2,211 May-25-2021, 09:15 PM
Last Post: KDog
  return a variable from a function snakes 3 2,881 Apr-09-2021, 06:47 PM
Last Post: snakes
  Call local variable of previous function from another function with Python3 & tkinter Hannibal 5 4,552 Oct-12-2020, 09:16 PM
Last Post: deanhystad
  Global Variable in Event Function? What am I doing wrong here? p_hobbs 1 3,560 Nov-13-2019, 02:50 PM
Last Post: Denni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020