From 2c542be7ddf0f8ef743ce3ccee8a71f4020776d1 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 23 Nov 2018 15:30:05 +0100 Subject: Use type safe connect in mappingtableeditor.cpp Also use the proper typed return value in flags and remove the directory prefixes in the includes. --- mappingtableeditor.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mappingtableeditor.cpp b/mappingtableeditor.cpp index d1fe985..4c85313 100644 --- a/mappingtableeditor.cpp +++ b/mappingtableeditor.cpp @@ -7,12 +7,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "mappingtableeditor.h" @@ -71,12 +71,12 @@ MappingTableEditor::MappingTableEditor(const QString &table, QWidget *parent) : mView->addAction(mEditA); //connections - connect(mView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(selectionChanged(QModelIndex,QModelIndex))); - connect(mClose, SIGNAL(clicked()), this, SLOT(accept())); - connect(mDelete, SIGNAL(clicked()), this, SLOT(removeItem())); - connect(mRename, SIGNAL(clicked()), this, SLOT(renameItem())); - connect(mDeleteA, SIGNAL(triggered()), this, SLOT(removeItem())); - connect(mEditA, SIGNAL(triggered()), this, SLOT(editItem())); + connect(mView->selectionModel(), &QItemSelectionModel::currentChanged, this, &MappingTableEditor::selectionChanged); + connect(mClose, &QPushButton::clicked, this, &MappingTableEditor::accept); + connect(mDelete, &QPushButton::clicked, this, &MappingTableEditor::removeItem); + connect(mRename, &QPushButton::clicked, this, &MappingTableEditor::renameItem); + connect(mDeleteA, &QAction::triggered, this, &MappingTableEditor::removeItem); + connect(mEditA, &QAction::triggered, this, &MappingTableEditor::editItem); } void MappingTableEditor::selectionChanged(const QModelIndex &cur, const QModelIndex &prev){ @@ -146,7 +146,7 @@ MappingTableEditorModel::MappingTableEditorModel(const QString &table, const QSt Qt::ItemFlags MappingTableEditorModel::flags(const QModelIndex &index) const{ if(!index.isValid()){ - return 0; + return Qt::NoItemFlags; } Qt::ItemFlags retval = Qt::ItemIsEnabled | Qt::ItemIsSelectable; if(index.column() == 0){ -- cgit v1.2.3-70-g09d2