populse_mia.user_interface.data_browser.modify_table

Database cell editor module for list-type values.

This module provides dialog interfaces for editing complex data types in the Mia data browser. It specifically handles the editing of list-type values such as arrays of numbers, strings, or dates.

The ModifyTable dialog creates an interactive table representation of lists, allowing users to add, edit, or remove items while ensuring type safety and database consistency.

Contains:
Class:
  • ModifyTable

Classes

ModifyTable(project, value, types, scans, tags)

Dialog to modify cell contents containing lists in the data browser tab.

class populse_mia.user_interface.data_browser.modify_table.datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])

Bases: date

The year, month and day arguments are required. tzinfo may be None, or an instance of a tzinfo subclass. The remaining arguments may be ints.

astimezone()

tz -> convert to local time in new timezone tz

combine()

date, time -> datetime with same date and time fields

ctime()

Return ctime() style string.

date()

Return date object with same year, month and day.

dst()

Return self.tzinfo.dst(self).

fold
fromisoformat()

string -> datetime from a string in most ISO 8601 formats

fromtimestamp()

timestamp[, tz] -> tz’s local time from POSIX timestamp.

hour
isoformat()

[sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM]. sep is used to separate the year from the time, and defaults to ‘T’. The optional argument timespec specifies the number of additional terms of the time to include. Valid options are ‘auto’, ‘hours’, ‘minutes’, ‘seconds’, ‘milliseconds’ and ‘microseconds’.

max = datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)
microsecond
min = datetime.datetime(1, 1, 1, 0, 0)
minute
now()

Returns new datetime object representing current time local to tz.

tz

Timezone object.

If no tz is specified, uses local timezone.

replace()

Return datetime with new specified fields.

resolution = datetime.timedelta(microseconds=1)
second
strptime()

string, format -> new datetime parsed from a string (like time.strptime()).

time()

Return time object with same time but with tzinfo=None.

timestamp()

Return POSIX timestamp as float.

timetuple()

Return time tuple, compatible with time.localtime().

timetz()

Return time object with same time and tzinfo.

tzinfo
tzname()

Return self.tzinfo.tzname(self).

utcfromtimestamp()

Construct a naive UTC datetime from a POSIX timestamp.

utcnow()

Return a new datetime representing UTC day and time.

utcoffset()

Return self.tzinfo.utcoffset(self).

utctimetuple()

Return UTC time tuple, compatible with time.localtime().

class populse_mia.user_interface.data_browser.modify_table.QDialog(parent: QWidget | None = None, flags: Qt.WindowFlags | Qt.WindowType = Qt.WindowFlags())

Bases: QWidget

Accepted = 1
class DialogCode

Bases: int

Rejected = 0
accept(self)
accepted

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

closeEvent(self, a0: QCloseEvent | None)
contextMenuEvent(self, a0: QContextMenuEvent | None)
done(self, a0: int)
eventFilter(self, a0: QObject | None, a1: QEvent | None) bool
exec(self) int
exec_(self) int
finished

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

isSizeGripEnabled(self) bool
keyPressEvent(self, a0: QKeyEvent | None)
minimumSizeHint(self) QSize
open(self)
reject(self)
rejected

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

resizeEvent(self, a0: QResizeEvent | None)
result(self) int
setModal(self, modal: bool)
setResult(self, r: int)
setSizeGripEnabled(self, a0: bool)
setVisible(self, visible: bool)
showEvent(self, a0: QShowEvent | None)
sizeHint(self) QSize
class populse_mia.user_interface.data_browser.modify_table.QHBoxLayout
class populse_mia.user_interface.data_browser.modify_table.QHBoxLayout(parent: QWidget | None)

Bases: QBoxLayout

class populse_mia.user_interface.data_browser.modify_table.QMessageBox(parent: QWidget | None = None)
class populse_mia.user_interface.data_browser.modify_table.QMessageBox(icon: QMessageBox.Icon, title: str | None, text: str | None, buttons: QMessageBox.StandardButtons | QMessageBox.StandardButton = QMessageBox.NoButton, parent: QWidget | None = None, flags: Qt.WindowFlags | Qt.WindowType = Qt.Dialog | Qt.MSWindowsFixedSizeDialogHint)

Bases: QDialog

Abort = 262144
AcceptRole = 0
ActionRole = 3
Apply = 33554432
ApplyRole = 8
ButtonMask = -769
class ButtonRole

Bases: int

Cancel = 4194304
Close = 2097152
Critical = 3
Default = 256
DestructiveRole = 2
Discard = 8388608
Escape = 512
FirstButton = 1024
FlagMask = 768
Help = 16777216
HelpRole = 4
class Icon

Bases: int

