mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
[dbmanager] Fixes various signal bugs after 8bda5c
Fixes some unreported glitches after new signals migration. Also fixes #14649
This commit is contained in:
parent
170c95554e
commit
1e6dceb7d2
@ -20,7 +20,8 @@ email : brush.tyler@gmail.com
|
||||
***************************************************************************/
|
||||
"""
|
||||
|
||||
from PyQt.QtCore import Qt, QObject, qDebug, QByteArray, QMimeData, QDataStream, QIODevice, QFileInfo, QAbstractItemModel, QModelIndex, pyqtSignal
|
||||
from functools import partial
|
||||
from PyQt.QtCore import Qt, QObject, qDebug, QByteArray, QMimeData, QDataStream, QIODevice, QFileInfo, QAbstractItemModel, QModelIndex, pyqtSignal, pyqtSlot
|
||||
from PyQt.QtWidgets import QApplication, QMessageBox
|
||||
from PyQt.QtGui import QIcon
|
||||
|
||||
@ -302,7 +303,7 @@ class DBModel(QAbstractItemModel):
|
||||
for dbtype in supportedDbTypes():
|
||||
dbpluginclass = createDbPlugin(dbtype)
|
||||
item = PluginItem(dbpluginclass, self.rootItem)
|
||||
item.itemChanged.connect(self.refreshItem)
|
||||
item.itemChanged.connect(partial(self.refreshItem, item))
|
||||
|
||||
def refreshItem(self, item):
|
||||
if isinstance(item, TreeItem):
|
||||
@ -486,7 +487,7 @@ class DBModel(QAbstractItemModel):
|
||||
if prevPopulated or force:
|
||||
if item.populate():
|
||||
for child in item.childItems:
|
||||
child.itemChanged.connect(self.refreshItem)
|
||||
child.itemChanged.connect(partial(self.refreshItem, item))
|
||||
self._onDataChanged(index)
|
||||
else:
|
||||
self.notPopulated.emit(index)
|
||||
|
@ -148,7 +148,7 @@ class SLDatabase(Database):
|
||||
self.runVacuum()
|
||||
|
||||
def runVacuum(self):
|
||||
self.database().aboutToChange()
|
||||
self.database().aboutToChange.emit()
|
||||
self.database().connector.runVacuum()
|
||||
self.database().refresh()
|
||||
|
||||
|
@ -24,7 +24,7 @@ The content of this file is based on
|
||||
|
||||
from PyQt.QtCore import Qt, QModelIndex
|
||||
from PyQt.QtWidgets import QItemDelegate, QComboBox, QDialog, QPushButton, QDialogButtonBox, QMessageBox, QApplication
|
||||
from PyQt.QtCore import QItemSelectionModel
|
||||
from PyQt.QtCore import QItemSelectionModel, pyqtSignal
|
||||
|
||||
from .db_plugins.data_model import TableFieldsModel
|
||||
from .db_plugins.plugin import DbError, ConnectionError
|
||||
@ -37,6 +37,8 @@ class TableFieldsDelegate(QItemDelegate):
|
||||
|
||||
""" delegate with some special item editors """
|
||||
|
||||
columnNameChanged = pyqtSignal()
|
||||
|
||||
def __init__(self, field_types, parent=None):
|
||||
QItemDelegate.__init__(self, parent)
|
||||
self.fieldTypes = field_types
|
||||
|
Loading…
x
Reference in New Issue
Block a user