Questions tagged [qdatawidgetmapper]

QDataWidgetMapper is a class in the Qt framework. It maps widgets to a section of a data model.

The official Qt documentation can be found here for Qt5 and here for Qt4.

7 questions
1
vote
1 answer

How to properly submit data when using QDataWidgetMapper?

I'm using a custom model subclassed from QAbstractTableModel, my data is a list of dataclasses. I've set up a simple GUI with a QListView and two QLineEdits, like so: import sys import dataclasses from typing import List, Any from PyQt5.QtWidgets…
0
votes
1 answer

QComboBox populated from a relation model and connected to a QDataWidgetMapperbehaves strangely when setEditable(True)

I have a QComboBox populated from a relationModel of a QSqlRelationalTableModel and connected to a QDataWidgetMapper. I select a row in the QTableView, this row (record) mapped to the QLineEdit and QComboBox widgets then I make some changes and…
0
votes
1 answer

Alerting QDataWidgetMapper to changes when using a custom Model & Delegate

I'm using a subclassed QAbstractTableModel with dataclasses as items. Each dataclass contains a field "field1" with a list, which I'd like to display in a listview and have it automatically change whenever I edit or add an item in the listview. To…
0
votes
0 answers

How to edit string as items from QListWidget using with QDataWidgetMapper

I am using QListWidget, QSqlTableModel, QtableView and QDataWidgetMapper. QListWidget is ItemIsUserCheckable. I am able to save selected items from QListWidget into QtSql table in a single field as string format(converting list items into string as…
user3030327
  • 411
  • 1
  • 7
  • 19
0
votes
1 answer

How to convert string to date format in QDataWidgetMapper?

Below is the example code: import sys from PyQt5 import QtCore, QtWidgets, QtSql, uic class FilterProxyModel(QtCore.QSortFilterProxyModel): def __init__(self, parent=None): super().__init__(parent) self._filter_value = None …
user3030327
  • 411
  • 1
  • 7
  • 19
0
votes
2 answers

PySide Widget not updated by QDataWidgetMapper when shown

I'm trying to use a QDataWidgetMapper to drive a custom QComboBox using Enum. I'm on Windows 10, using Python 2.7.13, PySide 1.2.4 (Qt 4.8.7), here's the code: from PySide.QtCore import Qt, Property from PySide.QtGui import ( QApplication, …
Aphosis
  • 19
  • 1
  • 4
0
votes
1 answer

QDataWidgetMapper; mapping TableWidget to model

I am not finding any documentation showing which widgets QDataWidgetMapper actually works for and have not found any implementation of mapping with a QTableWidget. It definitely works for QLineEdit's and QComboBoxes, which are input widgets, but is…
Drees
  • 688
  • 1
  • 6
  • 21