Ignore = 1048576
Information = 1
InvalidRole = -1
LastButton = 134217728
No = 65536
NoAll = 131072
NoButton = 0
NoIcon = 0
NoRole = 6
NoToAll = 131072
Ok = 1024
Open = 8192
Question = 4
RejectRole = 1
Reset = 67108864
ResetRole = 7
RestoreDefaults = 134217728
Retry = 524288
Save = 2048
SaveAll = 4096
class StandardButton

Bases: int

class StandardButtons
class StandardButtons(f: QMessageBox.StandardButtons | QMessageBox.StandardButton)
class StandardButtons(a0: QMessageBox.StandardButtons)

Bases: simplewrapper

Warning = 2
Yes = 16384
YesAll = 32768
YesRole = 5
YesToAll = 32768
about(parent: QWidget | None, caption: str | None, text: str | None)
aboutQt(parent: QWidget | None, title: str | None = '')
addButton(self, button: QAbstractButton | None, role: QMessageBox.ButtonRole)
addButton(self, text: str | None, role: QMessageBox.ButtonRole) QPushButton | None
addButton(self, button: QMessageBox.StandardButton) QPushButton | None
button(self, which: QMessageBox.StandardButton) QAbstractButton | None
buttonClicked

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

buttonRole(self, button: QAbstractButton | None) QMessageBox.ButtonRole
buttons(self) List[QAbstractButton]
changeEvent(self, a0: QEvent | None)
checkBox(self) QCheckBox | None
clickedButton(self) QAbstractButton | None
closeEvent(self, a0: QCloseEvent | None)
critical(parent: QWidget | None, title: str | None, text: str | None, buttons: QMessageBox.StandardButtons | QMessageBox.StandardButton = QMessageBox.Ok, defaultButton: QMessageBox.StandardButton = QMessageBox.NoButton) QMessageBox.StandardButton
defaultButton(self) QPushButton | None
detailedText(self) str
escapeButton(self) QAbstractButton | None
event(self, e: QEvent | None) bool
icon(self) QMessageBox.Icon
iconPixmap(self) QPixmap
information(parent: QWidget | None, title: str | None, text: str | None, buttons: QMessageBox.StandardButtons | QMessageBox.StandardButton = QMessageBox.Ok, defaultButton: QMessageBox.StandardButton = QMessageBox.NoButton) QMessageBox.StandardButton
informativeText(self) str
keyPressEvent(self, a0: QKeyEvent | None)
open(self)
open(self, slot: PYQT_SLOT) None
question(parent: QWidget | None, title: str | None, text: str | None, buttons: QMessageBox.StandardButtons | QMessageBox.StandardButton = QMessageBox.StandardButtons(QMessageBox.Yes | QMessageBox.No), defaultButton: QMessageBox.StandardButton = QMessageBox.NoButton) QMessageBox.StandardButton
removeButton(self, button: QAbstractButton | None)
resizeEvent(self, a0: QResizeEvent | None)
setCheckBox(self, cb: QCheckBox | None)
setDefaultButton(self, button: QPushButton | None)
setDefaultButton(self, button: QMessageBox.StandardButton) None
setDetailedText(self, text: str | None)
setEscapeButton(self, button: QAbstractButton | None)
setEscapeButton(self, button: QMessageBox.StandardButton) None
setIcon(self, a0: QMessageBox.Icon)
setIconPixmap(self, a0: QPixmap)
setInformativeText(self, text: str | None)
setStandardButtons(self, buttons: QMessageBox.StandardButtons | QMessageBox.StandardButton)
setText(self, a0: str | None)
setTextFormat(self, a0: Qt.TextFormat)
setTextInteractionFlags(self, flags: Qt.TextInteractionFlags | Qt.TextInteractionFlag)
setWindowModality(self, windowModality: Qt.WindowModality)
setWindowTitle(self, title: str | None)
showEvent(self, a0: QShowEvent | None)
standardButton(self, button: QAbstractButton | None) QMessageBox.StandardButton
standardButtons(self) QMessageBox.StandardButtons
standardIcon(icon: QMessageBox.Icon) QPixmap
text(self) str
textFormat(self) Qt.TextFormat
textInteractionFlags(self) Qt.TextInteractionFlags
warning(parent: QWidget | None, title: str | None, text: str | None, buttons: QMessageBox.StandardButtons | QMessageBox.StandardButton = QMessageBox.Ok, defaultButton: QMessageBox.StandardButton = QMessageBox.NoButton) QMessageBox.StandardButton
class populse_mia.user_interface.data_browser.modify_table.QPushButton(parent: QWidget | None = None)
class populse_mia.user_interface.data_browser.modify_table.QPushButton(text: str | None, parent: QWidget | None = None)
class populse_mia.user_interface.data_browser.modify_table.QPushButton(icon: QIcon, text: str | None, parent: QWidget | None = None)

