<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-get-data-from-a-qt-table-model-using-row-and-column-in-pyqt6-wo99koijh" -->

---
title: How to Get Data from a Qt Table Model Using Row and...
description: To get a value from a QAbstractTableModel in PyQt6 using row and column integers, you can't pass them directly to data(). First create a QModelIndex with...
canonical: https://daily.dev/posts/how-to-get-data-from-a-qt-table-model-using-row-and-column-in-pyqt6-wo99koijh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Get Data from a Qt Table Model Using Row and Column in PyQt6 | daily.dev
og:description: To get a value from a QAbstractTableModel in PyQt6 using row and column integers, you can't pass them directly to data(). First create a QModelIndex with...
og:url: https://daily.dev/posts/how-to-get-data-from-a-qt-table-model-using-row-and-column-in-pyqt6-wo99koijh
og:image: https://api.daily.dev/og/posts/wo99kOIjH.png
og:image:alt: How to Get Data from a Qt Table Model Using Row and Column in PyQt6
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Get Data from a Qt Table Model Using Row and Column in PyQt6

**[Planet Python](https://daily.dev/sources/planetpython)** · 3 min read · 0 upvotes · 0 comments

## Summary

To get a value from a QAbstractTableModel in PyQt6 using row and column integers, you can't pass them directly to data(). First create a QModelIndex with self.model.index(row, column), then pass that index to self.model.data(index, Qt.ItemDataRole.DisplayRole). A full example shows a QTableView with a button that retrieves the value at row 0, column 0 and prints 'Value at row 0, column 0: Apple'. If the row or column values are outside the bounds of your data, the index won't be valid and you will get None back.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.pythonguis.com/faq/get-value-from-model-through-pair-of-integers-representing-row-and-column>

## Similar posts on daily.dev

- [How to Add QComboBox to QTableView Cells in PyQt6 with QItemDelegate](https://daily.dev/posts/how-to-add-qcombobox-to-qtableview-cells-in-pyqt6-with-qitemdelegate-eknzv6u6j) · Planet Python · 0 upvotes · 0 comments
- [How to Dynamically Add Rows of Widgets in PyQt6 with QGridLayout](https://daily.dev/posts/how-to-dynamically-add-rows-of-widgets-in-pyqt6-with-qgridlayout-j2fgwv51s) · Planet Python · 1 upvotes · 0 comments
- [New in Qt 6.11: QRangeModel updates and QRangeModelAdapter](https://daily.dev/posts/new-in-qt-6-11-qrangemodel-updates-and-qrangemodeladapter-8gvcopfot) · Qt · 1 upvotes · 0 comments
- [Qt Widgets to Qt Quick, An Application Journey Part 3](https://daily.dev/posts/qt-widgets-to-qt-quick-an-application-journey-part-3-vdfmbgxpz) · Qt · 0 upvotes · 0 comments
- [Qt Built-in Icons in PyQt6, PyQt5, PySide6 & PySide2 — Complete List & Examples](https://daily.dev/posts/qt-built-in-icons-in-pyqt6-pyqt5-pyside6-pyside2-complete-list-examples-zn9msyt7b) · Planet Python · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#qt](https://daily.dev/tags/qt), [#desktop-development](https://daily.dev/tags/desktop-development)

[View this post on daily.dev](https://daily.dev/posts/how-to-get-data-from-a-qt-table-model-using-row-and-column-in-pyqt6-wo99koijh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Get Data from a Qt Table Model Using Row and Column in PyQt6","url":"https://daily.dev/posts/how-to-get-data-from-a-qt-table-model-using-row-and-column-in-pyqt6-wo99koijh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-get-data-from-a-qt-table-model-using-row-and-column-in-pyqt6-wo99koijh"},"datePublished":"2026-10-28T07:52:24.980Z","dateModified":"2026-10-28T08:00:28.067Z","description":"To get a value from a QAbstractTableModel in PyQt6 using row and column integers, you can't pass them directly to data(). First create a QModelIndex with...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/14bb6cf5f2ed4e1f76ac03317753bcd5?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/14bb6cf5f2ed4e1f76ac03317753bcd5?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Planet Python","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet Python","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/eac3cc584cb043b5a242d13752bd3d0c","url":"https://daily.dev/sources/planetpython"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-get-data-from-a-qt-table-model-using-row-and-column-in-pyqt6-wo99koijh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,qt,desktop-development","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet Python","item":"https://daily.dev/sources/planetpython"},{"@type":"ListItem","position":3,"name":"How to Get Data from a Qt Table Model Using Row and Column in PyQt6"}]}
```

