From 9771c57a54d4f56aadb623b9203d4b7320067273 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 12 Apr 2020 11:58:35 +0200 Subject: delegates: remove TankInfoDelegate::createEditor() When creating a TankInfoDelegate editor, reploting of the profile was disabled to avoid replotting when the user scrolls through the tank-info list. Since the code was changed to only set the tank-info when the editor is closed, this became unnecessary (hopefully). Indeed the clearing of the flag was removed in a previous commit. This means that we also have to remove the setting of the flag. Since this is all the TankInfoDelegate::createEditor() function was doing, we can remove the whole function. Signed-off-by: Berthold Stoeger --- desktop-widgets/modeldelegates.cpp | 7 ------- desktop-widgets/modeldelegates.h | 1 - 2 files changed, 8 deletions(-) diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp index 5480a41db..781ee740d 100644 --- a/desktop-widgets/modeldelegates.cpp +++ b/desktop-widgets/modeldelegates.cpp @@ -247,13 +247,6 @@ void TankInfoDelegate::editorClosed(QWidget*, QAbstractItemDelegate::EndEditHint mymodel->setData(IDX(CylindersModel::TYPE), currCombo.activeText, CylindersModel::COMMIT_ROLE); } -QWidget *TankInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const -{ - QWidget *delegate = ComboBoxDelegate::createEditor(parent, option, index); - MainWindow::instance()->graphics->setReplot(false); - return delegate; -} - TankUseDelegate::TankUseDelegate(QObject *parent) : QStyledItemDelegate(parent) { } diff --git a/desktop-widgets/modeldelegates.h b/desktop-widgets/modeldelegates.h index 95e9c5fef..db804c8be 100644 --- a/desktop-widgets/modeldelegates.h +++ b/desktop-widgets/modeldelegates.h @@ -63,7 +63,6 @@ class TankInfoDelegate : public ComboBoxDelegate { public: explicit TankInfoDelegate(QObject *parent = 0); void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; public slots: void editorClosed(QWidget *widget, QAbstractItemDelegate::EndEditHint hint); -- cgit v1.2.3-70-g09d2