Bases: QAbstractButton

autoDefault(self) bool
event(self, e: QEvent | None) bool
focusInEvent(self, a0: QFocusEvent | None)
focusOutEvent(self, a0: QFocusEvent | None)
hitButton(self, pos: QPoint) bool
initStyleOption(self, option: QStyleOptionButton | None)
isDefault(self) bool
isFlat(self) bool
keyPressEvent(self, a0: QKeyEvent | None)
menu(self) QMenu | None
minimumSizeHint(self) QSize
paintEvent(self, a0: QPaintEvent | None)
setAutoDefault(self, a0: bool)
setDefault(self, a0: bool)
setFlat(self, a0: bool)
setMenu(self, menu: QMenu | None)
showMenu(self)
sizeHint(self) QSize
class populse_mia.user_interface.data_browser.modify_table.QTableWidget(parent: QWidget | None = None)
class populse_mia.user_interface.data_browser.modify_table.QTableWidget(rows: int, columns: int, parent: QWidget | None = None)

Bases: QTableView

cellActivated

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

cellChanged

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

cellClicked

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

cellDoubleClicked

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

cellEntered

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

cellPressed

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

cellWidget(self, row: int, column: int) QWidget | None
clear(self)
clearContents(self)
closePersistentEditor(self, item: QTableWidgetItem | None)
column(self, item: QTableWidgetItem | None) int
columnCount(self) int
currentCellChanged

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

currentColumn(self) int
currentItem(self) QTableWidgetItem | None
currentItemChanged

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

currentRow(self) int
dropEvent(self, event: QDropEvent | None)
dropMimeData(self, row: int, column: int, data: QMimeData | None, action: Qt.DropAction) bool
editItem(self, item: QTableWidgetItem | None)
event(self, e: QEvent | None) bool
findItems(self, text: str | None, flags: Qt.MatchFlags | Qt.MatchFlag) List[QTableWidgetItem]
horizontalHeaderItem(self, column: int) QTableWidgetItem | None
indexFromItem(self, item: QTableWidgetItem | None) QModelIndex
insertColumn(self, column: int)
insertRow(self, row: int)
isPersistentEditorOpen(self, item: QTableWidgetItem | None) bool
isSortingEnabled(self) bool
item(self, row: int, column: int) QTableWidgetItem | None
itemActivated

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

itemAt(self, p: QPoint) QTableWidgetItem | None
itemAt(self, ax: int, ay: int) QTableWidgetItem | None
itemChanged

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

itemClicked

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

itemDoubleClicked

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

itemEntered

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

itemFromIndex(self, index: QModelIndex) QTableWidgetItem | None
itemPressed

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

itemPrototype(self) QTableWidgetItem | None
itemSelectionChanged

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

items(self, data: QMimeData | None) List[QTableWidgetItem]
mimeData(self, items: Iterable[QTableWidgetItem]) QMimeData | None
mimeTypes(self) List[str]
openPersistentEditor(self, item: QTableWidgetItem | None)
removeCellWidget(self, arow: int, acolumn: int)
removeColumn(self, column: int)
removeRow(self, row: int)
row(self, item: QTableWidgetItem | None) int
rowCount(self) int
scrollToItem(self, item: QTableWidgetItem | None, hint: QAbstractItemView.ScrollHint = QAbstractItemView.EnsureVisible)
selectedItems(self) List[QTableWidgetItem]
selectedRanges(self) List[QTableWidgetSelectionRange]
setCellWidget(self, row: int, column: int, widget: QWidget | None)
setColumnCount(self, columns: int)
setCurrentCell(self, row: int, column: int)
setCurrentCell(self, row: int, column: int, command: QItemSelectionModel.SelectionFlags | QItemSelectionModel.SelectionFlag) None
setCurrentItem(self, item: QTableWidgetItem | None)
setCurrentItem(self, item: QTableWidgetItem | None, command: QItemSelectionModel.SelectionFlags | QItemSelectionModel.SelectionFlag) None
setHorizontalHeaderItem(self, column: int, item: QTableWidgetItem | None)
setHorizontalHeaderLabels(self, labels: Iterable[str | None])
setItem(self, row: int, column: int, item: QTableWidgetItem | None)
setItemPrototype(self, item: QTableWidgetItem | None)
setModel(self, model: QAbstractItemModel | None)
setRangeSelected(self, range: QTableWidgetSelectionRange, select: bool)
setRowCount(self, rows: int)
setSortingEnabled(self, enable: bool)
setVerticalHeaderItem(self, row: int, item: QTableWidgetItem | None)
setVerticalHeaderLabels(self, labels: Iterable[str | None])
sortItems(self, column: int, order: Qt.SortOrder = Qt.AscendingOrder)
supportedDropActions(self) Qt.DropActions
takeHorizontalHeaderItem(self, column: int) QTableWidgetItem | None
takeItem(self, row: int, column: int) QTableWidgetItem | None
takeVerticalHeaderItem(self, row: int) QTableWidgetItem | None
verticalHeaderItem(self, row: int) QTableWidgetItem | None
visualColumn(self, logicalColumn: int) int
visualItemRect(self, item: QTableWidgetItem | None) QRect
visualRow(self, logicalRow: int) int
class populse_mia.user_interface.data_browser.modify_table.QTableWidgetItem(type: int = QTableWidgetItem.ItemType.Type)
class populse_mia.user_interface.data_browser.modify_table.QTableWidgetItem(text: str | None, type: int = QTableWidgetItem.ItemType.Type)
class populse_mia.user_interface.data_browser.modify_table.QTableWidgetItem(icon: QIcon, text: str | None, type: int = QTableWidgetItem.ItemType.Type)
class populse_mia.user_interface.data_browser.modify_table.QTableWidgetItem(other: QTableWidgetItem)

