Re: Applying PySide's QAbstractTableModel Programming Software Development by Mark_94 Even although this topic is 11 years old (in 2024), it's still very helpfulby showing how to properly program in Python3. I've readily translated it to PySide6 and it works fine except for one tiny prob: sorting the MP column with "TypeError: '<' not supported between instances of 'str' and 'float'". I'm not sure how to fix it. Applying PySide's QAbstractTableModel Programming Software Development by vegaseat Using PySide's QAbstractTableModel allows you to easily customize a widget like QTableView and … need serious help setting up images height width in QTableView Programming Software Development by krystosan … import os from PyQt4 import QtGui, QtCore class MyListModel(QtCore.QAbstractTableModel): def __init__(self, datain, col ,parent=None, *args): ""… Re: Python GUI Programming Programming Software Development by Ene Uran … similar table, this time we use PyQT's QTableView and QAbstractTableModel which allows the items in the table to be sorted… the header titles: [code=python]# use PyQT's QTableView and QAbstractTableModel # to present tabular data # allow sorting by clicking on the… Re: pyqt QTableView printing ( c++ translate to python) Programming Software Development by HiHe …: '''pqt_tableview2.py use PyQT's QTableView and QAbstractTableModel to present tabular data a rather simplified experiment …200, 400, 250) self.setWindowTitle("PyQT's QTableView and QAbstractTableModel") table_model = MyTableModel(self, data_list, header) table_view = … Re: Python GUI Programming Programming Software Development by bumsfeld …) # enable sorting tview.setSortingEnabled(True) return tview class MyTableModel(QAbstractTableModel): def __init__(self, parent, mydata, header, *args): &… length has to match header length """ QAbstractTableModel.__init__(self, parent, *args) self.mydata = mydata … Re: when to use any data model when working in Qt Framework Programming Software Development by vegaseat A model allows you to customize a widget or make it more generic. See ... http://www.daniweb.com/software-development/python/code/447834/applying-pysides-qabstracttablemodel Re: Applying PySide's QAbstractTableModel Programming Software Development by krystosan can we edit any of the item in the cell ? Re: Applying PySide's QAbstractTableModel Programming Software Development by HiHe If you model it properly you can. Re: Applying PySide's QAbstractTableModel Programming Software Development by krystosan So you mean the above example is not properly written ? Re: Applying PySide's QAbstractTableModel Programming Software Development by Rob_3 Great tutorial! I'm new to Python and the MVC concept. The Pyside documentation is detailed and extensive, but without an example of how to use a data model, I'd be lost. Thanks for sharing. Re: Applying PySide's QAbstractTableModel Programming Software Development by Oleg_2 I think MyTableModel.columnCount method should be written as def columnCount(self, parent): return len(self.header) so it will work when len(self.mylist) == 0 Re: Applying PySide's QAbstractTableModel Programming Software Development by vegaseat Should work, good idea. I am surprised that anybody still uses these snippets. I have stopped writing them because there was so little interest. Re: Applying PySide's QAbstractTableModel Programming Software Development by alanmduke Thanks for this. Best example of a QtableView application I coulld find. removing column from PyQt QAbstractTableModel Programming Software Development by krystosan I am trying to remove a column from PyQt4 implementation of table model , however I am not able to figure it out what I am doing wrong def removeColumns(self, position, columns, parent = QtCore.QModelIndex()): self.beginRemoveColumns(parent, position, position + columns - 1) #Do removing here rowCount = len(self.__colors…