diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-05-16 09:46:30 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-05-16 10:09:35 -0700 |
commit | 27505aedfb06333671652d4ead8ac95041fc5473 (patch) | |
tree | bd5ff772b2f720158ad436dab78da9d5e0314f14 /desktop-widgets/modeldelegates.h | |
parent | fc6d99eb932109ab4edfe7e61a7a79f2e5c5aa3b (diff) | |
download | subsurface-27505aedfb06333671652d4ead8ac95041fc5473.tar.gz |
cleanup: use pointer-to-member style connect for ComboBoxDelegate
This was still using the archaic macro version, because Qt decided
to parameter-overload the signals (which turned out to be a horrible
idea). However, since we switched to fairly recent Qt this can be
solved using the qOverload template.
In this case things are a bit more complicated because we overload
the corresponding slots. Since we have control over that, let's
just disambiguate their names instead of using the cryptic qOverload.
While doing this, tighten the access specifiers of the slots. Turn
public into private and protected as appropriate.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/modeldelegates.h')
-rw-r--r-- | desktop-widgets/modeldelegates.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/desktop-widgets/modeldelegates.h b/desktop-widgets/modeldelegates.h index 704857ded..f3858ce1e 100644 --- a/desktop-widgets/modeldelegates.h +++ b/desktop-widgets/modeldelegates.h @@ -34,12 +34,14 @@ class ComboBoxDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit ComboBoxDelegate(QAbstractItemModel *model, QObject *parent = 0, bool allowEdit = true); -public +private slots: - void testActivation(const QString &currString); - void testActivation(const QModelIndex &currIndex); + void testActivationString(const QString &currString); + void testActivationIndex(const QModelIndex &currIndex); //HACK: try to get rid of this in the future. void fakeActivation(); +protected +slots: virtual void editorClosed(QWidget *widget, QAbstractItemDelegate::EndEditHint hint) = 0; private: bool editable; |