Bases: wrapper

class ItemType

Bases: int

Type = 0
UserType = 1000
background(self) QBrush
checkState(self) Qt.CheckState
clone(self) QTableWidgetItem | None
column(self) int
data(self, role: int) Any
flags(self) Qt.ItemFlags
font(self) QFont
foreground(self) QBrush
icon(self) QIcon
isSelected(self) bool
read(self, in_: QDataStream)
row(self) int
setBackground(self, brush: QBrush | QColor | Qt.GlobalColor | QGradient)
setCheckState(self, state: Qt.CheckState)
setData(self, role: int, value: Any)
setFlags(self, aflags: Qt.ItemFlags | Qt.ItemFlag)
setFont(self, afont: QFont)
setForeground(self, brush: QBrush | QColor | Qt.GlobalColor | QGradient)
setIcon(self, aicon: QIcon)
setSelected(self, aselect: bool)
setSizeHint(self, size: QSize)
setStatusTip(self, astatusTip: str | None)
setText(self, atext: str | None)
setTextAlignment(self, alignment: int)
setToolTip(self, atoolTip: str | None)
setWhatsThis(self, awhatsThis: str | None)
sizeHint(self) QSize
statusTip(self) str
tableWidget(self) QTableWidget | None
text(self) str
textAlignment(self) int
toolTip(self) str
type(self) int
whatsThis(self) str
write(self, out: QDataStream)
class populse_mia.user_interface.data_browser.modify_table.QVBoxLayout
class populse_mia.user_interface.data_browser.modify_table.QVBoxLayout(parent: QWidget | None)

Bases: QBoxLayout

populse_mia.user_interface.data_browser.modify_table.check_value_type(value, value_type, is_subvalue=False)[source]

Checks the type of new value in a table cell (QTableWidget).

Parameters:
  • (str) (value) – Value of the cell (always a str, can be a string representation of a list)

  • (type) (value_type) – Expected type (can be list[str], list[int], etc.)

  • (bool) (is_subvalue) – Whether the value is a subvalue of a list.

Returns:

True if the value is valid to replace the old one, False otherwise

class populse_mia.user_interface.data_browser.modify_table.ModifyTable(project, value, types, scans, tags)[source]

Bases: QDialog

Dialog to modify cell contents containing lists in the data browser tab.

This dialog provides a user interface to edit cells that contain list values. It displays the list elements in a table and allows users to add or remove elements.

__init__(project, value, types, scans, tags)[source]

Initialize the ModifyTable dialog.

Parameters:
  • project – Instance of the current project

  • value – List of values in the cell to be modified

  • types – Allowed value types for validation

  • scans – Scan identifiers corresponding to rows

  • tags – Tag identifiers corresponding to columns

_convert_value(text, field_type)[source]

Convert a text value to the appropriate type based on field_type.

Parameters:
  • text – String value to convert

  • field_type – Database field type constant

Returns:

The converted value in the appropriate type

_show_error_message(value, type_problem)[source]

Display an error message for invalid values.

Parameters:
  • value – The invalid value

  • type_problem – The specific type that failed validation

add_item()[source]

Add a new element to the list with default value 0.

fill_table()[source]

Populate the table with the current list elements.

Configures the table dimensions, populates cells with values, and adjusts table size to fit content within reasonable bounds.

rem_last_item()[source]

Remove the last element of the list if there’s more than one element.

Lists must maintain at least one element.

update_table_values(test=False)[source]

Validate user input and update the database with new values.

Validates each value against specified types and updates the database only if all values are valid.

Parameters:

(bool) (test) – Flag for testing mode, defaults to False