1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-05-10 10:11:28 +00:00

functor-based Qt signal-slot syntax construction set

This commit is contained in:
mpeco 2022-08-22 23:28:58 -03:00
parent 405a5c5d25
commit 78700eee57
93 changed files with 769 additions and 767 deletions

View file

@ -44,34 +44,31 @@ CS::Editor::Editor (int argc, char **argv)
mFileDialog.setLocalData (mLocal); mFileDialog.setLocalData (mLocal);
mMerge.setLocalData (mLocal); mMerge.setLocalData (mLocal);
connect (&mDocumentManager, SIGNAL (documentAdded (CSMDoc::Document *)), connect (&mDocumentManager, &CSMDoc::DocumentManager::documentAdded,
this, SLOT (documentAdded (CSMDoc::Document *))); this, &Editor::documentAdded);
connect (&mDocumentManager, SIGNAL (documentAboutToBeRemoved (CSMDoc::Document *)), connect (&mDocumentManager, &CSMDoc::DocumentManager::documentAboutToBeRemoved,
this, SLOT (documentAboutToBeRemoved (CSMDoc::Document *))); this, &Editor::documentAboutToBeRemoved);
connect (&mDocumentManager, SIGNAL (lastDocumentDeleted()), connect (&mDocumentManager, &CSMDoc::DocumentManager::lastDocumentDeleted,
this, SLOT (lastDocumentDeleted())); this, &Editor::lastDocumentDeleted);
connect (mViewManager, SIGNAL (newGameRequest ()), this, SLOT (createGame ())); connect (mViewManager, &CSVDoc::ViewManager::newGameRequest, this, &Editor::createGame);
connect (mViewManager, SIGNAL (newAddonRequest ()), this, SLOT (createAddon ())); connect (mViewManager, &CSVDoc::ViewManager::newAddonRequest, this, &Editor::createAddon);
connect (mViewManager, SIGNAL (loadDocumentRequest ()), this, SLOT (loadDocument ())); connect (mViewManager, &CSVDoc::ViewManager::loadDocumentRequest, this, &Editor::loadDocument);
connect (mViewManager, SIGNAL (editSettingsRequest()), this, SLOT (showSettings ())); connect (mViewManager, &CSVDoc::ViewManager::editSettingsRequest, this, &Editor::showSettings);
connect (mViewManager, SIGNAL (mergeDocument (CSMDoc::Document *)), this, SLOT (mergeDocument (CSMDoc::Document *))); connect (mViewManager, &CSVDoc::ViewManager::mergeDocument, this, &Editor::mergeDocument);
connect (&mStartup, SIGNAL (createGame()), this, SLOT (createGame ())); connect (&mStartup, &CSVDoc::StartupDialogue::createGame, this, &Editor::createGame);
connect (&mStartup, SIGNAL (createAddon()), this, SLOT (createAddon ())); connect (&mStartup, &CSVDoc::StartupDialogue::createAddon, this, &Editor::createAddon);
connect (&mStartup, SIGNAL (loadDocument()), this, SLOT (loadDocument ())); connect (&mStartup, &CSVDoc::StartupDialogue::loadDocument, this, &Editor::loadDocument);
connect (&mStartup, SIGNAL (editConfig()), this, SLOT (showSettings ())); connect (&mStartup, &CSVDoc::StartupDialogue::editConfig, this, &Editor::showSettings);
connect (&mFileDialog, SIGNAL(signalOpenFiles (const boost::filesystem::path&)), connect (&mFileDialog, &CSVDoc::FileDialog::signalOpenFiles,
this, SLOT(openFiles (const boost::filesystem::path&))); this, [this](const boost::filesystem::path &savePath){ this->openFiles(savePath); });
connect (&mFileDialog, &CSVDoc::FileDialog::signalCreateNewFile, this, &Editor::createNewFile);
connect (&mFileDialog, &CSVDoc::FileDialog::rejected, this, &Editor::cancelFileDialog);
connect (&mFileDialog, SIGNAL(signalCreateNewFile (const boost::filesystem::path&)), connect (&mNewGame, &CSVDoc::NewGameDialogue::createRequest, this, &Editor::createNewGame);
this, SLOT(createNewFile (const boost::filesystem::path&))); connect (&mNewGame, &CSVDoc::NewGameDialogue::cancelCreateGame, this, &Editor::cancelCreateGame);
connect (&mFileDialog, SIGNAL (rejected()), this, SLOT (cancelFileDialog ()));
connect (&mNewGame, SIGNAL (createRequest (const boost::filesystem::path&)),
this, SLOT (createNewGame (const boost::filesystem::path&)));
connect (&mNewGame, SIGNAL (cancelCreateGame()), this, SLOT (cancelCreateGame ()));
} }
CS::Editor::~Editor () CS::Editor::~Editor ()
@ -343,7 +340,7 @@ bool CS::Editor::makeIPCServer()
if(mServer->listen(mIpcServerName)) if(mServer->listen(mIpcServerName))
{ {
connect(mServer, SIGNAL(newConnection()), this, SLOT(showStartup())); connect(mServer, &QLocalServer::newConnection, this, &Editor::showStartup);
return true; return true;
} }

View file

@ -325,22 +325,20 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration,
addOptionalGlobals(); addOptionalGlobals();
addOptionalMagicEffects(); addOptionalMagicEffects();
connect (&mUndoStack, SIGNAL (cleanChanged (bool)), this, SLOT (modificationStateChanged (bool))); connect (&mUndoStack, &QUndoStack::cleanChanged, this, &Document::modificationStateChanged);
connect (&mTools, SIGNAL (progress (int, int, int)), this, SLOT (progress (int, int, int))); connect (&mTools, &CSMTools::Tools::progress, this, qOverload<int, int, int>(&Document::progress));
connect (&mTools, SIGNAL (done (int, bool)), this, SIGNAL (operationDone (int, bool))); connect (&mTools, &CSMTools::Tools::done, this, &Document::operationDone);
connect (&mTools, SIGNAL (done (int, bool)), this, SLOT (operationDone2 (int, bool))); connect (&mTools, &CSMTools::Tools::done, this, &Document::operationDone2);
connect (&mTools, SIGNAL (mergeDone (CSMDoc::Document*)), connect (&mTools, &CSMTools::Tools::mergeDone, this, &Document::mergeDone);
this, SIGNAL (mergeDone (CSMDoc::Document*)));
connect (&mSaving, SIGNAL (progress (int, int, int)), this, SLOT (progress (int, int, int))); connect (&mSaving, &OperationHolder::progress,
connect (&mSaving, SIGNAL (done (int, bool)), this, SLOT (operationDone2 (int, bool))); this, qOverload<int, int, int>(&Document::progress));
connect (&mSaving, &OperationHolder::done, this, &Document::operationDone2);
connect ( connect (&mSaving, &OperationHolder::reportMessage, this, &Document::reportMessage);
&mSaving, SIGNAL (reportMessage (const CSMDoc::Message&, int)),
this, SLOT (reportMessage (const CSMDoc::Message&, int)));
connect (&mRunner, SIGNAL (runStateChanged()), this, SLOT (runStateChanged())); connect (&mRunner, &Runner::runStateChanged, this, &Document::runStateChanged);
} }
CSMDoc::Document::~Document() CSMDoc::Document::~Document()

View file

@ -19,20 +19,20 @@ CSMDoc::DocumentManager::DocumentManager (const Files::ConfigurationManager& con
mLoader.moveToThread (&mLoaderThread); mLoader.moveToThread (&mLoaderThread);
mLoaderThread.start(); mLoaderThread.start();
connect (&mLoader, SIGNAL (documentLoaded (Document *)), connect (&mLoader, &Loader::documentLoaded,
this, SLOT (documentLoaded (Document *))); this, &DocumentManager::documentLoaded);
connect (&mLoader, SIGNAL (documentNotLoaded (Document *, const std::string&)), connect (&mLoader, &Loader::documentNotLoaded,
this, SLOT (documentNotLoaded (Document *, const std::string&))); this, &DocumentManager::documentNotLoaded);
connect (this, SIGNAL (loadRequest (CSMDoc::Document *)), connect (this, &DocumentManager::loadRequest,
&mLoader, SLOT (loadDocument (CSMDoc::Document *))); &mLoader, &Loader::loadDocument);
connect (&mLoader, SIGNAL (nextStage (CSMDoc::Document *, const std::string&, int)), connect (&mLoader, &Loader::nextStage,
this, SIGNAL (nextStage (CSMDoc::Document *, const std::string&, int))); this, &DocumentManager::nextStage);
connect (&mLoader, SIGNAL (nextRecord (CSMDoc::Document *, int)), connect (&mLoader, &Loader::nextRecord,
this, SIGNAL (nextRecord (CSMDoc::Document *, int))); this, &DocumentManager::nextRecord);
connect (this, SIGNAL (cancelLoading (CSMDoc::Document *)), connect (this, &DocumentManager::cancelLoading,
&mLoader, SLOT (abortLoading (CSMDoc::Document *))); &mLoader, &Loader::abortLoading);
connect (&mLoader, SIGNAL (loadMessage (CSMDoc::Document *, const std::string&)), connect (&mLoader, &Loader::loadMessage,
this, SIGNAL (loadMessage (CSMDoc::Document *, const std::string&))); this, &DocumentManager::loadMessage);
} }
CSMDoc::DocumentManager::~DocumentManager() CSMDoc::DocumentManager::~DocumentManager()

View file

@ -14,7 +14,7 @@ CSMDoc::Loader::Loader()
{ {
mTimer = new QTimer (this); mTimer = new QTimer (this);
connect (mTimer, SIGNAL (timeout()), this, SLOT (load())); connect (mTimer, &QTimer::timeout, this, &Loader::load);
mTimer->start(); mTimer->start();
} }

View file

@ -45,7 +45,7 @@ void CSMDoc::Operation::run()
if (!mConnected) if (!mConnected)
{ {
connect (mTimer, SIGNAL (timeout()), this, SLOT (executeStage())); connect (mTimer, &QTimer::timeout, this, &Operation::executeStage);
mConnected = true; mConnected = true;
} }

View file

@ -15,21 +15,18 @@ void CSMDoc::OperationHolder::setOperation (Operation *operation)
mOperation = operation; mOperation = operation;
mOperation->moveToThread (&mThread); mOperation->moveToThread (&mThread);
connect ( connect (mOperation, &Operation::progress,
mOperation, SIGNAL (progress (int, int, int)), this, &OperationHolder::progress);
this, SIGNAL (progress (int, int, int)));
connect ( connect (mOperation, &Operation::reportMessage,
mOperation, SIGNAL (reportMessage (const CSMDoc::Message&, int)), this, &OperationHolder::reportMessage);
this, SIGNAL (reportMessage (const CSMDoc::Message&, int)));
connect ( connect (mOperation, &Operation::done,
mOperation, SIGNAL (done (int, bool)), this, &OperationHolder::doneSlot);
this, SLOT (doneSlot (int, bool)));
connect (this, SIGNAL (abortSignal()), mOperation, SLOT (abort())); connect (this, &OperationHolder::abortSignal, mOperation, &Operation::abort);
connect (&mThread, SIGNAL (started()), mOperation, SLOT (run())); connect (&mThread, &QThread::started, mOperation, &Operation::run);
} }
bool CSMDoc::OperationHolder::isRunning() const bool CSMDoc::OperationHolder::isRunning() const

View file

@ -10,11 +10,11 @@
CSMDoc::Runner::Runner (const boost::filesystem::path& projectPath) CSMDoc::Runner::Runner (const boost::filesystem::path& projectPath)
: mRunning (false), mStartup (nullptr), mProjectPath (projectPath) : mRunning (false), mStartup (nullptr), mProjectPath (projectPath)
{ {
connect (&mProcess, SIGNAL (finished (int, QProcess::ExitStatus)), connect (&mProcess, qOverload<int, QProcess::ExitStatus>(&QProcess::finished),
this, SLOT (finished (int, QProcess::ExitStatus))); this, &Runner::finished);
connect (&mProcess, SIGNAL (readyReadStandardOutput()), connect (&mProcess, &QProcess::readyReadStandardOutput,
this, SLOT (readyReadStandardOutput())); this, &Runner::readyReadStandardOutput);
mProcess.setProcessChannelMode (QProcess::MergedChannels); mProcess.setProcessChannelMode (QProcess::MergedChannels);
@ -149,7 +149,7 @@ void CSMDoc::Runner::readyReadStandardOutput()
CSMDoc::SaveWatcher::SaveWatcher (Runner *runner, OperationHolder *operation) CSMDoc::SaveWatcher::SaveWatcher (Runner *runner, OperationHolder *operation)
: QObject (runner), mRunner (runner) : QObject (runner), mRunner (runner)
{ {
connect (operation, SIGNAL (done (int, bool)), this, SLOT (saveDone (int, bool))); connect (operation, &OperationHolder::done, this, &SaveWatcher::saveDone);
} }
void CSMDoc::SaveWatcher::saveDone (int type, bool failed) void CSMDoc::SaveWatcher::saveDone (int type, bool failed)

View file

@ -30,7 +30,7 @@ std::pair<QWidget *, QWidget *> CSMPrefs::BoolSetting::makeWidgets (QWidget *par
mWidget->setToolTip (tooltip); mWidget->setToolTip (tooltip);
} }
connect (mWidget, SIGNAL (stateChanged (int)), this, SLOT (valueChanged (int))); connect (mWidget, &QCheckBox::stateChanged, this, &BoolSetting::valueChanged);
return std::make_pair (static_cast<QWidget *> (nullptr), mWidget); return std::make_pair (static_cast<QWidget *> (nullptr), mWidget);
} }

View file

@ -35,7 +35,7 @@ std::pair<QWidget *, QWidget *> CSMPrefs::ColourSetting::makeWidgets (QWidget *p
mWidget->setToolTip (tooltip); mWidget->setToolTip (tooltip);
} }
connect (mWidget, SIGNAL (pickingFinished()), this, SLOT (valueChanged())); connect (mWidget, &CSVWidget::ColorEditor::pickingFinished, this, &ColourSetting::valueChanged);
return std::make_pair (label, mWidget); return std::make_pair (label, mWidget);
} }

View file

@ -66,7 +66,7 @@ std::pair<QWidget *, QWidget *> CSMPrefs::DoubleSetting::makeWidgets (QWidget *p
mWidget->setToolTip (tooltip); mWidget->setToolTip (tooltip);
} }
connect (mWidget, SIGNAL (valueChanged (double)), this, SLOT (valueChanged (double))); connect (mWidget, qOverload<double>(&QDoubleSpinBox::valueChanged), this, &DoubleSetting::valueChanged);
return std::make_pair (label, mWidget); return std::make_pair (label, mWidget);
} }

View file

@ -97,7 +97,7 @@ std::pair<QWidget *, QWidget *> CSMPrefs::EnumSetting::makeWidgets (QWidget *par
label->setToolTip (tooltip); label->setToolTip (tooltip);
} }
connect (mWidget, SIGNAL (currentIndexChanged (int)), this, SLOT (valueChanged (int))); connect (mWidget, qOverload<int>(&QComboBox::currentIndexChanged), this, &EnumSetting::valueChanged);
return std::make_pair (label, mWidget); return std::make_pair (label, mWidget);
} }

View file

@ -58,7 +58,7 @@ std::pair<QWidget *, QWidget *> CSMPrefs::IntSetting::makeWidgets (QWidget *pare
mWidget->setToolTip (tooltip); mWidget->setToolTip (tooltip);
} }
connect (mWidget, SIGNAL (valueChanged (int)), this, SLOT (valueChanged (int))); connect (mWidget, qOverload<int>(&QSpinBox::valueChanged), this, &IntSetting::valueChanged);
return std::make_pair (label, mWidget); return std::make_pair (label, mWidget);
} }

View file

@ -40,7 +40,7 @@ namespace CSMPrefs
mButton = widget; mButton = widget;
connect(widget, SIGNAL(toggled(bool)), this, SLOT(buttonToggled(bool))); connect (widget, &QPushButton::toggled, this, &ModifierSetting::buttonToggled);
return std::make_pair(label, widget); return std::make_pair(label, widget);
} }

View file

@ -176,8 +176,8 @@ namespace CSMPrefs
{ {
mAction->setText(mActionText); mAction->setText(mActionText);
disconnect(this, SIGNAL(activated()), mAction, SLOT(trigger())); disconnect(this, qOverload<>(&Shortcut::activated), mAction, &QAction::trigger);
disconnect(mAction, SIGNAL(destroyed()), this, SLOT(actionDeleted())); disconnect(mAction, &QAction::destroyed, this, &Shortcut::actionDeleted);
} }
mAction = action; mAction = action;
@ -187,8 +187,8 @@ namespace CSMPrefs
mActionText = mAction->text(); mActionText = mAction->text();
mAction->setText(mActionText + "\t" + State::get().getShortcutManager().convertToString(mSequence).data()); mAction->setText(mActionText + "\t" + State::get().getShortcutManager().convertToString(mSequence).data());
connect(this, SIGNAL(activated()), mAction, SLOT(trigger())); connect(this, qOverload<>(&Shortcut::activated), mAction, &QAction::trigger);
connect(mAction, SIGNAL(destroyed()), this, SLOT(actionDeleted())); connect(mAction, &QAction::destroyed, this, &Shortcut::actionDeleted);
} }
} }

View file

@ -34,7 +34,7 @@ namespace CSMPrefs
// Intercept widget events // Intercept widget events
widget->installEventFilter(this); widget->installEventFilter(this);
connect(widget, SIGNAL(destroyed()), this, SLOT(widgetDestroyed())); connect(widget, &QWidget::destroyed, this, &ShortcutEventHandler::widgetDestroyed);
} }
// Add to list // Add to list

View file

@ -46,7 +46,7 @@ namespace CSMPrefs
mButton = widget; mButton = widget;
connect(widget, SIGNAL(toggled(bool)), this, SLOT(buttonToggled(bool))); connect(widget, &QPushButton::toggled, this, &ShortcutSetting::buttonToggled);
return std::make_pair(label, widget); return std::make_pair(label, widget);
} }

View file

@ -30,7 +30,7 @@ std::pair<QWidget *, QWidget *> CSMPrefs::StringSetting::makeWidgets (QWidget *p
mWidget->setToolTip (tooltip); mWidget->setToolTip (tooltip);
} }
connect (mWidget, SIGNAL (textChanged (QString)), this, SLOT (textChanged (QString))); connect (mWidget, &QLineEdit::textChanged, this, &StringSetting::textChanged);
return std::make_pair (static_cast<QWidget *> (nullptr), mWidget); return std::make_pair (static_cast<QWidget *> (nullptr), mWidget);
} }

View file

@ -55,10 +55,10 @@ CSMDoc::OperationHolder *CSMTools::Tools::getVerifier()
{ {
mVerifierOperation = new CSMDoc::Operation (CSMDoc::State_Verifying, false); mVerifierOperation = new CSMDoc::Operation (CSMDoc::State_Verifying, false);
connect (&mVerifier, SIGNAL (progress (int, int, int)), this, SIGNAL (progress (int, int, int))); connect (&mVerifier, &CSMDoc::OperationHolder::progress, this, &Tools::progress);
connect (&mVerifier, SIGNAL (done (int, bool)), this, SIGNAL (done (int, bool))); connect (&mVerifier, &CSMDoc::OperationHolder::done, this, &Tools::done);
connect (&mVerifier, SIGNAL (reportMessage (const CSMDoc::Message&, int)), connect (&mVerifier, &CSMDoc::OperationHolder::reportMessage,
this, SLOT (verifierMessage (const CSMDoc::Message&, int))); this, &Tools::verifierMessage);
std::vector<std::string> mandatoryIds {"Day", "DaysPassed", "GameHour", "Month", "PCRace"}; std::vector<std::string> mandatoryIds {"Day", "DaysPassed", "GameHour", "Month", "PCRace"};
@ -143,13 +143,13 @@ CSMTools::Tools::Tools (CSMDoc::Document& document, ToUTF8::FromType encoding)
mReports.insert (std::make_pair (mNextReportNumber++, new ReportModel)); mReports.insert (std::make_pair (mNextReportNumber++, new ReportModel));
mActiveReports.insert (std::make_pair (CSMDoc::State_Loading, 0)); mActiveReports.insert (std::make_pair (CSMDoc::State_Loading, 0));
connect (&mSearch, SIGNAL (progress (int, int, int)), this, SIGNAL (progress (int, int, int))); connect (&mSearch, &CSMDoc::OperationHolder::progress, this, &Tools::progress);
connect (&mSearch, SIGNAL (done (int, bool)), this, SIGNAL (done (int, bool))); connect (&mSearch, &CSMDoc::OperationHolder::done, this, &Tools::done);
connect (&mSearch, SIGNAL (reportMessage (const CSMDoc::Message&, int)), connect (&mSearch, &CSMDoc::OperationHolder::reportMessage,
this, SLOT (verifierMessage (const CSMDoc::Message&, int))); this, &Tools::verifierMessage);
connect (&mMerge, SIGNAL (progress (int, int, int)), this, SIGNAL (progress (int, int, int))); connect (&mMerge, &CSMDoc::OperationHolder::progress, this, &Tools::progress);
connect (&mMerge, SIGNAL (done (int, bool)), this, SIGNAL (done (int, bool))); connect (&mMerge, &CSMDoc::OperationHolder::done, this, &Tools::done);
// don't need to connect report message, since there are no messages for merge // don't need to connect report message, since there are no messages for merge
} }
@ -222,8 +222,7 @@ void CSMTools::Tools::runMerge (std::unique_ptr<CSMDoc::Document> target)
{ {
mMergeOperation = new MergeOperation (mDocument, mEncoding); mMergeOperation = new MergeOperation (mDocument, mEncoding);
mMerge.setOperation (mMergeOperation); mMerge.setOperation (mMergeOperation);
connect (mMergeOperation, SIGNAL (mergeDone (CSMDoc::Document*)), connect (mMergeOperation, &MergeOperation::mergeDone, this, &Tools::mergeDone);
this, SIGNAL (mergeDone (CSMDoc::Document*)));
} }
target->flagAsDirty(); target->flagAsDirty();

View file

@ -194,28 +194,28 @@ namespace CSMWorld
{ {
// Setup qt slots and signals // Setup qt slots and signals
QAbstractItemModel* refModel = data.getTableModel(UniversalId::Type_Referenceable); QAbstractItemModel* refModel = data.getTableModel(UniversalId::Type_Referenceable);
connect(refModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)), connect(refModel, &QAbstractItemModel::rowsInserted,
this, SLOT(handleReferenceablesInserted(const QModelIndex&, int, int))); this, &ActorAdapter::handleReferenceablesInserted);
connect(refModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), connect(refModel, &QAbstractItemModel::dataChanged,
this, SLOT(handleReferenceableChanged(const QModelIndex&, const QModelIndex&))); this, &ActorAdapter::handleReferenceableChanged);
connect(refModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int)), connect(refModel, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT(handleReferenceablesAboutToBeRemoved(const QModelIndex&, int, int))); this, &ActorAdapter::handleReferenceablesAboutToBeRemoved);
QAbstractItemModel* raceModel = data.getTableModel(UniversalId::Type_Race); QAbstractItemModel* raceModel = data.getTableModel(UniversalId::Type_Race);
connect(raceModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)), connect(raceModel, &QAbstractItemModel::rowsInserted,
this, SLOT(handleRacesAboutToBeRemoved(const QModelIndex&, int, int))); this, &ActorAdapter::handleRacesAboutToBeRemoved);
connect(raceModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), connect(raceModel, &QAbstractItemModel::dataChanged,
this, SLOT(handleRaceChanged(const QModelIndex&, const QModelIndex&))); this, &ActorAdapter::handleRaceChanged);
connect(raceModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int)), connect(raceModel, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT(handleRacesAboutToBeRemoved(const QModelIndex&, int, int))); this, &ActorAdapter::handleRacesAboutToBeRemoved);
QAbstractItemModel* partModel = data.getTableModel(UniversalId::Type_BodyPart); QAbstractItemModel* partModel = data.getTableModel(UniversalId::Type_BodyPart);
connect(partModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)), connect(partModel, &QAbstractItemModel::rowsInserted,
this, SLOT(handleBodyPartsInserted(const QModelIndex&, int, int))); this, &ActorAdapter::handleBodyPartsInserted);
connect(partModel, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), connect(partModel, &QAbstractItemModel::dataChanged,
this, SLOT(handleBodyPartChanged(const QModelIndex&, const QModelIndex&))); this, &ActorAdapter::handleBodyPartChanged);
connect(partModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int)), connect(partModel, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT(handleBodyPartsAboutToBeRemoved(const QModelIndex&, int, int))); this, &ActorAdapter::handleBodyPartsAboutToBeRemoved);
} }
ActorAdapter::ActorDataPtr ActorAdapter::getActorData(const std::string& id) ActorAdapter::ActorDataPtr ActorAdapter::getActorData(const std::string& id)

View file

@ -38,12 +38,9 @@ void CSMWorld::Data::addModel (QAbstractItemModel *model, UniversalId::Type type
if (update) if (update)
{ {
connect (model, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (model, &QAbstractItemModel::dataChanged, this, &Data::dataChanged);
this, SLOT (dataChanged (const QModelIndex&, const QModelIndex&))); connect (model, &QAbstractItemModel::rowsInserted, this, &Data::rowsChanged);
connect (model, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (model, &QAbstractItemModel::rowsRemoved, this, &Data::rowsChanged);
this, SLOT (rowsChanged (const QModelIndex&, int, int)));
connect (model, SIGNAL (rowsRemoved (const QModelIndex&, int, int)),
this, SLOT (rowsChanged (const QModelIndex&, int, int)));
} }
} }

View file

@ -69,18 +69,12 @@ void CSMWorld::IdTableProxyModel::setSourceModel(QAbstractItemModel *model)
QSortFilterProxyModel::setSourceModel(model); QSortFilterProxyModel::setSourceModel(model);
mSourceModel = dynamic_cast<IdTableBase *>(sourceModel()); mSourceModel = dynamic_cast<IdTableBase *>(sourceModel());
connect(mSourceModel, connect(mSourceModel, &IdTableBase::rowsInserted,
SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, &IdTableProxyModel::sourceRowsInserted);
this, connect(mSourceModel, &IdTableBase::rowsRemoved,
SLOT(sourceRowsInserted(const QModelIndex &, int, int))); this, &IdTableProxyModel::sourceRowsRemoved);
connect(mSourceModel, connect(mSourceModel, &IdTableBase::dataChanged,
SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, &IdTableProxyModel::sourceDataChanged);
this,
SLOT(sourceRowsRemoved(const QModelIndex &, int, int)));
connect(mSourceModel,
SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)),
this,
SLOT(sourceDataChanged(const QModelIndex &, const QModelIndex &)));
} }
void CSMWorld::IdTableProxyModel::setFilter (const std::shared_ptr<CSMFilter::Node>& filter) void CSMWorld::IdTableProxyModel::setFilter (const std::shared_ptr<CSMFilter::Node>& filter)

View file

@ -15,26 +15,26 @@ CSMWorld::NestedTableProxyModel::NestedTableProxyModel(const QModelIndex& parent
QAbstractProxyModel::setSourceModel(parentModel); QAbstractProxyModel::setSourceModel(parentModel);
connect(mMainModel, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), connect(mMainModel, &IdTree::rowsAboutToBeInserted,
this, SLOT(forwardRowsAboutToInserted(const QModelIndex &, int, int))); this, &NestedTableProxyModel::forwardRowsAboutToInserted);
connect(mMainModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)), connect(mMainModel, &IdTree::rowsInserted,
this, SLOT(forwardRowsInserted(const QModelIndex &, int, int))); this, &NestedTableProxyModel::forwardRowsInserted);
connect(mMainModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), connect(mMainModel, &IdTree::rowsAboutToBeRemoved,
this, SLOT(forwardRowsAboutToRemoved(const QModelIndex &, int, int))); this, &NestedTableProxyModel::forwardRowsAboutToRemoved);
connect(mMainModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), connect(mMainModel, &IdTree::rowsRemoved,
this, SLOT(forwardRowsRemoved(const QModelIndex &, int, int))); this, &NestedTableProxyModel::forwardRowsRemoved);
connect(mMainModel, SIGNAL(resetStart(const QString&)), connect(mMainModel, &IdTree::resetStart,
this, SLOT(forwardResetStart(const QString&))); this, &NestedTableProxyModel::forwardResetStart);
connect(mMainModel, SIGNAL(resetEnd(const QString&)), connect(mMainModel, &IdTree::resetEnd,
this, SLOT(forwardResetEnd(const QString&))); this, &NestedTableProxyModel::forwardResetEnd);
connect(mMainModel, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), connect(mMainModel, &IdTree::dataChanged,
this, SLOT(forwardDataChanged(const QModelIndex &, const QModelIndex &))); this, &NestedTableProxyModel::forwardDataChanged);
} }
QModelIndex CSMWorld::NestedTableProxyModel::mapFromSource(const QModelIndex& sourceIndex) const QModelIndex CSMWorld::NestedTableProxyModel::mapFromSource(const QModelIndex& sourceIndex) const

View file

@ -280,21 +280,21 @@ CSMWorld::RegionMap::RegionMap (Data& data) : mData (data)
QAbstractItemModel *regions = data.getTableModel (UniversalId (UniversalId::Type_Regions)); QAbstractItemModel *regions = data.getTableModel (UniversalId (UniversalId::Type_Regions));
connect (regions, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (regions, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (regionsAboutToBeRemoved (const QModelIndex&, int, int))); this, &RegionMap::regionsAboutToBeRemoved);
connect (regions, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (regions, &QAbstractItemModel::rowsInserted,
this, SLOT (regionsInserted (const QModelIndex&, int, int))); this, &RegionMap::regionsInserted);
connect (regions, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (regions, &QAbstractItemModel::dataChanged,
this, SLOT (regionsChanged (const QModelIndex&, const QModelIndex&))); this, &RegionMap::regionsChanged);
QAbstractItemModel *cells = data.getTableModel (UniversalId (UniversalId::Type_Cells)); QAbstractItemModel *cells = data.getTableModel (UniversalId (UniversalId::Type_Cells));
connect (cells, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (cells, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (cellsAboutToBeRemoved (const QModelIndex&, int, int))); this, &RegionMap::cellsAboutToBeRemoved);
connect (cells, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (cells, &QAbstractItemModel::rowsInserted,
this, SLOT (cellsInserted (const QModelIndex&, int, int))); this, &RegionMap::cellsInserted);
connect (cells, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (cells, &QAbstractItemModel::dataChanged,
this, SLOT (cellsChanged (const QModelIndex&, const QModelIndex&))); this, &RegionMap::cellsChanged);
} }
int CSMWorld::RegionMap::rowCount (const QModelIndex& parent) const int CSMWorld::RegionMap::rowCount (const QModelIndex& parent) const

View file

@ -80,10 +80,10 @@ void CSVDoc::FileDialog::showDialog (ContentAction action)
if(!mDialogBuilt) if(!mDialogBuilt)
{ {
//connections common to both dialog view flavors //connections common to both dialog view flavors
connect (mSelector, SIGNAL (signalCurrentGamefileIndexChanged (int)), connect (mSelector, &ContentSelectorView::ContentSelector::signalCurrentGamefileIndexChanged,
this, SLOT (slotUpdateAcceptButton (int))); this, qOverload<int>(&FileDialog::slotUpdateAcceptButton));
connect (ui.projectButtonBox, SIGNAL (rejected()), this, SLOT (slotRejected())); connect (ui.projectButtonBox, &QDialogButtonBox::rejected, this, &FileDialog::slotRejected);
mDialogBuilt = true; mDialogBuilt = true;
} }
@ -107,16 +107,16 @@ void CSVDoc::FileDialog::buildNewFileView()
mFileWidget->setType (true); mFileWidget->setType (true);
mFileWidget->extensionLabelIsVisible(true); mFileWidget->extensionLabelIsVisible(true);
connect (mFileWidget, SIGNAL (nameChanged (const QString&, bool)), connect (mFileWidget, &FileWidget::nameChanged,
mAdjusterWidget, SLOT (setName (const QString&, bool))); mAdjusterWidget, &AdjusterWidget::setName);
connect (mFileWidget, SIGNAL (nameChanged(const QString &, bool)), connect (mFileWidget, &FileWidget::nameChanged,
this, SLOT (slotUpdateAcceptButton(const QString &, bool))); this, qOverload<const QString &, bool>(&FileDialog::slotUpdateAcceptButton));
} }
ui.projectGroupBoxLayout->insertWidget (0, mFileWidget); ui.projectGroupBoxLayout->insertWidget (0, mFileWidget);
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotNewFile())); connect (ui.projectButtonBox, &QDialogButtonBox::accepted, this, &FileDialog::slotNewFile);
} }
void CSVDoc::FileDialog::buildOpenFileView() void CSVDoc::FileDialog::buildOpenFileView()
@ -131,9 +131,10 @@ void CSVDoc::FileDialog::buildOpenFileView()
if(!mDialogBuilt) if(!mDialogBuilt)
{ {
connect (mSelector, SIGNAL (signalAddonDataChanged (const QModelIndex&, const QModelIndex&)), this, SLOT (slotAddonDataChanged(const QModelIndex&, const QModelIndex&))); connect (mSelector, &ContentSelectorView::ContentSelector::signalAddonDataChanged,
this, &FileDialog::slotAddonDataChanged);
} }
connect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile())); connect (ui.projectButtonBox, &QDialogButtonBox::accepted, this, &FileDialog::slotOpenFile);
} }
void CSVDoc::FileDialog::slotAddonDataChanged(const QModelIndex &topleft, const QModelIndex &bottomright) void CSVDoc::FileDialog::slotAddonDataChanged(const QModelIndex &topleft, const QModelIndex &bottomright)
@ -181,8 +182,8 @@ QString CSVDoc::FileDialog::filename() const
void CSVDoc::FileDialog::slotRejected() void CSVDoc::FileDialog::slotRejected()
{ {
emit rejected(); emit rejected();
disconnect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotNewFile())); disconnect (ui.projectButtonBox, &QDialogButtonBox::accepted, this, &FileDialog::slotNewFile);
disconnect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile())); disconnect (ui.projectButtonBox, &QDialogButtonBox::accepted, this, &FileDialog::slotOpenFile);
if(mFileWidget) if(mFileWidget)
{ {
delete mFileWidget; delete mFileWidget;
@ -199,7 +200,7 @@ void CSVDoc::FileDialog::slotNewFile()
delete mFileWidget; delete mFileWidget;
mFileWidget = nullptr; mFileWidget = nullptr;
} }
disconnect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotNewFile())); disconnect (ui.projectButtonBox, &QDialogButtonBox::accepted, this, &FileDialog::slotNewFile);
close(); close();
} }
@ -210,6 +211,6 @@ void CSVDoc::FileDialog::slotOpenFile()
mAdjusterWidget->setName (file->filePath(), !file->isGameFile()); mAdjusterWidget->setName (file->filePath(), !file->isGameFile());
emit signalOpenFiles (mAdjusterWidget->getPath()); emit signalOpenFiles (mAdjusterWidget->getPath());
disconnect (ui.projectButtonBox, SIGNAL (accepted()), this, SLOT (slotOpenFile())); disconnect (ui.projectButtonBox, &QDialogButtonBox::accepted, this, &FileDialog::slotOpenFile);
close(); close();
} }

View file

@ -23,7 +23,7 @@ CSVDoc::FileWidget::FileWidget (QWidget *parent) : QWidget (parent), mAddon (fal
layout ->addWidget (mType); layout ->addWidget (mType);
connect (mInput, SIGNAL (textChanged (const QString&)), this, SLOT (textChanged (const QString&))); connect (mInput, &QLineEdit::textChanged, this, &FileWidget::textChanged);
setLayout (layout); setLayout (layout);
} }

View file

@ -36,7 +36,7 @@ void CSVDoc::GlobalDebugProfileMenu::rebuild()
} }
mActions = new QActionGroup (this); mActions = new QActionGroup (this);
connect (mActions, SIGNAL (triggered (QAction *)), this, SLOT (actionTriggered (QAction *))); connect (mActions, &QActionGroup::triggered, this, &GlobalDebugProfileMenu::actionTriggered);
std::sort (ids.begin(), ids.end()); std::sort (ids.begin(), ids.end());
@ -52,14 +52,14 @@ CSVDoc::GlobalDebugProfileMenu::GlobalDebugProfileMenu (CSMWorld::IdTable *debug
{ {
rebuild(); rebuild();
connect (mDebugProfiles, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (mDebugProfiles, &CSMWorld::IdTable::rowsAboutToBeRemoved,
this, SLOT (profileAboutToBeRemoved (const QModelIndex&, int, int))); this, &GlobalDebugProfileMenu::profileAboutToBeRemoved);
connect (mDebugProfiles, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (mDebugProfiles, &CSMWorld::IdTable::rowsInserted,
this, SLOT (profileInserted (const QModelIndex&, int, int))); this, &GlobalDebugProfileMenu::profileInserted);
connect (mDebugProfiles, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (mDebugProfiles, &CSMWorld::IdTable::dataChanged,
this, SLOT (profileChanged (const QModelIndex&, const QModelIndex&))); this, &GlobalDebugProfileMenu::profileChanged);
} }
void CSVDoc::GlobalDebugProfileMenu::updateActions (bool running) void CSVDoc::GlobalDebugProfileMenu::updateActions (bool running)

View file

@ -70,7 +70,7 @@ CSVDoc::LoadingDocument::LoadingDocument (CSMDoc::Document *document)
show(); show();
connect (mButtons, SIGNAL (rejected()), this, SLOT (cancel())); connect (mButtons, &QDialogButtonBox::rejected, this, qOverload<>(&LoadingDocument::cancel));
} }
void CSVDoc::LoadingDocument::nextStage (const std::string& name, int fileRecords) void CSVDoc::LoadingDocument::nextStage (const std::string& name, int fileRecords)
@ -146,10 +146,10 @@ void CSVDoc::Loader::add (CSMDoc::Document *document)
LoadingDocument *loading = new LoadingDocument (document); LoadingDocument *loading = new LoadingDocument (document);
mDocuments.insert (std::make_pair (document, loading)); mDocuments.insert (std::make_pair (document, loading));
connect (loading, SIGNAL (cancel (CSMDoc::Document *)), connect (loading, qOverload<CSMDoc::Document *>(&LoadingDocument::cancel),
this, SIGNAL (cancel (CSMDoc::Document *))); this, &Loader::cancel);
connect (loading, SIGNAL (close (CSMDoc::Document *)), connect (loading, &LoadingDocument::close,
this, SIGNAL (close (CSMDoc::Document *))); this, &Loader::close);
} }
void CSVDoc::Loader::loadingStopped (CSMDoc::Document *document, bool completed, void CSVDoc::Loader::loadingStopped (CSMDoc::Document *document, bool completed,

View file

@ -40,11 +40,10 @@ CSVDoc::NewGameDialogue::NewGameDialogue()
setLayout (layout); setLayout (layout);
connect (mAdjusterWidget, SIGNAL (stateChanged (bool)), this, SLOT (stateChanged (bool))); connect (mAdjusterWidget, &AdjusterWidget::stateChanged, this, &NewGameDialogue::stateChanged);
connect (mCreate, SIGNAL (clicked()), this, SLOT (create())); connect (mCreate, &QPushButton::clicked, this, &NewGameDialogue::create);
connect (cancel, SIGNAL (clicked()), this, SLOT (reject())); connect (cancel, &QPushButton::clicked, this, &NewGameDialogue::reject);
connect (mFileWidget, SIGNAL (nameChanged (const QString&, bool)), connect (mFileWidget, &FileWidget::nameChanged, mAdjusterWidget, &AdjusterWidget::setName);
mAdjusterWidget, SLOT (setName (const QString&, bool)));
QRect scr = QGuiApplication::primaryScreen()->geometry(); QRect scr = QGuiApplication::primaryScreen()->geometry();
QRect rect = geometry(); QRect rect = geometry();

View file

@ -63,7 +63,7 @@ void CSVDoc::Operation::initWidgets()
mLayout->addWidget (mProgressBar); mLayout->addWidget (mProgressBar);
mLayout->addWidget (mAbortButton); mLayout->addWidget (mAbortButton);
connect (mAbortButton, SIGNAL (clicked()), this, SLOT (abortOperation())); connect (mAbortButton, &QPushButton::clicked, this, qOverload<>(&Operation::abortOperation));
} }
void CSVDoc::Operation::setProgress (int current, int max, int threads) void CSVDoc::Operation::setProgress (int current, int max, int threads)

View file

@ -33,7 +33,7 @@ void CSVDoc::Operations::setProgress (int current, int max, int type, int thread
int newCount = oldCount + 1; int newCount = oldCount + 1;
Operation *operation = new Operation (type, this); Operation *operation = new Operation (type, this);
connect (operation, SIGNAL (abortOperation (int)), this, SIGNAL (abortOperation (int))); connect (operation, qOverload<int>(&Operation::abortOperation), this, &Operations::abortOperation);
mLayout->addLayout (operation->getLayout()); mLayout->addLayout (operation->getLayout());
mOperations.push_back (operation); mOperations.push_back (operation);

View file

@ -41,13 +41,13 @@ QWidget *CSVDoc::StartupDialogue::createButtons()
/// \todo add icons /// \todo add icons
QPushButton *loadDocument = addButton ("Edit A Content File", QIcon (":startup/edit-content")); QPushButton *loadDocument = addButton ("Edit A Content File", QIcon (":startup/edit-content"));
connect (loadDocument, SIGNAL (clicked()), this, SIGNAL (loadDocument())); connect (loadDocument, &QPushButton::clicked, this, &StartupDialogue::loadDocument);
QPushButton *createAddon = addButton ("Create A New Addon", QIcon (":startup/create-addon")); QPushButton *createAddon = addButton ("Create A New Addon", QIcon (":startup/create-addon"));
connect (createAddon, SIGNAL (clicked()), this, SIGNAL (createAddon())); connect (createAddon, &QPushButton::clicked, this, &StartupDialogue::createAddon);
QPushButton *createGame = addButton ("Create A New Game", QIcon (":startup/create-game")); QPushButton *createGame = addButton ("Create A New Game", QIcon (":startup/create-game"));
connect (createGame, SIGNAL (clicked()), this, SIGNAL (createGame())); connect (createGame, &QPushButton::clicked, this, &StartupDialogue::createGame);
for (int i=0; i<3; ++i) for (int i=0; i<3; ++i)
mLayout->setColumnMinimumWidth (i, mWidth); mLayout->setColumnMinimumWidth (i, mWidth);
@ -88,7 +88,7 @@ QWidget *CSVDoc::StartupDialogue::createTools()
widget->setLayout (layout); widget->setLayout (layout);
connect (config, SIGNAL (clicked()), this, SIGNAL (editConfig())); connect (config, &QPushButton::clicked, this, &StartupDialogue::editConfig);
return widget; return widget;
} }

View file

@ -54,43 +54,43 @@ void CSVDoc::View::setupFileMenu()
QMenu *file = menuBar()->addMenu (tr ("File")); QMenu *file = menuBar()->addMenu (tr ("File"));
QAction* newGame = createMenuEntry("New Game", ":./menu-new-game.png", file, "document-file-newgame"); QAction* newGame = createMenuEntry("New Game", ":./menu-new-game.png", file, "document-file-newgame");
connect (newGame, SIGNAL (triggered()), this, SIGNAL (newGameRequest())); connect (newGame, &QAction::triggered, this, &View::newGameRequest);
QAction* newAddon = createMenuEntry("New Addon", ":./menu-new-addon.png", file, "document-file-newaddon"); QAction* newAddon = createMenuEntry("New Addon", ":./menu-new-addon.png", file, "document-file-newaddon");
connect (newAddon, SIGNAL (triggered()), this, SIGNAL (newAddonRequest())); connect (newAddon, &QAction::triggered, this, &View::newAddonRequest);
QAction* open = createMenuEntry("Open", ":./menu-open.png", file, "document-file-open"); QAction* open = createMenuEntry("Open", ":./menu-open.png", file, "document-file-open");
connect (open, SIGNAL (triggered()), this, SIGNAL (loadDocumentRequest())); connect (open, &QAction::triggered, this, &View::loadDocumentRequest);
QAction* save = createMenuEntry("Save", ":./menu-save.png", file, "document-file-save"); QAction* save = createMenuEntry("Save", ":./menu-save.png", file, "document-file-save");
connect (save, SIGNAL (triggered()), this, SLOT (save())); connect (save, &QAction::triggered, this, &View::save);
mSave = save; mSave = save;
file->addSeparator(); file->addSeparator();
QAction* verify = createMenuEntry("Verify", ":./menu-verify.png", file, "document-file-verify"); QAction* verify = createMenuEntry("Verify", ":./menu-verify.png", file, "document-file-verify");
connect (verify, SIGNAL (triggered()), this, SLOT (verify())); connect (verify, &QAction::triggered, this, &View::verify);
mVerify = verify; mVerify = verify;
QAction* merge = createMenuEntry("Merge", ":./menu-merge.png", file, "document-file-merge"); QAction* merge = createMenuEntry("Merge", ":./menu-merge.png", file, "document-file-merge");
connect (merge, SIGNAL (triggered()), this, SLOT (merge())); connect (merge, &QAction::triggered, this, &View::merge);
mMerge = merge; mMerge = merge;
QAction* loadErrors = createMenuEntry("Error Log", ":./error-log.png", file, "document-file-errorlog"); QAction* loadErrors = createMenuEntry("Error Log", ":./error-log.png", file, "document-file-errorlog");
connect (loadErrors, SIGNAL (triggered()), this, SLOT (loadErrorLog())); connect (loadErrors, &QAction::triggered, this, &View::loadErrorLog);
QAction* meta = createMenuEntry(CSMWorld::UniversalId::Type_MetaDatas, file, "document-file-metadata"); QAction* meta = createMenuEntry(CSMWorld::UniversalId::Type_MetaDatas, file, "document-file-metadata");
connect (meta, SIGNAL (triggered()), this, SLOT (addMetaDataSubView())); connect (meta, &QAction::triggered, this, &View::addMetaDataSubView);
file->addSeparator(); file->addSeparator();
QAction* close = createMenuEntry("Close", ":./menu-close.png", file, "document-file-close"); QAction* close = createMenuEntry("Close", ":./menu-close.png", file, "document-file-close");
connect (close, SIGNAL (triggered()), this, SLOT (close())); connect (close, &QAction::triggered, this, &View::close);
QAction* exit = createMenuEntry("Exit", ":./menu-exit.png", file, "document-file-exit"); QAction* exit = createMenuEntry("Exit", ":./menu-exit.png", file, "document-file-exit");
connect (exit, SIGNAL (triggered()), this, SLOT (exit())); connect (exit, &QAction::triggered, this, &View::exit);
connect (this, SIGNAL(exitApplicationRequest(CSVDoc::View *)), &mViewManager, SLOT(exitApplication(CSVDoc::View *))); connect (this, &View::exitApplicationRequest, &mViewManager, &ViewManager::exitApplication);
} }
namespace namespace
@ -121,21 +121,21 @@ void CSVDoc::View::setupEditMenu()
mUndo = mDocument->getUndoStack().createUndoAction (this, tr("Undo")); mUndo = mDocument->getUndoStack().createUndoAction (this, tr("Undo"));
setupShortcut("document-edit-undo", mUndo); setupShortcut("document-edit-undo", mUndo);
connect(mUndo, SIGNAL (changed ()), this, SLOT (undoActionChanged ())); connect(mUndo, &QAction::changed, this, &View::undoActionChanged);
mUndo->setIcon(QIcon(QString::fromStdString(":./menu-undo.png"))); mUndo->setIcon(QIcon(QString::fromStdString(":./menu-undo.png")));
edit->addAction (mUndo); edit->addAction (mUndo);
mRedo = mDocument->getUndoStack().createRedoAction (this, tr("Redo")); mRedo = mDocument->getUndoStack().createRedoAction (this, tr("Redo"));
connect(mRedo, SIGNAL (changed ()), this, SLOT (redoActionChanged ())); connect(mRedo, &QAction::changed, this, &View::redoActionChanged);
setupShortcut("document-edit-redo", mRedo); setupShortcut("document-edit-redo", mRedo);
mRedo->setIcon(QIcon(QString::fromStdString(":./menu-redo.png"))); mRedo->setIcon(QIcon(QString::fromStdString(":./menu-redo.png")));
edit->addAction (mRedo); edit->addAction (mRedo);
QAction* userSettings = createMenuEntry("Preferences", ":./menu-preferences.png", edit, "document-edit-preferences"); QAction* userSettings = createMenuEntry("Preferences", ":./menu-preferences.png", edit, "document-edit-preferences");
connect (userSettings, SIGNAL (triggered()), this, SIGNAL (editSettingsRequest())); connect (userSettings, &QAction::triggered, this, &View::editSettingsRequest);
QAction* search = createMenuEntry(CSMWorld::UniversalId::Type_Search, edit, "document-edit-search"); QAction* search = createMenuEntry(CSMWorld::UniversalId::Type_Search, edit, "document-edit-search");
connect (search, SIGNAL (triggered()), this, SLOT (addSearchSubView())); connect (search, &QAction::triggered, this, &View::addSearchSubView);
} }
void CSVDoc::View::setupViewMenu() void CSVDoc::View::setupViewMenu()
@ -143,17 +143,17 @@ void CSVDoc::View::setupViewMenu()
QMenu *view = menuBar()->addMenu (tr ("View")); QMenu *view = menuBar()->addMenu (tr ("View"));
QAction *newWindow = createMenuEntry("New View", ":./menu-new-window.png", view, "document-view-newview"); QAction *newWindow = createMenuEntry("New View", ":./menu-new-window.png", view, "document-view-newview");
connect (newWindow, SIGNAL (triggered()), this, SLOT (newView())); connect (newWindow, &QAction::triggered, this, &View::newView);
mShowStatusBar = createMenuEntry("Toggle Status Bar", ":./menu-status-bar.png", view, "document-view-statusbar"); mShowStatusBar = createMenuEntry("Toggle Status Bar", ":./menu-status-bar.png", view, "document-view-statusbar");
connect (mShowStatusBar, SIGNAL (toggled (bool)), this, SLOT (toggleShowStatusBar (bool))); connect (mShowStatusBar, &QAction::toggled, this, &View::toggleShowStatusBar);
mShowStatusBar->setCheckable (true); mShowStatusBar->setCheckable (true);
mShowStatusBar->setChecked (CSMPrefs::get()["Windows"]["show-statusbar"].isTrue()); mShowStatusBar->setChecked (CSMPrefs::get()["Windows"]["show-statusbar"].isTrue());
view->addAction (mShowStatusBar); view->addAction (mShowStatusBar);
QAction *filters = createMenuEntry(CSMWorld::UniversalId::Type_Filters, view, "document-mechanics-filters"); QAction *filters = createMenuEntry(CSMWorld::UniversalId::Type_Filters, view, "document-mechanics-filters");
connect (filters, SIGNAL (triggered()), this, SLOT (addFiltersSubView())); connect (filters, &QAction::triggered, this, &View::addFiltersSubView);
} }
void CSVDoc::View::setupWorldMenu() void CSVDoc::View::setupWorldMenu()
@ -161,32 +161,32 @@ void CSVDoc::View::setupWorldMenu()
QMenu *world = menuBar()->addMenu (tr ("World")); QMenu *world = menuBar()->addMenu (tr ("World"));
QAction* referenceables = createMenuEntry(CSMWorld::UniversalId::Type_Referenceables, world, "document-world-referencables"); QAction* referenceables = createMenuEntry(CSMWorld::UniversalId::Type_Referenceables, world, "document-world-referencables");
connect (referenceables, SIGNAL (triggered()), this, SLOT (addReferenceablesSubView())); connect (referenceables, &QAction::triggered, this, &View::addReferenceablesSubView);
QAction* references = createMenuEntry(CSMWorld::UniversalId::Type_References, world, "document-world-references"); QAction* references = createMenuEntry(CSMWorld::UniversalId::Type_References, world, "document-world-references");
connect (references, SIGNAL (triggered()), this, SLOT (addReferencesSubView())); connect (references, &QAction::triggered, this, &View::addReferencesSubView);
world->addSeparator(); world->addSeparator();
QAction* cells = createMenuEntry(CSMWorld::UniversalId::Type_Cells, world, "document-world-cells"); QAction* cells = createMenuEntry(CSMWorld::UniversalId::Type_Cells, world, "document-world-cells");
connect (cells, SIGNAL (triggered()), this, SLOT (addCellsSubView())); connect (cells, &QAction::triggered, this, &View::addCellsSubView);
QAction *lands = createMenuEntry(CSMWorld::UniversalId::Type_Lands, world, "document-world-lands"); QAction *lands = createMenuEntry(CSMWorld::UniversalId::Type_Lands, world, "document-world-lands");
connect (lands, SIGNAL (triggered()), this, SLOT (addLandsSubView())); connect (lands, &QAction::triggered, this, &View::addLandsSubView);
QAction *landTextures = createMenuEntry(CSMWorld::UniversalId::Type_LandTextures, world, "document-world-landtextures"); QAction *landTextures = createMenuEntry(CSMWorld::UniversalId::Type_LandTextures, world, "document-world-landtextures");
connect (landTextures, SIGNAL (triggered()), this, SLOT (addLandTexturesSubView())); connect (landTextures, &QAction::triggered, this, &View::addLandTexturesSubView);
QAction *grid = createMenuEntry(CSMWorld::UniversalId::Type_Pathgrids, world, "document-world-pathgrid"); QAction *grid = createMenuEntry(CSMWorld::UniversalId::Type_Pathgrids, world, "document-world-pathgrid");
connect (grid, SIGNAL (triggered()), this, SLOT (addPathgridSubView())); connect (grid, &QAction::triggered, this, &View::addPathgridSubView);
world->addSeparator(); world->addSeparator();
QAction* regions = createMenuEntry(CSMWorld::UniversalId::Type_Regions, world, "document-world-regions"); QAction* regions = createMenuEntry(CSMWorld::UniversalId::Type_Regions, world, "document-world-regions");
connect (regions, SIGNAL (triggered()), this, SLOT (addRegionsSubView())); connect (regions, &QAction::triggered, this, &View::addRegionsSubView);
QAction *regionMap = createMenuEntry(CSMWorld::UniversalId::Type_RegionMap, world, "document-world-regionmap"); QAction *regionMap = createMenuEntry(CSMWorld::UniversalId::Type_RegionMap, world, "document-world-regionmap");
connect (regionMap, SIGNAL (triggered()), this, SLOT (addRegionMapSubView())); connect (regionMap, &QAction::triggered, this, &View::addRegionMapSubView);
} }
void CSVDoc::View::setupMechanicsMenu() void CSVDoc::View::setupMechanicsMenu()
@ -194,27 +194,27 @@ void CSVDoc::View::setupMechanicsMenu()
QMenu *mechanics = menuBar()->addMenu (tr ("Mechanics")); QMenu *mechanics = menuBar()->addMenu (tr ("Mechanics"));
QAction* scripts = createMenuEntry(CSMWorld::UniversalId::Type_Scripts, mechanics, "document-mechanics-scripts"); QAction* scripts = createMenuEntry(CSMWorld::UniversalId::Type_Scripts, mechanics, "document-mechanics-scripts");
connect (scripts, SIGNAL (triggered()), this, SLOT (addScriptsSubView())); connect (scripts, &QAction::triggered, this, &View::addScriptsSubView);
QAction* startScripts = createMenuEntry(CSMWorld::UniversalId::Type_StartScripts, mechanics, "document-mechanics-startscripts"); QAction* startScripts = createMenuEntry(CSMWorld::UniversalId::Type_StartScripts, mechanics, "document-mechanics-startscripts");
connect (startScripts, SIGNAL (triggered()), this, SLOT (addStartScriptsSubView())); connect (startScripts, &QAction::triggered, this, &View::addStartScriptsSubView);
QAction* globals = createMenuEntry(CSMWorld::UniversalId::Type_Globals, mechanics, "document-mechanics-globals"); QAction* globals = createMenuEntry(CSMWorld::UniversalId::Type_Globals, mechanics, "document-mechanics-globals");
connect (globals, SIGNAL (triggered()), this, SLOT (addGlobalsSubView())); connect (globals, &QAction::triggered, this, &View::addGlobalsSubView);
QAction* gmsts = createMenuEntry(CSMWorld::UniversalId::Type_Gmsts, mechanics, "document-mechanics-gamesettings"); QAction* gmsts = createMenuEntry(CSMWorld::UniversalId::Type_Gmsts, mechanics, "document-mechanics-gamesettings");
connect (gmsts, SIGNAL (triggered()), this, SLOT (addGmstsSubView())); connect (gmsts, &QAction::triggered, this, &View::addGmstsSubView);
mechanics->addSeparator(); mechanics->addSeparator();
QAction* spells = createMenuEntry(CSMWorld::UniversalId::Type_Spells, mechanics, "document-mechanics-spells"); QAction* spells = createMenuEntry(CSMWorld::UniversalId::Type_Spells, mechanics, "document-mechanics-spells");
connect (spells, SIGNAL (triggered()), this, SLOT (addSpellsSubView())); connect (spells, &QAction::triggered, this, &View::addSpellsSubView);
QAction* enchantments = createMenuEntry(CSMWorld::UniversalId::Type_Enchantments, mechanics, "document-mechanics-enchantments"); QAction* enchantments = createMenuEntry(CSMWorld::UniversalId::Type_Enchantments, mechanics, "document-mechanics-enchantments");
connect (enchantments, SIGNAL (triggered()), this, SLOT (addEnchantmentsSubView())); connect (enchantments, &QAction::triggered, this, &View::addEnchantmentsSubView);
QAction* magicEffects = createMenuEntry(CSMWorld::UniversalId::Type_MagicEffects, mechanics, "document-mechanics-magiceffects"); QAction* magicEffects = createMenuEntry(CSMWorld::UniversalId::Type_MagicEffects, mechanics, "document-mechanics-magiceffects");
connect (magicEffects, SIGNAL (triggered()), this, SLOT (addMagicEffectsSubView())); connect (magicEffects, &QAction::triggered, this, &View::addMagicEffectsSubView);
} }
void CSVDoc::View::setupCharacterMenu() void CSVDoc::View::setupCharacterMenu()
@ -222,38 +222,38 @@ void CSVDoc::View::setupCharacterMenu()
QMenu *characters = menuBar()->addMenu (tr ("Characters")); QMenu *characters = menuBar()->addMenu (tr ("Characters"));
QAction* skills = createMenuEntry(CSMWorld::UniversalId::Type_Skills, characters, "document-character-skills"); QAction* skills = createMenuEntry(CSMWorld::UniversalId::Type_Skills, characters, "document-character-skills");
connect (skills, SIGNAL (triggered()), this, SLOT (addSkillsSubView())); connect (skills, &QAction::triggered, this, &View::addSkillsSubView);
QAction* classes = createMenuEntry(CSMWorld::UniversalId::Type_Classes, characters, "document-character-classes"); QAction* classes = createMenuEntry(CSMWorld::UniversalId::Type_Classes, characters, "document-character-classes");
connect (classes, SIGNAL (triggered()), this, SLOT (addClassesSubView())); connect (classes, &QAction::triggered, this, &View::addClassesSubView);
QAction* factions = createMenuEntry(CSMWorld::UniversalId::Type_Faction, characters, "document-character-factions"); QAction* factions = createMenuEntry(CSMWorld::UniversalId::Type_Faction, characters, "document-character-factions");
connect (factions, SIGNAL (triggered()), this, SLOT (addFactionsSubView())); connect (factions, &QAction::triggered, this, &View::addFactionsSubView);
QAction* races = createMenuEntry(CSMWorld::UniversalId::Type_Races, characters, "document-character-races"); QAction* races = createMenuEntry(CSMWorld::UniversalId::Type_Races, characters, "document-character-races");
connect (races, SIGNAL (triggered()), this, SLOT (addRacesSubView())); connect (races, &QAction::triggered, this, &View::addRacesSubView);
QAction* birthsigns = createMenuEntry(CSMWorld::UniversalId::Type_Birthsigns, characters, "document-character-birthsigns"); QAction* birthsigns = createMenuEntry(CSMWorld::UniversalId::Type_Birthsigns, characters, "document-character-birthsigns");
connect (birthsigns, SIGNAL (triggered()), this, SLOT (addBirthsignsSubView())); connect (birthsigns, &QAction::triggered, this, &View::addBirthsignsSubView);
QAction* bodyParts = createMenuEntry(CSMWorld::UniversalId::Type_BodyParts, characters, "document-character-bodyparts"); QAction* bodyParts = createMenuEntry(CSMWorld::UniversalId::Type_BodyParts, characters, "document-character-bodyparts");
connect (bodyParts, SIGNAL (triggered()), this, SLOT (addBodyPartsSubView())); connect (bodyParts, &QAction::triggered, this, &View::addBodyPartsSubView);
characters->addSeparator(); characters->addSeparator();
QAction* topics = createMenuEntry(CSMWorld::UniversalId::Type_Topics, characters, "document-character-topics"); QAction* topics = createMenuEntry(CSMWorld::UniversalId::Type_Topics, characters, "document-character-topics");
connect (topics, SIGNAL (triggered()), this, SLOT (addTopicsSubView())); connect (topics, &QAction::triggered, this, &View::addTopicsSubView);
QAction* topicInfos = createMenuEntry(CSMWorld::UniversalId::Type_TopicInfos, characters, "document-character-topicinfos"); QAction* topicInfos = createMenuEntry(CSMWorld::UniversalId::Type_TopicInfos, characters, "document-character-topicinfos");
connect (topicInfos, SIGNAL (triggered()), this, SLOT (addTopicInfosSubView())); connect (topicInfos, &QAction::triggered, this, &View::addTopicInfosSubView);
characters->addSeparator(); characters->addSeparator();
QAction* journals = createMenuEntry(CSMWorld::UniversalId::Type_Journals, characters, "document-character-journals"); QAction* journals = createMenuEntry(CSMWorld::UniversalId::Type_Journals, characters, "document-character-journals");
connect (journals, SIGNAL (triggered()), this, SLOT (addJournalsSubView())); connect (journals, &QAction::triggered, this, &View::addJournalsSubView);
QAction* journalInfos = createMenuEntry(CSMWorld::UniversalId::Type_JournalInfos, characters, "document-character-journalinfos"); QAction* journalInfos = createMenuEntry(CSMWorld::UniversalId::Type_JournalInfos, characters, "document-character-journalinfos");
connect (journalInfos, SIGNAL (triggered()), this, SLOT (addJournalInfosSubView())); connect (journalInfos, &QAction::triggered, this, &View::addJournalInfosSubView);
} }
void CSVDoc::View::setupAssetsMenu() void CSVDoc::View::setupAssetsMenu()
@ -266,30 +266,30 @@ void CSVDoc::View::setupAssetsMenu()
assets->addSeparator(); assets->addSeparator();
QAction* sounds = createMenuEntry(CSMWorld::UniversalId::Type_Sounds, assets, "document-assets-sounds"); QAction* sounds = createMenuEntry(CSMWorld::UniversalId::Type_Sounds, assets, "document-assets-sounds");
connect (sounds, SIGNAL (triggered()), this, SLOT (addSoundsSubView())); connect (sounds, &QAction::triggered, this, &View::addSoundsSubView);
QAction* soundGens = createMenuEntry(CSMWorld::UniversalId::Type_SoundGens, assets, "document-assets-soundgens"); QAction* soundGens = createMenuEntry(CSMWorld::UniversalId::Type_SoundGens, assets, "document-assets-soundgens");
connect (soundGens, SIGNAL (triggered()), this, SLOT (addSoundGensSubView())); connect (soundGens, &QAction::triggered, this, &View::addSoundGensSubView);
assets->addSeparator(); // resources follow here assets->addSeparator(); // resources follow here
QAction* meshes = createMenuEntry(CSMWorld::UniversalId::Type_Meshes, assets, "document-assets-meshes"); QAction* meshes = createMenuEntry(CSMWorld::UniversalId::Type_Meshes, assets, "document-assets-meshes");
connect (meshes, SIGNAL (triggered()), this, SLOT (addMeshesSubView())); connect (meshes, &QAction::triggered, this, &View::addMeshesSubView);
QAction* icons = createMenuEntry(CSMWorld::UniversalId::Type_Icons, assets, "document-assets-icons"); QAction* icons = createMenuEntry(CSMWorld::UniversalId::Type_Icons, assets, "document-assets-icons");
connect (icons, SIGNAL (triggered()), this, SLOT (addIconsSubView())); connect (icons, &QAction::triggered, this, &View::addIconsSubView);
QAction* musics = createMenuEntry(CSMWorld::UniversalId::Type_Musics, assets, "document-assets-musics"); QAction* musics = createMenuEntry(CSMWorld::UniversalId::Type_Musics, assets, "document-assets-musics");
connect (musics, SIGNAL (triggered()), this, SLOT (addMusicsSubView())); connect (musics, &QAction::triggered, this, &View::addMusicsSubView);
QAction* soundFiles = createMenuEntry(CSMWorld::UniversalId::Type_SoundsRes, assets, "document-assets-soundres"); QAction* soundFiles = createMenuEntry(CSMWorld::UniversalId::Type_SoundsRes, assets, "document-assets-soundres");
connect (soundFiles, SIGNAL (triggered()), this, SLOT (addSoundsResSubView())); connect (soundFiles, &QAction::triggered, this, &View::addSoundsResSubView);
QAction* textures = createMenuEntry(CSMWorld::UniversalId::Type_Textures, assets, "document-assets-textures"); QAction* textures = createMenuEntry(CSMWorld::UniversalId::Type_Textures, assets, "document-assets-textures");
connect (textures, SIGNAL (triggered()), this, SLOT (addTexturesSubView())); connect (textures, &QAction::triggered, this, &View::addTexturesSubView);
QAction* videos = createMenuEntry(CSMWorld::UniversalId::Type_Videos, assets, "document-assets-videos"); QAction* videos = createMenuEntry(CSMWorld::UniversalId::Type_Videos, assets, "document-assets-videos");
connect (videos, SIGNAL (triggered()), this, SLOT (addVideosSubView())); connect (videos, &QAction::triggered, this, &View::addVideosSubView);
} }
void CSVDoc::View::setupDebugMenu() void CSVDoc::View::setupDebugMenu()
@ -297,7 +297,7 @@ void CSVDoc::View::setupDebugMenu()
QMenu *debug = menuBar()->addMenu (tr ("Debug")); QMenu *debug = menuBar()->addMenu (tr ("Debug"));
QAction* profiles = createMenuEntry(CSMWorld::UniversalId::Type_DebugProfiles, debug, "document-debug-profiles"); QAction* profiles = createMenuEntry(CSMWorld::UniversalId::Type_DebugProfiles, debug, "document-debug-profiles");
connect (profiles, SIGNAL (triggered()), this, SLOT (addDebugProfilesSubView())); connect (profiles, &QAction::triggered, this, &View::addDebugProfilesSubView);
debug->addSeparator(); debug->addSeparator();
@ -305,8 +305,8 @@ void CSVDoc::View::setupDebugMenu()
&dynamic_cast<CSMWorld::IdTable&> (*mDocument->getData().getTableModel ( &dynamic_cast<CSMWorld::IdTable&> (*mDocument->getData().getTableModel (
CSMWorld::UniversalId::Type_DebugProfiles)), this); CSMWorld::UniversalId::Type_DebugProfiles)), this);
connect (mGlobalDebugProfileMenu, SIGNAL (triggered (const std::string&)), connect (mGlobalDebugProfileMenu, &GlobalDebugProfileMenu::triggered,
this, SLOT (run (const std::string&))); this, [this](const std::string &profile){ this->run(profile, ""); });
QAction *runDebug = debug->addMenu (mGlobalDebugProfileMenu); QAction *runDebug = debug->addMenu (mGlobalDebugProfileMenu);
runDebug->setText (tr ("Run OpenMW")); runDebug->setText (tr ("Run OpenMW"));
@ -314,11 +314,11 @@ void CSVDoc::View::setupDebugMenu()
runDebug->setIcon(QIcon(QString::fromStdString(":./run-openmw.png"))); runDebug->setIcon(QIcon(QString::fromStdString(":./run-openmw.png")));
QAction* stopDebug = createMenuEntry("Stop OpenMW", ":./stop-openmw.png", debug, "document-debug-shutdown"); QAction* stopDebug = createMenuEntry("Stop OpenMW", ":./stop-openmw.png", debug, "document-debug-shutdown");
connect (stopDebug, SIGNAL (triggered()), this, SLOT (stop())); connect (stopDebug, &QAction::triggered, this, &View::stop);
mStopDebug = stopDebug; mStopDebug = stopDebug;
QAction* runLog = createMenuEntry(CSMWorld::UniversalId::Type_RunLog, debug, "document-debug-runlog"); QAction* runLog = createMenuEntry(CSMWorld::UniversalId::Type_RunLog, debug, "document-debug-runlog");
connect (runLog, SIGNAL (triggered()), this, SLOT (addRunLogSubView())); connect (runLog, &QAction::triggered, this, &View::addRunLogSubView);
} }
void CSVDoc::View::setupHelpMenu() void CSVDoc::View::setupHelpMenu()
@ -326,16 +326,16 @@ void CSVDoc::View::setupHelpMenu()
QMenu *help = menuBar()->addMenu (tr ("Help")); QMenu *help = menuBar()->addMenu (tr ("Help"));
QAction* helpInfo = createMenuEntry("Help", ":/info.png", help, "document-help-help"); QAction* helpInfo = createMenuEntry("Help", ":/info.png", help, "document-help-help");
connect (helpInfo, SIGNAL (triggered()), this, SLOT (openHelp())); connect (helpInfo, &QAction::triggered, this, &View::openHelp);
QAction* tutorial = createMenuEntry("Tutorial", ":/info.png", help, "document-help-tutorial"); QAction* tutorial = createMenuEntry("Tutorial", ":/info.png", help, "document-help-tutorial");
connect (tutorial, SIGNAL (triggered()), this, SLOT (tutorial())); connect (tutorial, &QAction::triggered, this, &View::tutorial);
QAction* about = createMenuEntry("About OpenMW-CS", ":./info.png", help, "document-help-about"); QAction* about = createMenuEntry("About OpenMW-CS", ":./info.png", help, "document-help-about");
connect (about, SIGNAL (triggered()), this, SLOT (infoAbout())); connect (about, &QAction::triggered, this, &View::infoAbout);
QAction* aboutQt = createMenuEntry("About Qt", ":./qt.png", help, "document-help-qt"); QAction* aboutQt = createMenuEntry("About Qt", ":./qt.png", help, "document-help-qt");
connect (aboutQt, SIGNAL (triggered()), this, SLOT (infoAboutQt())); connect (aboutQt, &QAction::triggered, this, &View::infoAboutQt);
} }
QAction* CSVDoc::View::createMenuEntry(CSMWorld::UniversalId::Type type, QMenu* menu, const char* shortcutName) QAction* CSVDoc::View::createMenuEntry(CSMWorld::UniversalId::Type type, QMenu* menu, const char* shortcutName)
@ -501,10 +501,10 @@ CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int to
mSubViewFactory.add (CSMWorld::UniversalId::Type_RunLog, new SubViewFactory<RunLogSubView>); mSubViewFactory.add (CSMWorld::UniversalId::Type_RunLog, new SubViewFactory<RunLogSubView>);
connect (mOperations, SIGNAL (abortOperation (int)), this, SLOT (abortOperation (int))); connect (mOperations, &Operations::abortOperation, this, &View::abortOperation);
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &View::settingChanged);
} }
CSVDoc::View::~View() CSVDoc::View::~View()
@ -584,8 +584,8 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
} }
if (mScroll) if (mScroll)
QObject::connect(mScroll->horizontalScrollBar(), QObject::connect(mScroll->horizontalScrollBar(), &QScrollBar::rangeChanged,
SIGNAL(rangeChanged(int,int)), this, SLOT(moveScrollBarToEnd(int,int))); this, &View::moveScrollBarToEnd);
// User setting for limiting the number of sub views per top level view. // User setting for limiting the number of sub views per top level view.
// Automatically open a new top level view if this number is exceeded // Automatically open a new top level view if this number is exceeded
@ -637,28 +637,27 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id, const std::strin
updateSubViewIndices(); updateSubViewIndices();
connect (view, SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)), this, connect (view, &SubView::focusId, this, &View::addSubView);
SLOT (addSubView (const CSMWorld::UniversalId&, const std::string&)));
connect (view, SIGNAL (closeRequest (SubView *)), this, SLOT (closeRequest (SubView *))); connect (view, qOverload<SubView *>(&SubView::closeRequest),
this, &View::closeRequest);
connect (view, SIGNAL (updateTitle()), this, SLOT (updateTitle())); connect (view, &SubView::updateTitle, this, &View::updateTitle);
connect (view, SIGNAL (updateSubViewIndices (SubView *)), connect (view, &SubView::updateSubViewIndices, this, &View::updateSubViewIndices);
this, SLOT (updateSubViewIndices (SubView *)));
CSVWorld::TableSubView* tableView = dynamic_cast<CSVWorld::TableSubView*>(view); CSVWorld::TableSubView* tableView = dynamic_cast<CSVWorld::TableSubView*>(view);
if (tableView) if (tableView)
{ {
connect (this, SIGNAL (requestFocus (const std::string&)), connect (this, &View::requestFocus,
tableView, SLOT (requestFocus (const std::string&))); tableView, &CSVWorld::TableSubView::requestFocus);
} }
CSVWorld::SceneSubView* sceneView = dynamic_cast<CSVWorld::SceneSubView*>(view); CSVWorld::SceneSubView* sceneView = dynamic_cast<CSVWorld::SceneSubView*>(view);
if (sceneView) if (sceneView)
{ {
connect(sceneView, SIGNAL(requestFocus(const std::string&)), connect(sceneView, &CSVWorld::SceneSubView::requestFocus,
this, SLOT(onRequestFocus(const std::string&))); this, &View::onRequestFocus);
} }
if (CSMPrefs::State::get()["ID Tables"]["subview-new-window"].isTrue()) if (CSMPrefs::State::get()["ID Tables"]["subview-new-window"].isTrue())
@ -684,8 +683,8 @@ void CSVDoc::View::moveScrollBarToEnd(int min, int max)
{ {
mScroll->horizontalScrollBar()->setValue(max); mScroll->horizontalScrollBar()->setValue(max);
QObject::disconnect(mScroll->horizontalScrollBar(), QObject::disconnect(mScroll->horizontalScrollBar(), &QScrollBar::rangeChanged,
SIGNAL(rangeChanged(int,int)), this, SLOT(moveScrollBarToEnd(int,int))); this, &View::moveScrollBarToEnd);
} }
} }

View file

@ -117,32 +117,26 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager)
mDelegateFactories->add (sMapping[i].mDisplay, new CSVWorld::EnumDelegateFactory ( mDelegateFactories->add (sMapping[i].mDisplay, new CSVWorld::EnumDelegateFactory (
CSMWorld::Columns::getEnums (sMapping[i].mColumnId), sMapping[i].mAllowNone)); CSMWorld::Columns::getEnums (sMapping[i].mColumnId), sMapping[i].mAllowNone));
connect (&mDocumentManager, SIGNAL (loadRequest (CSMDoc::Document *)), connect (&mDocumentManager, &CSMDoc::DocumentManager::loadRequest,
&mLoader, SLOT (add (CSMDoc::Document *))); &mLoader, &Loader::add);
connect ( connect (&mDocumentManager, &CSMDoc::DocumentManager::loadingStopped,
&mDocumentManager, SIGNAL (loadingStopped (CSMDoc::Document *, bool, const std::string&)), &mLoader, &Loader::loadingStopped);
&mLoader, SLOT (loadingStopped (CSMDoc::Document *, bool, const std::string&)));
connect ( connect (&mDocumentManager, &CSMDoc::DocumentManager::nextStage,
&mDocumentManager, SIGNAL (nextStage (CSMDoc::Document *, const std::string&, int)), &mLoader, &Loader::nextStage);
&mLoader, SLOT (nextStage (CSMDoc::Document *, const std::string&, int)));
connect ( connect (&mDocumentManager, &CSMDoc::DocumentManager::nextRecord,
&mDocumentManager, SIGNAL (nextRecord (CSMDoc::Document *, int)), &mLoader, &Loader::nextRecord);
&mLoader, SLOT (nextRecord (CSMDoc::Document *, int)));
connect ( connect (&mDocumentManager, &CSMDoc::DocumentManager::loadMessage,
&mDocumentManager, SIGNAL (loadMessage (CSMDoc::Document *, const std::string&)), &mLoader, &Loader::loadMessage);
&mLoader, SLOT (loadMessage (CSMDoc::Document *, const std::string&)));
connect ( connect (&mLoader, &Loader::cancel,
&mLoader, SIGNAL (cancel (CSMDoc::Document *)), &mDocumentManager, &CSMDoc::DocumentManager::cancelLoading);
&mDocumentManager, SIGNAL (cancelLoading (CSMDoc::Document *)));
connect ( connect (&mLoader, &Loader::close,
&mLoader, SIGNAL (close (CSMDoc::Document *)), &mDocumentManager, &CSMDoc::DocumentManager::removeDocument);
&mDocumentManager, SLOT (removeDocument (CSMDoc::Document *)));
} }
CSVDoc::ViewManager::~ViewManager() CSVDoc::ViewManager::~ViewManager()
@ -158,11 +152,11 @@ CSVDoc::View *CSVDoc::ViewManager::addView (CSMDoc::Document *document)
if (countViews (document)==0) if (countViews (document)==0)
{ {
// new document // new document
connect (document, SIGNAL (stateChanged (int, CSMDoc::Document *)), connect (document, &CSMDoc::Document::stateChanged,
this, SLOT (documentStateChanged (int, CSMDoc::Document *))); this, &ViewManager::documentStateChanged);
connect (document, SIGNAL (progress (int, int, int, int, CSMDoc::Document *)), connect (document, qOverload<int,int,int,int,CSMDoc::Document*>(&CSMDoc::Document::progress),
this, SLOT (progress (int, int, int, int, CSMDoc::Document *))); this, &ViewManager::progress);
} }
View *view = new View (*this, document, countViews (document)+1); View *view = new View (*this, document, countViews (document)+1);
@ -172,11 +166,11 @@ CSVDoc::View *CSVDoc::ViewManager::addView (CSMDoc::Document *document)
view->toggleStatusBar (CSMPrefs::get()["Windows"]["show-statusbar"].isTrue()); view->toggleStatusBar (CSMPrefs::get()["Windows"]["show-statusbar"].isTrue());
view->show(); view->show();
connect (view, SIGNAL (newGameRequest ()), this, SIGNAL (newGameRequest())); connect (view, &View::newGameRequest, this, &ViewManager::newGameRequest);
connect (view, SIGNAL (newAddonRequest ()), this, SIGNAL (newAddonRequest())); connect (view, &View::newAddonRequest, this, &ViewManager::newAddonRequest);
connect (view, SIGNAL (loadDocumentRequest ()), this, SIGNAL (loadDocumentRequest())); connect (view, &View::loadDocumentRequest, this, &ViewManager::loadDocumentRequest);
connect (view, SIGNAL (editSettingsRequest()), this, SIGNAL (editSettingsRequest())); connect (view, &View::editSettingsRequest, this, &ViewManager::editSettingsRequest);
connect (view, SIGNAL (mergeDocument (CSMDoc::Document *)), this, SIGNAL (mergeDocument (CSMDoc::Document *))); connect (view, &View::mergeDocument, this, &ViewManager::mergeDocument);
updateIndices(); updateIndices();
@ -278,9 +272,9 @@ bool CSVDoc::ViewManager::showModifiedDocumentMessageBox (CSVDoc::View *view)
bool retVal = true; bool retVal = true;
connect (this, SIGNAL (closeMessageBox()), &messageBox, SLOT (close())); connect (this, &ViewManager::closeMessageBox, &messageBox, &QMessageBox::close);
connect (document, SIGNAL (stateChanged (int, CSMDoc::Document *)), this, SLOT (onExitWarningHandler(int, CSMDoc::Document *))); connect (document, &CSMDoc::Document::stateChanged, this, &ViewManager::onExitWarningHandler);
mUserWarned = true; mUserWarned = true;
int response = messageBox.exec(); int response = messageBox.exec();
@ -297,13 +291,15 @@ bool CSVDoc::ViewManager::showModifiedDocumentMessageBox (CSVDoc::View *view)
case QMessageBox::Discard: case QMessageBox::Discard:
disconnect (document, SIGNAL (stateChanged (int, CSMDoc::Document *)), this, SLOT (onExitWarningHandler(int, CSMDoc::Document *))); disconnect (document, &CSMDoc::Document::stateChanged,
this, &ViewManager::onExitWarningHandler);
break; break;
case QMessageBox::Cancel: case QMessageBox::Cancel:
//disconnect to prevent unintended view closures //disconnect to prevent unintended view closures
disconnect (document, SIGNAL (stateChanged (int, CSMDoc::Document *)), this, SLOT (onExitWarningHandler(int, CSMDoc::Document *))); disconnect (document, &CSMDoc::Document::stateChanged,
this, &ViewManager::onExitWarningHandler);
retVal = false; retVal = false;
break; break;
@ -332,8 +328,8 @@ bool CSVDoc::ViewManager::showSaveInProgressMessageBox (CSVDoc::View *view)
bool retVal = true; bool retVal = true;
//Connections shut down message box if operation ends before user makes a decision. //Connections shut down message box if operation ends before user makes a decision.
connect (document, SIGNAL (stateChanged (int, CSMDoc::Document *)), this, SLOT (onExitWarningHandler(int, CSMDoc::Document *))); connect (document, &CSMDoc::Document::stateChanged, this, &ViewManager::onExitWarningHandler);
connect (this, SIGNAL (closeMessageBox()), &messageBox, SLOT (close())); connect (this, &ViewManager::closeMessageBox, &messageBox, &QMessageBox::close);
//set / clear the user warned flag to indicate whether or not the message box is currently active. //set / clear the user warned flag to indicate whether or not the message box is currently active.
mUserWarned = true; mUserWarned = true;
@ -351,7 +347,7 @@ bool CSVDoc::ViewManager::showSaveInProgressMessageBox (CSVDoc::View *view)
else if (messageBox.clickedButton() == closeButton) else if (messageBox.clickedButton() == closeButton)
{ {
//disconnect to avoid segmentation fault //disconnect to avoid segmentation fault
disconnect (document, SIGNAL (stateChanged (int, CSMDoc::Document *)), this, SLOT (onExitWarningHandler(int, CSMDoc::Document *))); disconnect (document, &CSMDoc::Document::stateChanged, this, &ViewManager::onExitWarningHandler);
view->abortOperation(CSMDoc::State_Saving); view->abortOperation(CSMDoc::State_Saving);
mExitOnSaveStateChange = true; mExitOnSaveStateChange = true;
@ -362,7 +358,7 @@ bool CSVDoc::ViewManager::showSaveInProgressMessageBox (CSVDoc::View *view)
//abort shutdown, allow save to complete //abort shutdown, allow save to complete
//disconnection to prevent unintended view closures //disconnection to prevent unintended view closures
mExitOnSaveStateChange = false; mExitOnSaveStateChange = false;
disconnect (document, SIGNAL (stateChanged (int, CSMDoc::Document *)), this, SLOT (onExitWarningHandler(int, CSMDoc::Document *))); disconnect (document, &CSMDoc::Document::stateChanged, this, &ViewManager::onExitWarningHandler);
retVal = false; retVal = false;
} }

View file

@ -19,26 +19,23 @@ CSVFilter::EditWidget::EditWidget (CSMWorld::Data& data, QWidget *parent)
: QLineEdit (parent), mParser (data), mIsEmpty(true) : QLineEdit (parent), mParser (data), mIsEmpty(true)
{ {
mPalette = palette(); mPalette = palette();
connect (this, SIGNAL (textChanged (const QString&)), this, SLOT (textChanged (const QString&))); connect (this, &QLineEdit::textChanged, this, &EditWidget::textChanged);
const CSMWorld::IdTableBase *model = const CSMWorld::IdTableBase *model =
static_cast<const CSMWorld::IdTableBase *> (data.getTableModel (CSMWorld::UniversalId::Type_Filters)); static_cast<const CSMWorld::IdTableBase *> (data.getTableModel (CSMWorld::UniversalId::Type_Filters));
connect (model, SIGNAL (dataChanged (const QModelIndex &, const QModelIndex&)), connect (model, &CSMWorld::IdTableBase::dataChanged,
this, SLOT (filterDataChanged (const QModelIndex &, const QModelIndex&)), this, &EditWidget::filterDataChanged, Qt::QueuedConnection);
Qt::QueuedConnection); connect (model, &CSMWorld::IdTableBase::rowsRemoved,
connect (model, SIGNAL (rowsRemoved (const QModelIndex&, int, int)), this, &EditWidget::filterRowsRemoved, Qt::QueuedConnection);
this, SLOT (filterRowsRemoved (const QModelIndex&, int, int)), connect (model, &CSMWorld::IdTableBase::rowsInserted,
Qt::QueuedConnection); this, &EditWidget::filterRowsInserted, Qt::QueuedConnection);
connect (model, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
this, SLOT (filterRowsInserted (const QModelIndex&, int, int)),
Qt::QueuedConnection);
mStateColumnIndex = model->findColumnIndex(CSMWorld::Columns::ColumnId_Modification); mStateColumnIndex = model->findColumnIndex(CSMWorld::Columns::ColumnId_Modification);
mDescColumnIndex = model->findColumnIndex(CSMWorld::Columns::ColumnId_Description); mDescColumnIndex = model->findColumnIndex(CSMWorld::Columns::ColumnId_Description);
mHelpAction = new QAction (tr ("Help"), this); mHelpAction = new QAction (tr ("Help"), this);
connect (mHelpAction, SIGNAL (triggered()), this, SLOT (openHelp())); connect (mHelpAction, &QAction::triggered, this, &EditWidget::openHelp);
mHelpAction->setIcon(QIcon(":/info.png")); mHelpAction->setIcon(QIcon(":/info.png"));
addAction (mHelpAction); addAction (mHelpAction);
auto* openHelpShortcut = new CSMPrefs::Shortcut("help", this); auto* openHelpShortcut = new CSMPrefs::Shortcut("help", this);

View file

@ -20,9 +20,8 @@ CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
setLayout (layout); setLayout (layout);
connect (mRecordFilterBox, connect (mRecordFilterBox, &RecordFilterBox::filterChanged,
SIGNAL (filterChanged (std::shared_ptr<CSMFilter::Node>)), this, &FilterBox::recordFilterChanged);
this, SIGNAL (recordFilterChanged (std::shared_ptr<CSMFilter::Node>)));
setAcceptDrops(true); setAcceptDrops(true);
} }

View file

@ -22,9 +22,8 @@ CSVFilter::RecordFilterBox::RecordFilterBox (CSMWorld::Data& data, QWidget *pare
setLayout (layout); setLayout (layout);
connect ( connect (mEdit, &EditWidget::filterChanged,
mEdit, SIGNAL (filterChanged (std::shared_ptr<CSMFilter::Node>)), this, &RecordFilterBox::filterChanged);
this, SIGNAL (filterChanged (std::shared_ptr<CSMFilter::Node>)));
} }
void CSVFilter::RecordFilterBox::setFilter (const std::string& filter) void CSVFilter::RecordFilterBox::setFilter (const std::string& filter)

View file

@ -40,8 +40,8 @@ void CSVPrefs::Dialogue::buildCategorySelector (QSplitter *main)
list->setMaximumWidth (maxWidth + 10); list->setMaximumWidth (maxWidth + 10);
connect (list, SIGNAL (currentItemChanged (QListWidgetItem *, QListWidgetItem *)), connect (list, &ContextMenuList::currentItemChanged,
this, SLOT (selectionChanged (QListWidgetItem *, QListWidgetItem *))); this, &Dialogue::selectionChanged);
} }
void CSVPrefs::Dialogue::buildContentArea (QSplitter *main) void CSVPrefs::Dialogue::buildContentArea (QSplitter *main)

View file

@ -29,7 +29,8 @@ namespace CSVPrefs
mStackedLayout = new QStackedLayout(stackedWidget); mStackedLayout = new QStackedLayout(stackedWidget);
mPageSelector = new QComboBox(); mPageSelector = new QComboBox();
connect(mPageSelector, SIGNAL(currentIndexChanged(int)), mStackedLayout, SLOT(setCurrentIndex(int))); connect(mPageSelector, qOverload<int>(&QComboBox::currentIndexChanged),
mStackedLayout, &QStackedLayout::setCurrentIndex);
QFrame* lineSeparator = new QFrame(topWidget); QFrame* lineSeparator = new QFrame(topWidget);
lineSeparator->setFrameShape(QFrame::HLine); lineSeparator->setFrameShape(QFrame::HLine);
@ -37,7 +38,7 @@ namespace CSVPrefs
// Reset key bindings button // Reset key bindings button
QPushButton* resetButton = new QPushButton ("Reset to Defaults", topWidget); QPushButton* resetButton = new QPushButton ("Reset to Defaults", topWidget);
connect(resetButton, SIGNAL(clicked()), this, SLOT(resetKeyBindings())); connect(resetButton, &QPushButton::clicked, this, &KeyBindingPage::resetKeyBindings);
topLayout->addWidget(mPageSelector); topLayout->addWidget(mPageSelector);
topLayout->addWidget(stackedWidget); topLayout->addWidget(stackedWidget);

View file

@ -23,8 +23,8 @@ namespace CSVRender
, mSkeleton(nullptr) , mSkeleton(nullptr)
{ {
mActorData = mData.getActorAdapter()->getActorData(mId); mActorData = mData.getActorAdapter()->getActorData(mId);
connect(mData.getActorAdapter(), SIGNAL(actorChanged(const std::string&)), connect(mData.getActorAdapter(), &CSMWorld::ActorAdapter::actorChanged,
this, SLOT(handleActorChanged(const std::string&))); this, &Actor::handleActorChanged);
} }
osg::Group* Actor::getBaseNode() osg::Group* Actor::getBaseNode()

View file

@ -179,57 +179,67 @@ namespace CSVRender
{ {
CSMPrefs::Shortcut* naviPrimaryShortcut = new CSMPrefs::Shortcut("scene-navi-primary", widget); CSMPrefs::Shortcut* naviPrimaryShortcut = new CSMPrefs::Shortcut("scene-navi-primary", widget);
naviPrimaryShortcut->enable(false); naviPrimaryShortcut->enable(false);
connect(naviPrimaryShortcut, SIGNAL(activated(bool)), this, SLOT(naviPrimary(bool))); connect(naviPrimaryShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &FreeCameraController::naviPrimary);
addShortcut(naviPrimaryShortcut); addShortcut(naviPrimaryShortcut);
CSMPrefs::Shortcut* naviSecondaryShortcut = new CSMPrefs::Shortcut("scene-navi-secondary", widget); CSMPrefs::Shortcut* naviSecondaryShortcut = new CSMPrefs::Shortcut("scene-navi-secondary", widget);
naviSecondaryShortcut->enable(false); naviSecondaryShortcut->enable(false);
connect(naviSecondaryShortcut, SIGNAL(activated(bool)), this, SLOT(naviSecondary(bool))); connect(naviSecondaryShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &FreeCameraController::naviSecondary);
addShortcut(naviSecondaryShortcut); addShortcut(naviSecondaryShortcut);
CSMPrefs::Shortcut* forwardShortcut = new CSMPrefs::Shortcut("free-forward", "scene-speed-modifier", CSMPrefs::Shortcut* forwardShortcut = new CSMPrefs::Shortcut("free-forward", "scene-speed-modifier",
CSMPrefs::Shortcut::SM_Detach, widget); CSMPrefs::Shortcut::SM_Detach, widget);
forwardShortcut->enable(false); forwardShortcut->enable(false);
connect(forwardShortcut, SIGNAL(activated(bool)), this, SLOT(forward(bool))); connect(forwardShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
connect(forwardShortcut, SIGNAL(secondary(bool)), this, SLOT(alternateFast(bool))); this, &FreeCameraController::forward);
connect(forwardShortcut, qOverload<bool>(&CSMPrefs::Shortcut::secondary),
this, &FreeCameraController::alternateFast);
addShortcut(forwardShortcut); addShortcut(forwardShortcut);
CSMPrefs::Shortcut* leftShortcut = new CSMPrefs::Shortcut("free-left", widget); CSMPrefs::Shortcut* leftShortcut = new CSMPrefs::Shortcut("free-left", widget);
leftShortcut->enable(false); leftShortcut->enable(false);
connect(leftShortcut, SIGNAL(activated(bool)), this, SLOT(left(bool))); connect(leftShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &FreeCameraController::left);
addShortcut(leftShortcut); addShortcut(leftShortcut);
CSMPrefs::Shortcut* backShortcut = new CSMPrefs::Shortcut("free-backward", widget); CSMPrefs::Shortcut* backShortcut = new CSMPrefs::Shortcut("free-backward", widget);
backShortcut->enable(false); backShortcut->enable(false);
connect(backShortcut, SIGNAL(activated(bool)), this, SLOT(backward(bool))); connect(backShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &FreeCameraController::backward);
addShortcut(backShortcut); addShortcut(backShortcut);
CSMPrefs::Shortcut* rightShortcut = new CSMPrefs::Shortcut("free-right", widget); CSMPrefs::Shortcut* rightShortcut = new CSMPrefs::Shortcut("free-right", widget);
rightShortcut->enable(false); rightShortcut->enable(false);
connect(rightShortcut, SIGNAL(activated(bool)), this, SLOT(right(bool))); connect(rightShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &FreeCameraController::right);
addShortcut(rightShortcut); addShortcut(rightShortcut);
CSMPrefs::Shortcut* rollLeftShortcut = new CSMPrefs::Shortcut("free-roll-left", widget); CSMPrefs::Shortcut* rollLeftShortcut = new CSMPrefs::Shortcut("free-roll-left", widget);
rollLeftShortcut->enable(false); rollLeftShortcut->enable(false);
connect(rollLeftShortcut, SIGNAL(activated(bool)), this, SLOT(rollLeft(bool))); connect(rollLeftShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &FreeCameraController::rollLeft);
addShortcut(rollLeftShortcut); addShortcut(rollLeftShortcut);
CSMPrefs::Shortcut* rollRightShortcut = new CSMPrefs::Shortcut("free-roll-right", widget); CSMPrefs::Shortcut* rollRightShortcut = new CSMPrefs::Shortcut("free-roll-right", widget);
rollRightShortcut->enable(false); rollRightShortcut->enable(false);
connect(rollRightShortcut, SIGNAL(activated(bool)), this, SLOT(rollRight(bool))); connect(rollRightShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &FreeCameraController::rollRight);
addShortcut(rollRightShortcut); addShortcut(rollRightShortcut);
CSMPrefs::Shortcut* speedModeShortcut = new CSMPrefs::Shortcut("free-speed-mode", widget); CSMPrefs::Shortcut* speedModeShortcut = new CSMPrefs::Shortcut("free-speed-mode", widget);
speedModeShortcut->enable(false); speedModeShortcut->enable(false);
connect(speedModeShortcut, SIGNAL(activated()), this, SLOT(swapSpeedMode())); connect(speedModeShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &FreeCameraController::swapSpeedMode);
addShortcut(speedModeShortcut); addShortcut(speedModeShortcut);
} }
@ -467,57 +477,67 @@ namespace CSVRender
{ {
CSMPrefs::Shortcut* naviPrimaryShortcut = new CSMPrefs::Shortcut("scene-navi-primary", widget); CSMPrefs::Shortcut* naviPrimaryShortcut = new CSMPrefs::Shortcut("scene-navi-primary", widget);
naviPrimaryShortcut->enable(false); naviPrimaryShortcut->enable(false);
connect(naviPrimaryShortcut, SIGNAL(activated(bool)), this, SLOT(naviPrimary(bool))); connect(naviPrimaryShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &OrbitCameraController::naviPrimary);
addShortcut(naviPrimaryShortcut); addShortcut(naviPrimaryShortcut);
CSMPrefs::Shortcut* naviSecondaryShortcut = new CSMPrefs::Shortcut("scene-navi-secondary", widget); CSMPrefs::Shortcut* naviSecondaryShortcut = new CSMPrefs::Shortcut("scene-navi-secondary", widget);
naviSecondaryShortcut->enable(false); naviSecondaryShortcut->enable(false);
connect(naviSecondaryShortcut, SIGNAL(activated(bool)), this, SLOT(naviSecondary(bool))); connect(naviSecondaryShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &OrbitCameraController::naviSecondary);
addShortcut(naviSecondaryShortcut); addShortcut(naviSecondaryShortcut);
CSMPrefs::Shortcut* upShortcut = new CSMPrefs::Shortcut("orbit-up", "scene-speed-modifier", CSMPrefs::Shortcut* upShortcut = new CSMPrefs::Shortcut("orbit-up", "scene-speed-modifier",
CSMPrefs::Shortcut::SM_Detach, widget); CSMPrefs::Shortcut::SM_Detach, widget);
upShortcut->enable(false); upShortcut->enable(false);
connect(upShortcut, SIGNAL(activated(bool)), this, SLOT(up(bool))); connect(upShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
connect(upShortcut, SIGNAL(secondary(bool)), this, SLOT(alternateFast(bool))); this, &OrbitCameraController::up);
connect(upShortcut, qOverload<bool>(&CSMPrefs::Shortcut::secondary),
this, &OrbitCameraController::alternateFast);
addShortcut(upShortcut); addShortcut(upShortcut);
CSMPrefs::Shortcut* leftShortcut = new CSMPrefs::Shortcut("orbit-left", widget); CSMPrefs::Shortcut* leftShortcut = new CSMPrefs::Shortcut("orbit-left", widget);
leftShortcut->enable(false); leftShortcut->enable(false);
connect(leftShortcut, SIGNAL(activated(bool)), this, SLOT(left(bool))); connect(leftShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &OrbitCameraController::left);
addShortcut(leftShortcut); addShortcut(leftShortcut);
CSMPrefs::Shortcut* downShortcut = new CSMPrefs::Shortcut("orbit-down", widget); CSMPrefs::Shortcut* downShortcut = new CSMPrefs::Shortcut("orbit-down", widget);
downShortcut->enable(false); downShortcut->enable(false);
connect(downShortcut, SIGNAL(activated(bool)), this, SLOT(down(bool))); connect(downShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &OrbitCameraController::down);
addShortcut(downShortcut); addShortcut(downShortcut);
CSMPrefs::Shortcut* rightShortcut = new CSMPrefs::Shortcut("orbit-right", widget); CSMPrefs::Shortcut* rightShortcut = new CSMPrefs::Shortcut("orbit-right", widget);
rightShortcut->enable(false); rightShortcut->enable(false);
connect(rightShortcut, SIGNAL(activated(bool)), this, SLOT(right(bool))); connect(rightShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &OrbitCameraController::right);
addShortcut(rightShortcut); addShortcut(rightShortcut);
CSMPrefs::Shortcut* rollLeftShortcut = new CSMPrefs::Shortcut("orbit-roll-left", widget); CSMPrefs::Shortcut* rollLeftShortcut = new CSMPrefs::Shortcut("orbit-roll-left", widget);
rollLeftShortcut->enable(false); rollLeftShortcut->enable(false);
connect(rollLeftShortcut, SIGNAL(activated(bool)), this, SLOT(rollLeft(bool))); connect(rollLeftShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &OrbitCameraController::rollLeft);
addShortcut(rollLeftShortcut); addShortcut(rollLeftShortcut);
CSMPrefs::Shortcut* rollRightShortcut = new CSMPrefs::Shortcut("orbit-roll-right", widget); CSMPrefs::Shortcut* rollRightShortcut = new CSMPrefs::Shortcut("orbit-roll-right", widget);
rollRightShortcut->enable(false); rollRightShortcut->enable(false);
connect(rollRightShortcut, SIGNAL(activated(bool)), this, SLOT(rollRight(bool))); connect(rollRightShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &OrbitCameraController::rollRight);
addShortcut(rollRightShortcut); addShortcut(rollRightShortcut);
CSMPrefs::Shortcut* speedModeShortcut = new CSMPrefs::Shortcut("orbit-speed-mode", widget); CSMPrefs::Shortcut* speedModeShortcut = new CSMPrefs::Shortcut("orbit-speed-mode", widget);
speedModeShortcut->enable(false); speedModeShortcut->enable(false);
connect(speedModeShortcut, SIGNAL(activated()), this, SLOT(swapSpeedMode())); connect(speedModeShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &OrbitCameraController::swapSpeedMode);
addShortcut(speedModeShortcut); addShortcut(speedModeShortcut);
} }

View file

@ -51,8 +51,7 @@ namespace CSVRender
// Keep water existence/height up to date // Keep water existence/height up to date
QAbstractItemModel* cells = mData.getTableModel(CSMWorld::UniversalId::Type_Cells); QAbstractItemModel* cells = mData.getTableModel(CSMWorld::UniversalId::Type_Cells);
connect(cells, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)), connect(cells, &QAbstractItemModel::dataChanged, this, &CellWater::cellDataChanged);
this, SLOT(cellDataChanged(const QModelIndex&, const QModelIndex&)));
} }
CellWater::~CellWater() CellWater::~CellWater()

View file

@ -134,21 +134,26 @@ CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, osg:
parent), mSubMode (nullptr), mSubModeId ("move"), mSelectionMode (nullptr), mDragMode (DragMode_None), parent), mSubMode (nullptr), mSubModeId ("move"), mSelectionMode (nullptr), mDragMode (DragMode_None),
mDragAxis (-1), mLocked (false), mUnitScaleDist(1), mParentNode (parentNode) mDragAxis (-1), mLocked (false), mUnitScaleDist(1), mParentNode (parentNode)
{ {
connect(this, SIGNAL(requestFocus(const std::string&)), connect(this, &InstanceMode::requestFocus,
worldspaceWidget, SIGNAL(requestFocus(const std::string&))); worldspaceWidget, &WorldspaceWidget::requestFocus);
CSMPrefs::Shortcut* deleteShortcut = new CSMPrefs::Shortcut("scene-delete", worldspaceWidget); CSMPrefs::Shortcut* deleteShortcut = new CSMPrefs::Shortcut("scene-delete", worldspaceWidget);
connect(deleteShortcut, SIGNAL(activated(bool)), this, SLOT(deleteSelectedInstances(bool))); connect(deleteShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &InstanceMode::deleteSelectedInstances);
// Following classes could be simplified by using QSignalMapper, which is obsolete in Qt5.10, but not in Qt4.8 and Qt5.14 // Following classes could be simplified by using QSignalMapper, which is obsolete in Qt5.10, but not in Qt4.8 and Qt5.14
CSMPrefs::Shortcut* dropToCollisionShortcut = new CSMPrefs::Shortcut("scene-instance-drop-collision", worldspaceWidget); CSMPrefs::Shortcut* dropToCollisionShortcut = new CSMPrefs::Shortcut("scene-instance-drop-collision", worldspaceWidget);
connect(dropToCollisionShortcut, SIGNAL(activated()), this, SLOT(dropSelectedInstancesToCollision())); connect(dropToCollisionShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &InstanceMode::dropSelectedInstancesToCollision);
CSMPrefs::Shortcut* dropToTerrainLevelShortcut = new CSMPrefs::Shortcut("scene-instance-drop-terrain", worldspaceWidget); CSMPrefs::Shortcut* dropToTerrainLevelShortcut = new CSMPrefs::Shortcut("scene-instance-drop-terrain", worldspaceWidget);
connect(dropToTerrainLevelShortcut, SIGNAL(activated()), this, SLOT(dropSelectedInstancesToTerrain())); connect(dropToTerrainLevelShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &InstanceMode::dropSelectedInstancesToTerrain);
CSMPrefs::Shortcut* dropToCollisionShortcut2 = new CSMPrefs::Shortcut("scene-instance-drop-collision-separately", worldspaceWidget); CSMPrefs::Shortcut* dropToCollisionShortcut2 = new CSMPrefs::Shortcut("scene-instance-drop-collision-separately", worldspaceWidget);
connect(dropToCollisionShortcut2, SIGNAL(activated()), this, SLOT(dropSelectedInstancesToCollisionSeparately())); connect(dropToCollisionShortcut2, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &InstanceMode::dropSelectedInstancesToCollisionSeparately);
CSMPrefs::Shortcut* dropToTerrainLevelShortcut2 = new CSMPrefs::Shortcut("scene-instance-drop-terrain-separately", worldspaceWidget); CSMPrefs::Shortcut* dropToTerrainLevelShortcut2 = new CSMPrefs::Shortcut("scene-instance-drop-terrain-separately", worldspaceWidget);
connect(dropToTerrainLevelShortcut2, SIGNAL(activated()), this, SLOT(dropSelectedInstancesToTerrainSeparately())); connect(dropToTerrainLevelShortcut2, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &InstanceMode::dropSelectedInstancesToTerrainSeparately);
} }
void CSVRender::InstanceMode::activate (CSVWidget::SceneToolbar *toolbar) void CSVRender::InstanceMode::activate (CSVWidget::SceneToolbar *toolbar)
@ -172,8 +177,7 @@ void CSVRender::InstanceMode::activate (CSVWidget::SceneToolbar *toolbar)
mSubMode->setButton (mSubModeId); mSubMode->setButton (mSubModeId);
connect (mSubMode, SIGNAL (modeChanged (const std::string&)), connect (mSubMode, &CSVWidget::SceneToolMode::modeChanged, this, &InstanceMode::subModeChanged);
this, SLOT (subModeChanged (const std::string&)));
} }
if (!mSelectionMode) if (!mSelectionMode)

View file

@ -24,8 +24,8 @@ namespace CSVRender
mSelectSame = new QAction("Extend selection to instances with same object ID", this); mSelectSame = new QAction("Extend selection to instances with same object ID", this);
mDeleteSelection = new QAction("Delete selected instances", this); mDeleteSelection = new QAction("Delete selected instances", this);
connect(mSelectSame, SIGNAL(triggered()), this, SLOT(selectSame())); connect(mSelectSame, &QAction::triggered, this, &InstanceSelectionMode::selectSame);
connect(mDeleteSelection, SIGNAL(triggered()), this, SLOT(deleteSelection())); connect(mDeleteSelection, &QAction::triggered, this, &InstanceSelectionMode::deleteSelection);
} }
InstanceSelectionMode::~InstanceSelectionMode() InstanceSelectionMode::~InstanceSelectionMode()

View file

@ -16,7 +16,8 @@ namespace CSVRender
{ {
mCenterShortcut = new CSMPrefs::Shortcut("orbit-center-selection", worldspaceWidget); mCenterShortcut = new CSMPrefs::Shortcut("orbit-center-selection", worldspaceWidget);
mCenterShortcut->enable(false); mCenterShortcut->enable(false);
connect(mCenterShortcut, SIGNAL(activated()), this, SLOT(centerSelection())); connect(mCenterShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &OrbitCameraMode::centerSelection);
} }
OrbitCameraMode::~OrbitCameraMode() OrbitCameraMode::~OrbitCameraMode()
@ -27,7 +28,7 @@ namespace CSVRender
{ {
mCenterOnSelection = new QAction("Center on selected object", this); mCenterOnSelection = new QAction("Center on selected object", this);
mCenterShortcut->associateAction(mCenterOnSelection); mCenterShortcut->associateAction(mCenterOnSelection);
connect(mCenterOnSelection, SIGNAL(triggered()), this, SLOT(centerSelection())); connect(mCenterOnSelection, &QAction::triggered, this, &OrbitCameraMode::centerSelection);
mCenterShortcut->enable(true); mCenterShortcut->enable(true);
} }

View file

@ -524,49 +524,54 @@ CSVRender::PagedWorldspaceWidget::PagedWorldspaceWidget (QWidget* parent, CSMDoc
QAbstractItemModel *cells = QAbstractItemModel *cells =
document.getData().getTableModel (CSMWorld::UniversalId::Type_Cells); document.getData().getTableModel (CSMWorld::UniversalId::Type_Cells);
connect (cells, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (cells, &QAbstractItemModel::dataChanged,
this, SLOT (cellDataChanged (const QModelIndex&, const QModelIndex&))); this, &PagedWorldspaceWidget::cellDataChanged);
connect (cells, SIGNAL (rowsRemoved (const QModelIndex&, int, int)), connect (cells, &QAbstractItemModel::rowsRemoved,
this, SLOT (cellRemoved (const QModelIndex&, int, int))); this, &PagedWorldspaceWidget::cellRemoved);
connect (cells, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (cells, &QAbstractItemModel::rowsInserted,
this, SLOT (cellAdded (const QModelIndex&, int, int))); this, &PagedWorldspaceWidget::cellAdded);
connect (&document.getData(), SIGNAL (assetTablesChanged ()), connect (&document.getData(), &CSMWorld::Data::assetTablesChanged,
this, SLOT (assetTablesChanged ())); this, &PagedWorldspaceWidget::assetTablesChanged);
QAbstractItemModel *lands = document.getData().getTableModel (CSMWorld::UniversalId::Type_Lands); QAbstractItemModel *lands = document.getData().getTableModel (CSMWorld::UniversalId::Type_Lands);
connect (lands, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (lands, &QAbstractItemModel::dataChanged,
this, SLOT (landDataChanged (const QModelIndex&, const QModelIndex&))); this, &PagedWorldspaceWidget::landDataChanged);
connect (lands, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (lands, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (landAboutToBeRemoved (const QModelIndex&, int, int))); this, &PagedWorldspaceWidget::landAboutToBeRemoved);
connect (lands, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (lands, &QAbstractItemModel::rowsInserted,
this, SLOT (landAdded (const QModelIndex&, int, int))); this, &PagedWorldspaceWidget::landAdded);
QAbstractItemModel *ltexs = document.getData().getTableModel (CSMWorld::UniversalId::Type_LandTextures); QAbstractItemModel *ltexs = document.getData().getTableModel (CSMWorld::UniversalId::Type_LandTextures);
connect (ltexs, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (ltexs, &QAbstractItemModel::dataChanged,
this, SLOT (landTextureDataChanged (const QModelIndex&, const QModelIndex&))); this, &PagedWorldspaceWidget::landTextureDataChanged);
connect (ltexs, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (ltexs, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (landTextureAboutToBeRemoved (const QModelIndex&, int, int))); this, &PagedWorldspaceWidget::landTextureAboutToBeRemoved);
connect (ltexs, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (ltexs, &QAbstractItemModel::rowsInserted,
this, SLOT (landTextureAdded (const QModelIndex&, int, int))); this, &PagedWorldspaceWidget::landTextureAdded);
// Shortcuts // Shortcuts
CSMPrefs::Shortcut* loadCameraCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-cell", this); CSMPrefs::Shortcut* loadCameraCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-cell", this);
connect(loadCameraCellShortcut, SIGNAL(activated()), this, SLOT(loadCameraCell())); connect(loadCameraCellShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &PagedWorldspaceWidget::loadCameraCell);
CSMPrefs::Shortcut* loadCameraEastCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-eastcell", this); CSMPrefs::Shortcut* loadCameraEastCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-eastcell", this);
connect(loadCameraEastCellShortcut, SIGNAL(activated()), this, SLOT(loadEastCell())); connect(loadCameraEastCellShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &PagedWorldspaceWidget::loadEastCell);
CSMPrefs::Shortcut* loadCameraNorthCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-northcell", this); CSMPrefs::Shortcut* loadCameraNorthCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-northcell", this);
connect(loadCameraNorthCellShortcut, SIGNAL(activated()), this, SLOT(loadNorthCell())); connect(loadCameraNorthCellShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &PagedWorldspaceWidget::loadNorthCell);
CSMPrefs::Shortcut* loadCameraWestCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-westcell", this); CSMPrefs::Shortcut* loadCameraWestCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-westcell", this);
connect(loadCameraWestCellShortcut, SIGNAL(activated()), this, SLOT(loadWestCell())); connect(loadCameraWestCellShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &PagedWorldspaceWidget::loadWestCell);
CSMPrefs::Shortcut* loadCameraSouthCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-southcell", this); CSMPrefs::Shortcut* loadCameraSouthCellShortcut = new CSMPrefs::Shortcut("scene-load-cam-southcell", this);
connect(loadCameraSouthCellShortcut, SIGNAL(activated()), this, SLOT(loadSouthCell())); connect(loadCameraSouthCellShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &PagedWorldspaceWidget::loadSouthCell);
} }
CSVRender::PagedWorldspaceWidget::~PagedWorldspaceWidget() CSVRender::PagedWorldspaceWidget::~PagedWorldspaceWidget()
@ -888,8 +893,8 @@ CSVWidget::SceneToolToggle2 *CSVRender::PagedWorldspaceWidget::makeControlVisibi
mControlElements->setSelectionMask (0xffffffff); mControlElements->setSelectionMask (0xffffffff);
connect (mControlElements, SIGNAL (selectionChanged()), connect (mControlElements, &CSVWidget::SceneToolToggle2::selectionChanged,
this, SLOT (elementSelectionChanged())); this, &PagedWorldspaceWidget::elementSelectionChanged);
return mControlElements; return mControlElements;
} }

View file

@ -18,8 +18,8 @@ namespace CSVRender
mRemoveSelectedNodes = new QAction("Remove selected nodes", this); mRemoveSelectedNodes = new QAction("Remove selected nodes", this);
mRemoveSelectedEdges = new QAction("Remove edges between selected nodes", this); mRemoveSelectedEdges = new QAction("Remove edges between selected nodes", this);
connect(mRemoveSelectedNodes, SIGNAL(triggered()), this, SLOT(removeSelectedNodes())); connect(mRemoveSelectedNodes, &QAction::triggered, this, &PathgridSelectionMode::removeSelectedNodes);
connect(mRemoveSelectedEdges, SIGNAL(triggered()), this, SLOT(removeSelectedEdges())); connect(mRemoveSelectedEdges, &QAction::triggered, this, &PathgridSelectionMode::removeSelectedEdges);
} }
bool PathgridSelectionMode::createContextMenu(QMenu* menu) bool PathgridSelectionMode::createContextMenu(QMenu* menu)

View file

@ -12,13 +12,13 @@ CSVRender::PreviewWidget::PreviewWidget (CSMWorld::Data& data,
QAbstractItemModel *referenceables = QAbstractItemModel *referenceables =
mData.getTableModel (CSMWorld::UniversalId::Type_Referenceables); mData.getTableModel (CSMWorld::UniversalId::Type_Referenceables);
connect (referenceables, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (referenceables, &QAbstractItemModel::dataChanged,
this, SLOT (referenceableDataChanged (const QModelIndex&, const QModelIndex&))); this, &PreviewWidget::referenceableDataChanged);
connect (referenceables, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (referenceables, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (referenceableAboutToBeRemoved (const QModelIndex&, int, int))); this, &PreviewWidget::referenceableAboutToBeRemoved);
connect (&mData, SIGNAL (assetTablesChanged ()), connect (&mData, &CSMWorld::Data::assetTablesChanged,
this, SLOT (assetTablesChanged ())); this, &PreviewWidget::assetTablesChanged);
setExterior(false); setExterior(false);
@ -27,10 +27,10 @@ CSVRender::PreviewWidget::PreviewWidget (CSMWorld::Data& data,
QAbstractItemModel *references = QAbstractItemModel *references =
mData.getTableModel (CSMWorld::UniversalId::Type_References); mData.getTableModel (CSMWorld::UniversalId::Type_References);
connect (references, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (references, &QAbstractItemModel::dataChanged,
this, SLOT (referenceDataChanged (const QModelIndex&, const QModelIndex&))); this, &PreviewWidget::referenceDataChanged);
connect (references, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (references, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (referenceAboutToBeRemoved (const QModelIndex&, int, int))); this, &PreviewWidget::referenceAboutToBeRemoved);
} }
} }

View file

@ -146,7 +146,7 @@ CompositeViewer::CompositeViewer()
//setRunFrameScheme(osgViewer::ViewerBase::ON_DEMAND); //setRunFrameScheme(osgViewer::ViewerBase::ON_DEMAND);
setRunFrameScheme(osgViewer::ViewerBase::CONTINUOUS); setRunFrameScheme(osgViewer::ViewerBase::CONTINUOUS);
connect( &mTimer, SIGNAL(timeout()), this, SLOT(update()) ); connect(&mTimer, &QTimer::timeout, this, &CompositeViewer::update);
mTimer.start( 10 ); mTimer.start( 10 );
int frameRateLimit = CSMPrefs::get()["Rendering"]["framerate-limit"].toInt(); int frameRateLimit = CSMPrefs::get()["Rendering"]["framerate-limit"].toInt();
@ -227,8 +227,8 @@ SceneWidget::SceneWidget(std::shared_ptr<Resource::ResourceSystem> resourceSyste
setMouseTracking(true); setMouseTracking(true);
setFocusPolicy(Qt::ClickFocus); setFocusPolicy(Qt::ClickFocus);
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &SceneWidget::settingChanged);
// TODO update this outside of the constructor where virtual methods can be used // TODO update this outside of the constructor where virtual methods can be used
if (retrieveInput) if (retrieveInput)
@ -237,14 +237,16 @@ SceneWidget::SceneWidget(std::shared_ptr<Resource::ResourceSystem> resourceSyste
CSMPrefs::get()["Tooltips"].update(); CSMPrefs::get()["Tooltips"].update();
} }
connect (&CompositeViewer::get(), SIGNAL (simulationUpdated(double)), this, SLOT (update(double))); connect (&CompositeViewer::get(), &CompositeViewer::simulationUpdated, this, &SceneWidget::update);
// Shortcuts // Shortcuts
CSMPrefs::Shortcut* focusToolbarShortcut = new CSMPrefs::Shortcut("scene-focus-toolbar", this); CSMPrefs::Shortcut* focusToolbarShortcut = new CSMPrefs::Shortcut("scene-focus-toolbar", this);
connect(focusToolbarShortcut, SIGNAL(activated()), this, SIGNAL(focusToolbarRequest())); connect(focusToolbarShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &SceneWidget::focusToolbarRequest);
CSMPrefs::Shortcut* renderStatsShortcut = new CSMPrefs::Shortcut("scene-render-stats", this); CSMPrefs::Shortcut* renderStatsShortcut = new CSMPrefs::Shortcut("scene-render-stats", this);
connect(renderStatsShortcut, SIGNAL(activated()), this, SLOT(toggleRenderStats())); connect(renderStatsShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &SceneWidget::toggleRenderStats);
} }
SceneWidget::~SceneWidget() SceneWidget::~SceneWidget()
@ -430,8 +432,7 @@ CSVWidget::SceneToolMode *SceneWidget::makeLightingSelector (CSVWidget::SceneToo
"<ul><li>Maximum ambient</li>" "<ul><li>Maximum ambient</li>"
"<li>Strong directional light source</li></ul>"); "<li>Strong directional light source</li></ul>");
connect (tool, SIGNAL (modeChanged (const std::string&)), connect (tool, &CSVWidget::SceneToolMode::modeChanged, this, &SceneWidget::selectLightingMode);
this, SLOT (selectLightingMode (const std::string&)));
return tool; return tool;
} }

View file

@ -41,9 +41,9 @@ namespace CSVRender
mDeselectAll = new QAction("Clear selection", this); mDeselectAll = new QAction("Clear selection", this);
mInvertSelection = new QAction("Invert selection", this); mInvertSelection = new QAction("Invert selection", this);
connect(mSelectAll, SIGNAL(triggered()), this, SLOT(selectAll())); connect(mSelectAll, &QAction::triggered, this, &SelectionMode::selectAll);
connect(mDeselectAll, SIGNAL(triggered()), this, SLOT(clearSelection())); connect(mDeselectAll, &QAction::triggered, this, &SelectionMode::clearSelection);
connect(mInvertSelection, SIGNAL(triggered()), this, SLOT(invertSelection())); connect(mInvertSelection, &QAction::triggered, this, &SelectionMode::invertSelection);
} }
WorldspaceWidget& SelectionMode::getWorldspaceWidget() WorldspaceWidget& SelectionMode::getWorldspaceWidget()

View file

@ -47,12 +47,12 @@ void CSVRender::TerrainShapeMode::activate(CSVWidget::SceneToolbar* toolbar)
if(!mShapeBrushScenetool) if(!mShapeBrushScenetool)
{ {
mShapeBrushScenetool = new CSVWidget::SceneToolShapeBrush (toolbar, "scenetoolshapebrush", getWorldspaceWidget().getDocument()); mShapeBrushScenetool = new CSVWidget::SceneToolShapeBrush (toolbar, "scenetoolshapebrush", getWorldspaceWidget().getDocument());
connect(mShapeBrushScenetool, SIGNAL (clicked()), mShapeBrushScenetool, SLOT (activate())); connect(mShapeBrushScenetool, &CSVWidget::SceneTool::clicked, mShapeBrushScenetool, &CSVWidget::SceneToolShapeBrush::activate);
connect(mShapeBrushScenetool->mShapeBrushWindow, SIGNAL(passBrushSize(int)), this, SLOT(setBrushSize(int))); connect(mShapeBrushScenetool->mShapeBrushWindow, &CSVWidget::ShapeBrushWindow::passBrushSize, this, &TerrainShapeMode::setBrushSize);
connect(mShapeBrushScenetool->mShapeBrushWindow, SIGNAL(passBrushShape(CSVWidget::BrushShape)), this, SLOT(setBrushShape(CSVWidget::BrushShape))); connect(mShapeBrushScenetool->mShapeBrushWindow, &CSVWidget::ShapeBrushWindow::passBrushShape, this, &TerrainShapeMode::setBrushShape);
connect(mShapeBrushScenetool->mShapeBrushWindow->mSizeSliders->mBrushSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(setBrushSize(int))); connect(mShapeBrushScenetool->mShapeBrushWindow->mSizeSliders->mBrushSizeSlider, &QSlider::valueChanged, this, &TerrainShapeMode::setBrushSize);
connect(mShapeBrushScenetool->mShapeBrushWindow->mToolSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(setShapeEditTool(int))); connect(mShapeBrushScenetool->mShapeBrushWindow->mToolSelector, qOverload<int>(&QComboBox::currentIndexChanged), this, &TerrainShapeMode::setShapeEditTool);
connect(mShapeBrushScenetool->mShapeBrushWindow->mToolStrengthSlider, SIGNAL(valueChanged(int)), this, SLOT(setShapeEditToolStrength(int))); connect(mShapeBrushScenetool->mShapeBrushWindow->mToolStrengthSlider, &QSlider::valueChanged, this, &TerrainShapeMode::setShapeEditToolStrength);
} }
if (!mBrushDraw) if (!mBrushDraw)

View file

@ -47,16 +47,16 @@ void CSVRender::TerrainTextureMode::activate(CSVWidget::SceneToolbar* toolbar)
if(!mTextureBrushScenetool) if(!mTextureBrushScenetool)
{ {
mTextureBrushScenetool = new CSVWidget::SceneToolTextureBrush (toolbar, "scenetooltexturebrush", getWorldspaceWidget().getDocument()); mTextureBrushScenetool = new CSVWidget::SceneToolTextureBrush (toolbar, "scenetooltexturebrush", getWorldspaceWidget().getDocument());
connect(mTextureBrushScenetool, SIGNAL (clicked()), mTextureBrushScenetool, SLOT (activate())); connect(mTextureBrushScenetool, &CSVWidget::SceneTool::clicked, mTextureBrushScenetool, &CSVWidget::SceneToolTextureBrush::activate);
connect(mTextureBrushScenetool->mTextureBrushWindow, SIGNAL(passBrushSize(int)), this, SLOT(setBrushSize(int))); connect(mTextureBrushScenetool->mTextureBrushWindow, &CSVWidget::TextureBrushWindow::passBrushSize, this, &TerrainTextureMode::setBrushSize);
connect(mTextureBrushScenetool->mTextureBrushWindow, SIGNAL(passBrushShape(CSVWidget::BrushShape)), this, SLOT(setBrushShape(CSVWidget::BrushShape))); connect(mTextureBrushScenetool->mTextureBrushWindow, &CSVWidget::TextureBrushWindow::passBrushShape, this, &TerrainTextureMode::setBrushShape);
connect(mTextureBrushScenetool->mTextureBrushWindow->mSizeSliders->mBrushSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(setBrushSize(int))); connect(mTextureBrushScenetool->mTextureBrushWindow->mSizeSliders->mBrushSizeSlider, &QSlider::valueChanged, this, &TerrainTextureMode::setBrushSize);
connect(mTextureBrushScenetool, SIGNAL(passTextureId(std::string)), this, SLOT(setBrushTexture(std::string))); connect(mTextureBrushScenetool, &CSVWidget::SceneToolTextureBrush::passTextureId, this, &TerrainTextureMode::setBrushTexture);
connect(mTextureBrushScenetool->mTextureBrushWindow, SIGNAL(passTextureId(std::string)), this, SLOT(setBrushTexture(std::string))); connect(mTextureBrushScenetool->mTextureBrushWindow, &CSVWidget::TextureBrushWindow::passTextureId, this, &TerrainTextureMode::setBrushTexture);
connect(mTextureBrushScenetool, SIGNAL(passEvent(QDropEvent*)), this, SLOT(handleDropEvent(QDropEvent*))); connect(mTextureBrushScenetool, qOverload<QDropEvent *>(&CSVWidget::SceneToolTextureBrush::passEvent), this, &TerrainTextureMode::handleDropEvent);
connect(this, SIGNAL(passBrushTexture(std::string)), mTextureBrushScenetool->mTextureBrushWindow, SLOT(setBrushTexture(std::string))); connect(this, &TerrainTextureMode::passBrushTexture, mTextureBrushScenetool->mTextureBrushWindow, &CSVWidget::TextureBrushWindow::setBrushTexture);
connect(this, SIGNAL(passBrushTexture(std::string)), mTextureBrushScenetool, SLOT(updateBrushHistory(std::string))); connect(this, &TerrainTextureMode::passBrushTexture, mTextureBrushScenetool, &CSVWidget::SceneToolTextureBrush::updateBrushHistory);
} }
if (!mTerrainTextureSelection) if (!mTerrainTextureSelection)

View file

@ -44,13 +44,13 @@ CSVRender::UnpagedWorldspaceWidget::UnpagedWorldspaceWidget (const std::string&
mReferenceablesModel = &dynamic_cast<CSMWorld::IdTable&> ( mReferenceablesModel = &dynamic_cast<CSMWorld::IdTable&> (
*document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables)); *document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables));
connect (mCellsModel, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (mCellsModel, &CSMWorld::IdTable::dataChanged,
this, SLOT (cellDataChanged (const QModelIndex&, const QModelIndex&))); this, &UnpagedWorldspaceWidget::cellDataChanged);
connect (mCellsModel, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (mCellsModel, &CSMWorld::IdTable::rowsAboutToBeRemoved,
this, SLOT (cellRowsAboutToBeRemoved (const QModelIndex&, int, int))); this, &UnpagedWorldspaceWidget::cellRowsAboutToBeRemoved);
connect (&document.getData(), SIGNAL (assetTablesChanged ()), connect (&document.getData(), &CSMWorld::Data::assetTablesChanged,
this, SLOT (assetTablesChanged ())); this, &UnpagedWorldspaceWidget::assetTablesChanged);
update(); update();

View file

@ -55,42 +55,42 @@ CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidg
QAbstractItemModel *referenceables = QAbstractItemModel *referenceables =
document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables); document.getData().getTableModel (CSMWorld::UniversalId::Type_Referenceables);
connect (referenceables, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (referenceables, &QAbstractItemModel::dataChanged,
this, SLOT (referenceableDataChanged (const QModelIndex&, const QModelIndex&))); this, &WorldspaceWidget::referenceableDataChanged);
connect (referenceables, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (referenceables, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (referenceableAboutToBeRemoved (const QModelIndex&, int, int))); this, &WorldspaceWidget::referenceableAboutToBeRemoved);
connect (referenceables, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (referenceables, &QAbstractItemModel::rowsInserted,
this, SLOT (referenceableAdded (const QModelIndex&, int, int))); this, &WorldspaceWidget::referenceableAdded);
QAbstractItemModel *references = QAbstractItemModel *references =
document.getData().getTableModel (CSMWorld::UniversalId::Type_References); document.getData().getTableModel (CSMWorld::UniversalId::Type_References);
connect (references, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (references, &QAbstractItemModel::dataChanged,
this, SLOT (referenceDataChanged (const QModelIndex&, const QModelIndex&))); this, &WorldspaceWidget::referenceDataChanged);
connect (references, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (references, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (referenceAboutToBeRemoved (const QModelIndex&, int, int))); this, &WorldspaceWidget::referenceAboutToBeRemoved);
connect (references, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (references, &QAbstractItemModel::rowsInserted,
this, SLOT (referenceAdded (const QModelIndex&, int, int))); this, &WorldspaceWidget::referenceAdded);
QAbstractItemModel *pathgrids = document.getData().getTableModel (CSMWorld::UniversalId::Type_Pathgrids); QAbstractItemModel *pathgrids = document.getData().getTableModel (CSMWorld::UniversalId::Type_Pathgrids);
connect (pathgrids, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (pathgrids, &QAbstractItemModel::dataChanged,
this, SLOT (pathgridDataChanged (const QModelIndex&, const QModelIndex&))); this, &WorldspaceWidget::pathgridDataChanged);
connect (pathgrids, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (pathgrids, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (pathgridAboutToBeRemoved (const QModelIndex&, int, int))); this, &WorldspaceWidget::pathgridAboutToBeRemoved);
connect (pathgrids, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (pathgrids, &QAbstractItemModel::rowsInserted,
this, SLOT (pathgridAdded (const QModelIndex&, int, int))); this, &WorldspaceWidget::pathgridAdded);
QAbstractItemModel *debugProfiles = QAbstractItemModel *debugProfiles =
document.getData().getTableModel (CSMWorld::UniversalId::Type_DebugProfiles); document.getData().getTableModel (CSMWorld::UniversalId::Type_DebugProfiles);
connect (debugProfiles, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (debugProfiles, &QAbstractItemModel::dataChanged,
this, SLOT (debugProfileDataChanged (const QModelIndex&, const QModelIndex&))); this, &WorldspaceWidget::debugProfileDataChanged);
connect (debugProfiles, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (debugProfiles, &QAbstractItemModel::rowsAboutToBeRemoved,
this, SLOT (debugProfileAboutToBeRemoved (const QModelIndex&, int, int))); this, &WorldspaceWidget::debugProfileAboutToBeRemoved);
mToolTipDelayTimer.setSingleShot (true); mToolTipDelayTimer.setSingleShot (true);
connect (&mToolTipDelayTimer, SIGNAL (timeout()), this, SLOT (showToolTip())); connect (&mToolTipDelayTimer, &QTimer::timeout, this, &WorldspaceWidget::showToolTip);
CSMPrefs::get()["3D Scene Input"].update(); CSMPrefs::get()["3D Scene Input"].update();
CSMPrefs::get()["Tooltips"].update(); CSMPrefs::get()["Tooltips"].update();
@ -100,21 +100,28 @@ CSVRender::WorldspaceWidget::WorldspaceWidget (CSMDoc::Document& document, QWidg
CSMPrefs::Shortcut::SM_Detach, this); CSMPrefs::Shortcut::SM_Detach, this);
CSMPrefs::Shortcut* primaryOpenShortcut = new CSMPrefs::Shortcut("scene-open-primary", this); CSMPrefs::Shortcut* primaryOpenShortcut = new CSMPrefs::Shortcut("scene-open-primary", this);
connect(primaryOpenShortcut, SIGNAL(activated(bool)), this, SLOT(primaryOpen(bool))); connect(primaryOpenShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
connect(primaryEditShortcut, SIGNAL(activated(bool)), this, SLOT(primaryEdit(bool))); this, &WorldspaceWidget::primaryOpen);
connect(primaryEditShortcut, SIGNAL(secondary(bool)), this, SLOT(speedMode(bool))); connect(primaryEditShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &WorldspaceWidget::primaryEdit);
connect(primaryEditShortcut, qOverload<bool>(&CSMPrefs::Shortcut::secondary),
this, &WorldspaceWidget::speedMode);
CSMPrefs::Shortcut* secondaryEditShortcut = new CSMPrefs::Shortcut("scene-edit-secondary", this); CSMPrefs::Shortcut* secondaryEditShortcut = new CSMPrefs::Shortcut("scene-edit-secondary", this);
connect(secondaryEditShortcut, SIGNAL(activated(bool)), this, SLOT(secondaryEdit(bool))); connect(secondaryEditShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &WorldspaceWidget::secondaryEdit);
CSMPrefs::Shortcut* primarySelectShortcut = new CSMPrefs::Shortcut("scene-select-primary", this); CSMPrefs::Shortcut* primarySelectShortcut = new CSMPrefs::Shortcut("scene-select-primary", this);
connect(primarySelectShortcut, SIGNAL(activated(bool)), this, SLOT(primarySelect(bool))); connect(primarySelectShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &WorldspaceWidget::primarySelect);
CSMPrefs::Shortcut* secondarySelectShortcut = new CSMPrefs::Shortcut("scene-select-secondary", this); CSMPrefs::Shortcut* secondarySelectShortcut = new CSMPrefs::Shortcut("scene-select-secondary", this);
connect(secondarySelectShortcut, SIGNAL(activated(bool)), this, SLOT(secondarySelect(bool))); connect(secondarySelectShortcut, qOverload<bool>(&CSMPrefs::Shortcut::activated),
this, &WorldspaceWidget::secondarySelect);
CSMPrefs::Shortcut* abortShortcut = new CSMPrefs::Shortcut("scene-edit-abort", this); CSMPrefs::Shortcut* abortShortcut = new CSMPrefs::Shortcut("scene-edit-abort", this);
connect(abortShortcut, SIGNAL(activated()), this, SLOT(abortDrag())); connect(abortShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &WorldspaceWidget::abortDrag);
mInConstructor = false; mInConstructor = false;
} }
@ -209,8 +216,8 @@ CSVWidget::SceneToolMode *CSVRender::WorldspaceWidget::makeNavigationSelector (
"</ul>", tool), "</ul>", tool),
"orbit"); "orbit");
connect (tool, SIGNAL (modeChanged (const std::string&)), connect (tool, &CSVWidget::SceneToolMode::modeChanged,
this, SLOT (selectNavigationMode (const std::string&))); this, &WorldspaceWidget::selectNavigationMode);
return tool; return tool;
} }
@ -224,8 +231,8 @@ CSVWidget::SceneToolToggle2 *CSVRender::WorldspaceWidget::makeSceneVisibilitySel
mSceneElements->setSelectionMask (0xffffffff); mSceneElements->setSelectionMask (0xffffffff);
connect (mSceneElements, SIGNAL (selectionChanged()), connect (mSceneElements, &CSVWidget::SceneToolToggle2::selectionChanged,
this, SLOT (elementSelectionChanged())); this, &WorldspaceWidget::elementSelectionChanged);
return mSceneElements; return mSceneElements;
} }
@ -261,8 +268,8 @@ CSVWidget::SceneToolRun *CSVRender::WorldspaceWidget::makeRunTool (
mRun = new CSVWidget::SceneToolRun (parent, "Run OpenMW from the current camera position", mRun = new CSVWidget::SceneToolRun (parent, "Run OpenMW from the current camera position",
":scenetoolbar/play", profiles); ":scenetoolbar/play", profiles);
connect (mRun, SIGNAL (runRequest (const std::string&)), connect (mRun, &CSVWidget::SceneToolRun::runRequest,
this, SLOT (runRequest (const std::string&))); this, &WorldspaceWidget::runRequest);
return mRun; return mRun;
} }
@ -274,8 +281,8 @@ CSVWidget::SceneToolMode *CSVRender::WorldspaceWidget::makeEditModeSelector (
addEditModeSelectorButtons (mEditMode); addEditModeSelectorButtons (mEditMode);
connect (mEditMode, SIGNAL (modeChanged (const std::string&)), connect (mEditMode, &CSVWidget::SceneToolMode::modeChanged,
this, SLOT (editModeChanged (const std::string&))); this, &WorldspaceWidget::editModeChanged);
return mEditMode; return mEditMode;
} }

View file

@ -72,17 +72,16 @@ CSVTools::Merge::Merge (CSMDoc::DocumentManager& documentManager, QWidget *paren
rightLayout->addWidget (mAdjuster); rightLayout->addWidget (mAdjuster);
connect (mNewFile, SIGNAL (nameChanged (const QString&, bool)), connect (mNewFile, &CSVDoc::FileWidget::nameChanged, mAdjuster, &CSVDoc::AdjusterWidget::setName);
mAdjuster, SLOT (setName (const QString&, bool))); connect (mAdjuster, &CSVDoc::AdjusterWidget::stateChanged, this, &Merge::stateChanged);
connect (mAdjuster, SIGNAL (stateChanged (bool)), this, SLOT (stateChanged (bool)));
// buttons // buttons
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Cancel, Qt::Horizontal, this); QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Cancel, Qt::Horizontal, this);
connect (buttons->button (QDialogButtonBox::Cancel), SIGNAL (clicked()), this, SLOT (cancel())); connect (buttons->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &Merge::cancel);
mOkay = new QPushButton ("Merge", this); mOkay = new QPushButton ("Merge", this);
connect (mOkay, SIGNAL (clicked()), this, SLOT (accept())); connect (mOkay, &QPushButton::clicked, this, &Merge::accept);
mOkay->setDefault (true); mOkay->setDefault (true);
buttons->addButton (mOkay, QDialogButtonBox::AcceptRole); buttons->addButton (mOkay, QDialogButtonBox::AcceptRole);

View file

@ -13,15 +13,13 @@ CSVTools::ReportSubView::ReportSubView (const CSMWorld::UniversalId& id, CSMDoc:
setWidget (mTable = new ReportTable (document, id, false, mRefreshState, this)); setWidget (mTable = new ReportTable (document, id, false, mRefreshState, this));
connect (mTable, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)), connect (mTable, &ReportTable::editRequest, this, &ReportSubView::focusId);
SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)));
if (mRefreshState==CSMDoc::State_Verifying) if (mRefreshState==CSMDoc::State_Verifying)
{ {
connect (mTable, SIGNAL (refreshRequest()), this, SLOT (refreshRequest())); connect (mTable, &ReportTable::refreshRequest, this, &ReportSubView::refreshRequest);
connect (&document, SIGNAL (stateChanged (int, CSMDoc::Document *)), connect (&document, &CSMDoc::Document::stateChanged, mTable, &ReportTable::stateChanged);
mTable, SLOT (stateChanged (int, CSMDoc::Document *)));
} }
} }

View file

@ -168,19 +168,19 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
setItemDelegateForColumn (mModel->columnCount()-1, new RichTextDelegate (this)); setItemDelegateForColumn (mModel->columnCount()-1, new RichTextDelegate (this));
mShowAction = new QAction (tr ("Show"), this); mShowAction = new QAction (tr ("Show"), this);
connect (mShowAction, SIGNAL (triggered()), this, SLOT (showSelection())); connect (mShowAction, &QAction::triggered, this, &ReportTable::showSelection);
addAction (mShowAction); addAction (mShowAction);
CSMPrefs::Shortcut* showShortcut = new CSMPrefs::Shortcut("reporttable-show", this); CSMPrefs::Shortcut* showShortcut = new CSMPrefs::Shortcut("reporttable-show", this);
showShortcut->associateAction(mShowAction); showShortcut->associateAction(mShowAction);
mRemoveAction = new QAction (tr ("Remove from list"), this); mRemoveAction = new QAction (tr ("Remove from list"), this);
connect (mRemoveAction, SIGNAL (triggered()), this, SLOT (removeSelection())); connect (mRemoveAction, &QAction::triggered, this, &ReportTable::removeSelection);
addAction (mRemoveAction); addAction (mRemoveAction);
CSMPrefs::Shortcut* removeShortcut = new CSMPrefs::Shortcut("reporttable-remove", this); CSMPrefs::Shortcut* removeShortcut = new CSMPrefs::Shortcut("reporttable-remove", this);
removeShortcut->associateAction(mRemoveAction); removeShortcut->associateAction(mRemoveAction);
mReplaceAction = new QAction (tr ("Replace"), this); mReplaceAction = new QAction (tr ("Replace"), this);
connect (mReplaceAction, SIGNAL (triggered()), this, SIGNAL (replaceRequest())); connect (mReplaceAction, &QAction::triggered, this, &ReportTable::replaceRequest);
addAction (mReplaceAction); addAction (mReplaceAction);
CSMPrefs::Shortcut* replaceShortcut = new CSMPrefs::Shortcut("reporttable-replace", this); CSMPrefs::Shortcut* replaceShortcut = new CSMPrefs::Shortcut("reporttable-replace", this);
replaceShortcut->associateAction(mReplaceAction); replaceShortcut->associateAction(mReplaceAction);
@ -189,7 +189,7 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
{ {
mRefreshAction = new QAction (tr ("Refresh"), this); mRefreshAction = new QAction (tr ("Refresh"), this);
mRefreshAction->setEnabled (!(mDocument.getState() & mRefreshState)); mRefreshAction->setEnabled (!(mDocument.getState() & mRefreshState));
connect (mRefreshAction, SIGNAL (triggered()), this, SIGNAL (refreshRequest())); connect (mRefreshAction, &QAction::triggered, this, &ReportTable::refreshRequest);
addAction (mRefreshAction); addAction (mRefreshAction);
CSMPrefs::Shortcut* refreshShortcut = new CSMPrefs::Shortcut("reporttable-refresh", this); CSMPrefs::Shortcut* refreshShortcut = new CSMPrefs::Shortcut("reporttable-refresh", this);
refreshShortcut->associateAction(mRefreshAction); refreshShortcut->associateAction(mRefreshAction);
@ -199,8 +199,8 @@ CSVTools::ReportTable::ReportTable (CSMDoc::Document& document,
mDoubleClickActions.insert (std::make_pair (Qt::ShiftModifier, Action_Remove)); mDoubleClickActions.insert (std::make_pair (Qt::ShiftModifier, Action_Remove));
mDoubleClickActions.insert (std::make_pair (Qt::ControlModifier, Action_EditAndRemove)); mDoubleClickActions.insert (std::make_pair (Qt::ControlModifier, Action_EditAndRemove));
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &ReportTable::settingChanged);
CSMPrefs::get()["Reports"].update(); CSMPrefs::get()["Reports"].update();
} }

View file

@ -51,11 +51,11 @@ CSVTools::SearchBox::SearchBox (QWidget *parent)
mMode.addItem (tr("ID")); mMode.addItem (tr("ID"));
mMode.addItem (tr("ID (RegEx)")); mMode.addItem (tr("ID (RegEx)"));
mMode.addItem (tr("Record State")); mMode.addItem (tr("Record State"));
connect (&mMode, SIGNAL (activated (int)), this, SLOT (modeSelected (int))); connect (&mMode, qOverload<int>(&QComboBox::activated), this, &SearchBox::modeSelected);
mLayout->addWidget (&mMode, 0, 0); mLayout->addWidget (&mMode, 0, 0);
connect (&mText, SIGNAL (textChanged (const QString&)), this, SLOT (textChanged (const QString&))); connect (&mText, &QLineEdit::textChanged, this, &SearchBox::textChanged);
connect (&mText, SIGNAL (returnPressed()), this, SLOT (startSearch())); connect (&mText, &QLineEdit::returnPressed, this, [this](){ this->startSearch(false); });
mInput.insertWidget (0, &mText); mInput.insertWidget (0, &mText);
mInput.insertWidget (1, &mRecordState); mInput.insertWidget (1, &mRecordState);
@ -64,7 +64,7 @@ CSVTools::SearchBox::SearchBox (QWidget *parent)
mCaseSensitive.setText (tr ("Case")); mCaseSensitive.setText (tr ("Case"));
mLayout->addWidget (&mCaseSensitive, 0, 2); mLayout->addWidget (&mCaseSensitive, 0, 2);
connect (&mSearch, SIGNAL (clicked (bool)), this, SLOT (startSearch (bool))); connect (&mSearch, &QPushButton::clicked, this, qOverload<bool>(&SearchBox::startSearch));
mLayout->addWidget (&mSearch, 0, 3); mLayout->addWidget (&mSearch, 0, 3);
// replace panel // replace panel
@ -81,7 +81,7 @@ CSVTools::SearchBox::SearchBox (QWidget *parent)
mLayout->setContentsMargins (0, 0, 0, 0); mLayout->setContentsMargins (0, 0, 0, 0);
connect (&mReplace, (SIGNAL (clicked (bool))), this, SLOT (replaceAll (bool))); connect (&mReplace, &QPushButton::clicked, this, qOverload<bool>(&SearchBox::replaceAll));
// update // update
modeSelected (0); modeSelected (0);

View file

@ -88,27 +88,25 @@ CSVTools::SearchSubView::SearchSubView (const CSMWorld::UniversalId& id, CSMDoc:
stateChanged (document.getState(), &document); stateChanged (document.getState(), &document);
connect (mTable, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)), connect (mTable, &ReportTable::editRequest, this, &SearchSubView::focusId);
SIGNAL (focusId (const CSMWorld::UniversalId&, const std::string&)));
connect (mTable, SIGNAL (replaceRequest()), this, SLOT (replaceRequest())); connect (mTable, &ReportTable::replaceRequest, this, &SearchSubView::replaceRequest);
connect (&document, SIGNAL (stateChanged (int, CSMDoc::Document *)), connect (&document, &CSMDoc::Document::stateChanged, this, &SearchSubView::stateChanged);
this, SLOT (stateChanged (int, CSMDoc::Document *)));
connect (&mSearchBox, SIGNAL (startSearch (const CSMTools::Search&)), connect (&mSearchBox, qOverload<const CSMTools::Search&>(&SearchBox::startSearch),
this, SLOT (startSearch (const CSMTools::Search&))); this, &SearchSubView::startSearch);
connect (&mSearchBox, SIGNAL (replaceAll()), this, SLOT (replaceAllRequest())); connect (&mSearchBox, qOverload<>(&SearchBox::replaceAll), this,
&SearchSubView::replaceAllRequest);
connect (document.getReport (id), SIGNAL (rowsRemoved (const QModelIndex&, int, int)), connect (document.getReport(id), &CSMTools::ReportModel::rowsRemoved,
this, SLOT (tableSizeUpdate())); this, &SearchSubView::tableSizeUpdate);
connect (document.getReport (id), SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (document.getReport(id), &CSMTools::ReportModel::rowsInserted,
this, SLOT (tableSizeUpdate())); this, &SearchSubView::tableSizeUpdate);
connect (&document, SIGNAL (operationDone (int, bool)), connect (&document, &CSMDoc::Document::operationDone, this, &SearchSubView::operationDone);
this, SLOT (operationDone (int, bool)));
} }
void CSVTools::SearchSubView::setEditLock (bool locked) void CSVTools::SearchSubView::setEditLock (bool locked)

View file

@ -24,8 +24,8 @@ CSVWidget::ColorEditor::ColorEditor(QWidget *parent, const bool popupOnStart)
mColorPicker(new ColorPickerPopup(this)), mColorPicker(new ColorPickerPopup(this)),
mPopupOnStart(popupOnStart) mPopupOnStart(popupOnStart)
{ {
connect(this, SIGNAL(clicked()), this, SLOT(showPicker())); connect(this, &ColorEditor::clicked, this, &ColorEditor::showPicker);
connect(mColorPicker, SIGNAL(colorChanged(const QColor &)), this, SLOT(pickerColorChanged(const QColor &))); connect(mColorPicker, &ColorPickerPopup::colorChanged, this, &ColorEditor::pickerColorChanged);
} }
void CSVWidget::ColorEditor::paintEvent(QPaintEvent *event) void CSVWidget::ColorEditor::paintEvent(QPaintEvent *event)

View file

@ -18,10 +18,8 @@ CSVWidget::ColorPickerPopup::ColorPickerPopup(QWidget *parent)
mColorPicker->setWindowFlags(Qt::Widget); mColorPicker->setWindowFlags(Qt::Widget);
mColorPicker->setOptions(QColorDialog::NoButtons | QColorDialog::DontUseNativeDialog); mColorPicker->setOptions(QColorDialog::NoButtons | QColorDialog::DontUseNativeDialog);
mColorPicker->installEventFilter(this); mColorPicker->installEventFilter(this);
connect(mColorPicker, connect(mColorPicker, &QColorDialog::currentColorChanged,
SIGNAL(currentColorChanged(const QColor &)), this, &ColorPickerPopup::colorChanged);
this,
SIGNAL(colorChanged(const QColor &)));
QVBoxLayout *layout = new QVBoxLayout(this); QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(mColorPicker); layout->addWidget(mColorPicker);

View file

@ -82,14 +82,14 @@ CSVWidget::PushButton::PushButton (const QIcon& icon, Type type, const QString&
if (type==Type_Mode || type==Type_Toggle) if (type==Type_Mode || type==Type_Toggle)
{ {
setCheckable (true); setCheckable (true);
connect (this, SIGNAL (toggled (bool)), this, SLOT (checkedStateChanged (bool))); connect (this, &PushButton::toggled, this, &PushButton::checkedStateChanged);
} }
setCheckable (type==Type_Mode || type==Type_Toggle); setCheckable (type==Type_Mode || type==Type_Toggle);
processShortcuts(); processShortcuts();
setExtendedToolTip(); setExtendedToolTip();
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &PushButton::settingChanged);
} }
CSVWidget::PushButton::PushButton (Type type, const QString& tooltip, QWidget *parent) CSVWidget::PushButton::PushButton (Type type, const QString& tooltip, QWidget *parent)

View file

@ -11,7 +11,7 @@ CSVWidget::SceneTool::SceneTool (SceneToolbar *parent, Type type)
setIconSize (QSize (parent->getIconSize(), parent->getIconSize())); setIconSize (QSize (parent->getIconSize(), parent->getIconSize()));
setFixedSize (parent->getButtonSize(), parent->getButtonSize()); setFixedSize (parent->getButtonSize(), parent->getButtonSize());
connect (this, SIGNAL (clicked()), this, SLOT (openRequest())); connect (this, &SceneTool::clicked, this, &SceneTool::openRequest);
} }
void CSVWidget::SceneTool::activate() {} void CSVWidget::SceneTool::activate() {}

View file

@ -27,7 +27,8 @@ CSVWidget::SceneToolbar::SceneToolbar (int buttonSize, QWidget *parent)
setLayout (mLayout); setLayout (mLayout);
CSMPrefs::Shortcut* focusSceneShortcut = new CSMPrefs::Shortcut("scene-focus-toolbar", this); CSMPrefs::Shortcut* focusSceneShortcut = new CSMPrefs::Shortcut("scene-focus-toolbar", this);
connect(focusSceneShortcut, SIGNAL(activated()), this, SIGNAL(focusSceneRequest())); connect(focusSceneShortcut, qOverload<>(&CSMPrefs::Shortcut::activated),
this, &SceneToolbar::focusSceneRequest);
} }
void CSVWidget::SceneToolbar::addTool (SceneTool *tool, SceneTool *insertPoint) void CSVWidget::SceneToolbar::addTool (SceneTool *tool, SceneTool *insertPoint)

View file

@ -100,7 +100,7 @@ void CSVWidget::SceneToolMode::addButton (ModeButton *button, const std::string&
mButtons.insert (std::make_pair (button, id)); mButtons.insert (std::make_pair (button, id));
connect (button, SIGNAL (clicked()), this, SLOT (selected())); connect (button, &ModeButton::clicked, this, &SceneToolMode::selected);
if (mButtons.size()==1) if (mButtons.size()==1)
{ {

View file

@ -70,8 +70,7 @@ CSVWidget::SceneToolRun::SceneToolRun (SceneToolbar *parent, const QString& tool
layout->addWidget (mTable); layout->addWidget (mTable);
connect (mTable, SIGNAL (clicked (const QModelIndex&)), connect (mTable, &QTableWidget::clicked, this, &SceneToolRun::clicked);
this, SLOT (clicked (const QModelIndex&)));
} }
void CSVWidget::SceneToolRun::showPanel (const QPoint& position) void CSVWidget::SceneToolRun::showPanel (const QPoint& position)

View file

@ -39,8 +39,8 @@ CSVWidget::ShapeBrushSizeControls::ShapeBrushSizeControls(const QString &title,
layoutSliderSize->addWidget(mBrushSizeSlider); layoutSliderSize->addWidget(mBrushSizeSlider);
layoutSliderSize->addWidget(mBrushSizeSpinBox); layoutSliderSize->addWidget(mBrushSizeSpinBox);
connect(mBrushSizeSlider, SIGNAL(valueChanged(int)), mBrushSizeSpinBox, SLOT(setValue(int))); connect(mBrushSizeSlider, &QSlider::valueChanged, mBrushSizeSpinBox, &QSpinBox::setValue);
connect(mBrushSizeSpinBox, SIGNAL(valueChanged(int)), mBrushSizeSlider, SLOT(setValue(int))); connect(mBrushSizeSpinBox, qOverload<int>(&QSpinBox::valueChanged), mBrushSizeSlider, &QSlider::setValue);
setLayout(layoutSliderSize); setLayout(layoutSliderSize);
} }
@ -115,10 +115,10 @@ CSVWidget::ShapeBrushWindow::ShapeBrushWindow(CSMDoc::Document& document, QWidge
setLayout(layoutMain); setLayout(layoutMain);
connect(mButtonPoint, SIGNAL(clicked()), this, SLOT(setBrushShape())); connect(mButtonPoint, &QPushButton::clicked, this, &ShapeBrushWindow::setBrushShape);
connect(mButtonSquare, SIGNAL(clicked()), this, SLOT(setBrushShape())); connect(mButtonSquare, &QPushButton::clicked, this, &ShapeBrushWindow::setBrushShape);
connect(mButtonCircle, SIGNAL(clicked()), this, SLOT(setBrushShape())); connect(mButtonCircle, &QPushButton::clicked, this, &ShapeBrushWindow::setBrushShape);
connect(mButtonCustom, SIGNAL(clicked()), this, SLOT(setBrushShape())); connect(mButtonCustom, &QPushButton::clicked, this, &ShapeBrushWindow::setBrushShape);
} }
void CSVWidget::ShapeBrushWindow::configureButtonInitialSettings(QPushButton *button) void CSVWidget::ShapeBrushWindow::configureButtonInitialSettings(QPushButton *button)
@ -156,7 +156,7 @@ CSVWidget::SceneToolShapeBrush::SceneToolShapeBrush (SceneToolbar *parent, const
mShapeBrushWindow(new ShapeBrushWindow(document, this)) mShapeBrushWindow(new ShapeBrushWindow(document, this))
{ {
setAcceptDrops(true); setAcceptDrops(true);
connect(mShapeBrushWindow, SIGNAL(passBrushShape(CSVWidget::BrushShape)), this, SLOT(setButtonIcon(CSVWidget::BrushShape))); connect(mShapeBrushWindow, &ShapeBrushWindow::passBrushShape, this, &SceneToolShapeBrush::setButtonIcon);
setButtonIcon(mShapeBrushWindow->mBrushShape); setButtonIcon(mShapeBrushWindow->mBrushShape);
mPanel = new QFrame (this, Qt::Popup); mPanel = new QFrame (this, Qt::Popup);
@ -176,8 +176,7 @@ CSVWidget::SceneToolShapeBrush::SceneToolShapeBrush (SceneToolbar *parent, const
layout->addWidget (mTable); layout->addWidget (mTable);
connect (mTable, SIGNAL (clicked (const QModelIndex&)), connect (mTable, &QTableWidget::clicked, this, &SceneToolShapeBrush::clicked);
this, SLOT (clicked (const QModelIndex&)));
} }

View file

@ -44,8 +44,8 @@ CSVWidget::BrushSizeControls::BrushSizeControls(const QString &title, QWidget *p
mLayoutSliderSize->addWidget(mBrushSizeSlider); mLayoutSliderSize->addWidget(mBrushSizeSlider);
mLayoutSliderSize->addWidget(mBrushSizeSpinBox); mLayoutSliderSize->addWidget(mBrushSizeSpinBox);
connect(mBrushSizeSlider, SIGNAL(valueChanged(int)), mBrushSizeSpinBox, SLOT(setValue(int))); connect(mBrushSizeSlider, &QSlider::valueChanged, mBrushSizeSpinBox, &QSpinBox::setValue);
connect(mBrushSizeSpinBox, SIGNAL(valueChanged(int)), mBrushSizeSlider, SLOT(setValue(int))); connect(mBrushSizeSpinBox, qOverload<int>(&QSpinBox::valueChanged), mBrushSizeSlider, &QSlider::setValue);
setLayout(mLayoutSliderSize); setLayout(mLayoutSliderSize);
} }
@ -117,10 +117,10 @@ CSVWidget::TextureBrushWindow::TextureBrushWindow(CSMDoc::Document& document, QW
setLayout(layoutMain); setLayout(layoutMain);
connect(mButtonPoint, SIGNAL(clicked()), this, SLOT(setBrushShape())); connect(mButtonPoint, &QPushButton::clicked, this, &TextureBrushWindow::setBrushShape);
connect(mButtonSquare, SIGNAL(clicked()), this, SLOT(setBrushShape())); connect(mButtonSquare, &QPushButton::clicked, this, &TextureBrushWindow::setBrushShape);
connect(mButtonCircle, SIGNAL(clicked()), this, SLOT(setBrushShape())); connect(mButtonCircle, &QPushButton::clicked, this, &TextureBrushWindow::setBrushShape);
connect(mButtonCustom, SIGNAL(clicked()), this, SLOT(setBrushShape())); connect(mButtonCustom, &QPushButton::clicked, this, &TextureBrushWindow::setBrushShape);
} }
void CSVWidget::TextureBrushWindow::configureButtonInitialSettings(QPushButton *button) void CSVWidget::TextureBrushWindow::configureButtonInitialSettings(QPushButton *button)
@ -224,7 +224,7 @@ CSVWidget::SceneToolTextureBrush::SceneToolTextureBrush (SceneToolbar *parent, c
mBrushHistory[0] = "L0#0"; mBrushHistory[0] = "L0#0";
setAcceptDrops(true); setAcceptDrops(true);
connect(mTextureBrushWindow, SIGNAL(passBrushShape(CSVWidget::BrushShape)), this, SLOT(setButtonIcon(CSVWidget::BrushShape))); connect(mTextureBrushWindow, &TextureBrushWindow::passBrushShape, this, &SceneToolTextureBrush::setButtonIcon);
setButtonIcon(mTextureBrushWindow->mBrushShape); setButtonIcon(mTextureBrushWindow->mBrushShape);
mPanel = new QFrame (this, Qt::Popup); mPanel = new QFrame (this, Qt::Popup);
@ -244,8 +244,7 @@ CSVWidget::SceneToolTextureBrush::SceneToolTextureBrush (SceneToolbar *parent, c
layout->addWidget (mTable); layout->addWidget (mTable);
connect (mTable, SIGNAL (clicked (const QModelIndex&)), connect (mTable, &QTableWidget::clicked, this, &SceneToolTextureBrush::clicked);
this, SLOT (clicked (const QModelIndex&)));
} }

View file

@ -158,7 +158,7 @@ void CSVWidget::SceneToolToggle::addButton (const std::string& icon, unsigned in
mButtons.insert (std::make_pair (button, desc)); mButtons.insert (std::make_pair (button, desc));
connect (button, SIGNAL (clicked()), this, SLOT (selected())); connect (button, &PushButton::clicked, this, &SceneToolToggle::selected);
if (mButtons.size()==1) if (mButtons.size()==1)
mFirst = button; mFirst = button;

View file

@ -102,7 +102,7 @@ void CSVWidget::SceneToolToggle2::addButton (unsigned int id, unsigned int mask,
mButtons.insert (std::make_pair (button, desc)); mButtons.insert (std::make_pair (button, desc));
connect (button, SIGNAL (clicked()), this, SLOT (selected())); connect (button, &QPushButton::clicked, this, &SceneToolToggle2::selected);
if (mButtons.size()==1 && !disabled) if (mButtons.size()==1 && !disabled)
mFirst = button; mFirst = button;

View file

@ -26,7 +26,7 @@ CSVWorld::BodyPartCreator::BodyPartCreator(
mFirstPerson = new QCheckBox("First Person", this); mFirstPerson = new QCheckBox("First Person", this);
insertBeforeButtons(mFirstPerson, false); insertBeforeButtons(mFirstPerson, false);
connect(mFirstPerson, SIGNAL(clicked(bool)), this, SLOT(checkboxClicked())); connect(mFirstPerson, &QCheckBox::clicked, this, &BodyPartCreator::checkboxClicked);
} }
std::string CSVWorld::BodyPartCreator::getErrors() const std::string CSVWorld::BodyPartCreator::getErrors() const

View file

@ -39,7 +39,7 @@ CSVWorld::CellCreator::CellCreator (CSMWorld::Data& data, QUndoStack& undoStack,
mY->setVisible (false); mY->setVisible (false);
mY->setMinimum (std::numeric_limits<int>::min()); mY->setMinimum (std::numeric_limits<int>::min());
mY->setMaximum (std::numeric_limits<int>::max()); mY->setMaximum (std::numeric_limits<int>::max());
connect (mY, SIGNAL (valueChanged (int)), this, SLOT (valueChanged (int))); connect (mY, qOverload<int>(&QSpinBox::valueChanged), this, &CellCreator::valueChanged);
insertAtBeginning (mY, true); insertAtBeginning (mY, true);
mYLabel = new QLabel ("Y", this); mYLabel = new QLabel ("Y", this);
@ -50,7 +50,7 @@ CSVWorld::CellCreator::CellCreator (CSMWorld::Data& data, QUndoStack& undoStack,
mX->setVisible (false); mX->setVisible (false);
mX->setMinimum (std::numeric_limits<int>::min()); mX->setMinimum (std::numeric_limits<int>::min());
mX->setMaximum (std::numeric_limits<int>::max()); mX->setMaximum (std::numeric_limits<int>::max());
connect (mX, SIGNAL (valueChanged (int)), this, SLOT (valueChanged (int))); connect (mX, qOverload<int>(&QSpinBox::valueChanged), this, &CellCreator::valueChanged);
insertAtBeginning (mX, true); insertAtBeginning (mX, true);
mXLabel = new QLabel ("X", this); mXLabel = new QLabel ("X", this);
@ -62,7 +62,7 @@ CSVWorld::CellCreator::CellCreator (CSMWorld::Data& data, QUndoStack& undoStack,
mType->addItem ("Interior Cell"); mType->addItem ("Interior Cell");
mType->addItem ("Exterior Cell"); mType->addItem ("Exterior Cell");
connect (mType, SIGNAL (currentIndexChanged (int)), this, SLOT (setType (int))); connect (mType, qOverload<int>(&QComboBox::currentIndexChanged), this, &CellCreator::setType);
insertAtBeginning (mType, false); insertAtBeginning (mType, false);
} }

View file

@ -270,36 +270,42 @@ QWidget* CSVWorld::DialogueDelegateDispatcher::makeEditor(CSMWorld::ColumnBase::
// is required here // is required here
if (qobject_cast<CSVWidget::DropLineEdit*>(editor)) if (qobject_cast<CSVWidget::DropLineEdit*>(editor))
{ {
connect(editor, SIGNAL(editingFinished()), proxy, SLOT(editorDataCommited())); connect(static_cast<CSVWidget::DropLineEdit*>(editor), &CSVWidget::DropLineEdit::editingFinished,
proxy, qOverload<>(&DialogueDelegateDispatcherProxy::editorDataCommited));
connect(editor, SIGNAL(tableMimeDataDropped(const CSMWorld::UniversalId&, const CSMDoc::Document*)), connect(static_cast<CSVWidget::DropLineEdit*>(editor), &CSVWidget::DropLineEdit::tableMimeDataDropped,
proxy, SLOT(editorDataCommited())); proxy, qOverload<>(&DialogueDelegateDispatcherProxy::editorDataCommited));
} }
else if (qobject_cast<QCheckBox*>(editor)) else if (qobject_cast<QCheckBox*>(editor))
{ {
connect(editor, SIGNAL(stateChanged(int)), proxy, SLOT(editorDataCommited())); connect(static_cast<QCheckBox*>(editor), &QCheckBox::stateChanged,
proxy, qOverload<>(&DialogueDelegateDispatcherProxy::editorDataCommited));
} }
else if (qobject_cast<QPlainTextEdit*>(editor)) else if (qobject_cast<QPlainTextEdit*>(editor))
{ {
connect(editor, SIGNAL(textChanged()), proxy, SLOT(editorDataCommited())); connect(static_cast<QPlainTextEdit*>(editor), &QPlainTextEdit::textChanged, proxy,
qOverload<>(&DialogueDelegateDispatcherProxy::editorDataCommited));
} }
else if (qobject_cast<QComboBox*>(editor)) else if (qobject_cast<QComboBox*>(editor))
{ {
connect(editor, SIGNAL(currentIndexChanged (int)), proxy, SLOT(editorDataCommited())); connect(static_cast<QComboBox*>(editor), qOverload<int>(&QComboBox::currentIndexChanged),
proxy, qOverload<>(&DialogueDelegateDispatcherProxy::editorDataCommited));
} }
else if (qobject_cast<QAbstractSpinBox*>(editor) || qobject_cast<QLineEdit*>(editor)) else if (qobject_cast<QAbstractSpinBox*>(editor) || qobject_cast<QLineEdit*>(editor))
{ {
connect(editor, SIGNAL(editingFinished()), proxy, SLOT(editorDataCommited())); connect(static_cast<QAbstractSpinBox*>(editor), &QAbstractSpinBox::editingFinished,
proxy, qOverload<>(&DialogueDelegateDispatcherProxy::editorDataCommited));
} }
else if (qobject_cast<CSVWidget::ColorEditor *>(editor)) else if (qobject_cast<CSVWidget::ColorEditor *>(editor))
{ {
connect(editor, SIGNAL(pickingFinished()), proxy, SLOT(editorDataCommited())); connect(static_cast<CSVWidget::ColorEditor*>(editor), &CSVWidget::ColorEditor::pickingFinished,
proxy, qOverload<>(&DialogueDelegateDispatcherProxy::editorDataCommited));
} }
else // throw an exception because this is a coding error else // throw an exception because this is a coding error
throw std::logic_error ("Dialogue editor type missing"); throw std::logic_error ("Dialogue editor type missing");
connect(proxy, SIGNAL(editorDataCommited(QWidget*, const QModelIndex&, CSMWorld::ColumnBase::Display)), connect(proxy, qOverload<QWidget*,const QModelIndex&,CSMWorld::ColumnBase::Display>(&DialogueDelegateDispatcherProxy::editorDataCommited),
this, SLOT(editorDataCommited(QWidget*, const QModelIndex&, CSMWorld::ColumnBase::Display))); this, &DialogueDelegateDispatcher::editorDataCommited);
mProxys.push_back(proxy); //deleted in the destructor mProxys.push_back(proxy); //deleted in the destructor
} }
@ -325,13 +331,12 @@ CSVWorld::IdContextMenu::IdContextMenu(QWidget *widget, CSMWorld::ColumnBase::Di
Q_ASSERT(mIdType != CSMWorld::UniversalId::Type_None); Q_ASSERT(mIdType != CSMWorld::UniversalId::Type_None);
mWidget->setContextMenuPolicy(Qt::CustomContextMenu); mWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(mWidget, connect(mWidget, &QWidget::customContextMenuRequested,
SIGNAL(customContextMenuRequested(const QPoint &)), this, &IdContextMenu::showContextMenu);
this,
SLOT(showContextMenu(const QPoint &)));
mEditIdAction = new QAction(this); mEditIdAction = new QAction(this);
connect(mEditIdAction, SIGNAL(triggered()), this, SLOT(editIdRequest())); connect(mEditIdAction, &QAction::triggered,
this, qOverload<>(&IdContextMenu::editIdRequest));
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(mWidget); QLineEdit *lineEdit = qobject_cast<QLineEdit *>(mWidget);
if (lineEdit != nullptr) if (lineEdit != nullptr)
@ -442,10 +447,8 @@ void CSVWorld::EditWidget::createEditorContextMenu(QWidget *editor,
IdContextMenu *menu = new IdContextMenu(editor, display); IdContextMenu *menu = new IdContextMenu(editor, display);
// Current ID is already opened, so no need to create Edit 'ID' action for it // Current ID is already opened, so no need to create Edit 'ID' action for it
menu->excludeId(id.toUtf8().constData()); menu->excludeId(id.toUtf8().constData());
connect(menu, connect(menu, qOverload<const CSMWorld::UniversalId &,const std::string &>(&IdContextMenu::editIdRequest),
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)), this, &EditWidget::editIdRequest);
this,
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)));
} }
} }
@ -598,10 +601,8 @@ void CSVWorld::EditWidget::remake(int row)
tablesLayout->addWidget(label); tablesLayout->addWidget(label);
tablesLayout->addWidget(table); tablesLayout->addWidget(table);
connect(table, connect(table, &NestedTable::editRequest,
SIGNAL(editRequest(const CSMWorld::UniversalId &, const std::string &)), this, &EditWidget::editIdRequest);
this,
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)));
} }
} }
else if (!(flags & CSMWorld::ColumnBase::Flag_Dialogue_List)) else if (!(flags & CSMWorld::ColumnBase::Flag_Dialogue_List))
@ -744,8 +745,8 @@ CSVWorld::SimpleDialogueSubView::SimpleDialogueSubView (const CSMWorld::Universa
mDocument(document), mDocument(document),
mCommandDispatcher (document, CSMWorld::UniversalId::getParentType (id.getType())) mCommandDispatcher (document, CSMWorld::UniversalId::getParentType (id.getType()))
{ {
connect(mTable, SIGNAL(dataChanged (const QModelIndex&, const QModelIndex&)), this, SLOT(dataChanged(const QModelIndex&))); connect(mTable, &CSMWorld::IdTable::dataChanged, this, &SimpleDialogueSubView::dataChanged);
connect(mTable, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int)), this, SLOT(rowsAboutToBeRemoved(const QModelIndex&, int, int))); connect(mTable, &CSMWorld::IdTable::rowsAboutToBeRemoved, this, &SimpleDialogueSubView::rowsAboutToBeRemoved);
updateCurrentId(); updateCurrentId();
@ -764,10 +765,8 @@ CSVWorld::SimpleDialogueSubView::SimpleDialogueSubView (const CSMWorld::Universa
dataChanged(mTable->getModelIndex (getUniversalId().getId(), idColumn)); dataChanged(mTable->getModelIndex (getUniversalId().getId(), idColumn));
connect(mEditWidget, connect(mEditWidget, &EditWidget::editIdRequest,
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)), this, &SimpleDialogueSubView::focusId);
this,
SIGNAL(focusId(const CSMWorld::UniversalId &, const std::string &)));
} }
void CSVWorld::SimpleDialogueSubView::setEditLock (bool locked) void CSVWorld::SimpleDialogueSubView::setEditLock (bool locked)
@ -864,12 +863,12 @@ void CSVWorld::DialogueSubView::addButtonBar()
getMainLayout().insertWidget (1, mButtons); getMainLayout().insertWidget (1, mButtons);
// connections // connections
connect (mButtons, SIGNAL (showPreview()), this, SLOT (showPreview())); connect (mButtons, &RecordButtonBar::showPreview, this, &DialogueSubView::showPreview);
connect (mButtons, SIGNAL (viewRecord()), this, SLOT (viewRecord())); connect (mButtons, &RecordButtonBar::viewRecord, this, &DialogueSubView::viewRecord);
connect (mButtons, SIGNAL (switchToRow (int)), this, SLOT (switchToRow (int))); connect (mButtons, &RecordButtonBar::switchToRow, this, &DialogueSubView::switchToRow);
connect (this, SIGNAL (universalIdChanged (const CSMWorld::UniversalId&)), connect (this, &DialogueSubView::universalIdChanged,
mButtons, SLOT (universalIdChanged (const CSMWorld::UniversalId&))); mButtons, &RecordButtonBar::universalIdChanged);
} }
CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id, CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id,
@ -879,14 +878,13 @@ CSVWorld::DialogueSubView::DialogueSubView (const CSMWorld::UniversalId& id,
// bottom box // bottom box
mBottom = new TableBottomBox (creatorFactory, document, id, this); mBottom = new TableBottomBox (creatorFactory, document, id, this);
connect (mBottom, SIGNAL (requestFocus (const std::string&)), connect (mBottom, &TableBottomBox::requestFocus, this, &DialogueSubView::requestFocus);
this, SLOT (requestFocus (const std::string&)));
// layout // layout
getMainLayout().addWidget (mBottom); getMainLayout().addWidget (mBottom);
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &DialogueSubView::settingChanged);
CSMPrefs::get()["ID Dialogues"].update(); CSMPrefs::get()["ID Dialogues"].update();
} }

View file

@ -24,16 +24,16 @@ CSVWorld::ExtendedCommandConfigurator::ExtendedCommandConfigurator(CSMDoc::Docum
{ {
mCommandDispatcher = new CSMWorld::CommandDispatcher(document, id, this); mCommandDispatcher = new CSMWorld::CommandDispatcher(document, id, this);
connect(&mData, SIGNAL(idListChanged()), this, SLOT(dataIdListChanged())); connect(&mData, &CSMWorld::Data::idListChanged, this, &ExtendedCommandConfigurator::dataIdListChanged);
mPerformButton = new QPushButton(this); mPerformButton = new QPushButton(this);
mPerformButton->setDefault(true); mPerformButton->setDefault(true);
mPerformButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); mPerformButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(mPerformButton, SIGNAL(clicked(bool)), this, SLOT(performExtendedCommand())); connect(mPerformButton, &QPushButton::clicked, this, &ExtendedCommandConfigurator::performExtendedCommand);
mCancelButton = new QPushButton("Cancel", this); mCancelButton = new QPushButton("Cancel", this);
mCancelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); mCancelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(mCancelButton, SIGNAL(clicked(bool)), this, SIGNAL(done())); connect(mCancelButton, &QPushButton::clicked, this, &ExtendedCommandConfigurator::done);
mTypeGroup = new QGroupBox(this); mTypeGroup = new QGroupBox(this);
@ -128,7 +128,7 @@ void CSVWorld::ExtendedCommandConfigurator::setupCheckBoxes(const std::vector<CS
for (int i = numTypes - numCheckBoxes; i > 0; --i) for (int i = numTypes - numCheckBoxes; i > 0; --i)
{ {
QCheckBox *checkBox = new QCheckBox(mTypeGroup); QCheckBox *checkBox = new QCheckBox(mTypeGroup);
connect(checkBox, SIGNAL(stateChanged(int)), this, SLOT(checkBoxStateChanged(int))); connect(checkBox, &QCheckBox::stateChanged, this, &ExtendedCommandConfigurator::checkBoxStateChanged);
mTypeCheckBoxes.insert(std::make_pair(checkBox, CSMWorld::UniversalId::Type_None)); mTypeCheckBoxes.insert(std::make_pair(checkBox, CSMWorld::UniversalId::Type_None));
} }
} }

View file

@ -175,13 +175,13 @@ CSVWorld::GenericCreator::GenericCreator (CSMWorld::Data& data, QUndoStack& undo
setLayout (mLayout); setLayout (mLayout);
connect (mCancel, SIGNAL (clicked (bool)), this, SIGNAL (done())); connect (mCancel, &QPushButton::clicked, this, &GenericCreator::done);
connect (mCreate, SIGNAL (clicked (bool)), this, SLOT (create())); connect (mCreate, &QPushButton::clicked, this, &GenericCreator::create);
connect (mId, SIGNAL (textChanged (const QString&)), this, SLOT (textChanged (const QString&))); connect (mId, &QLineEdit::textChanged, this, &GenericCreator::textChanged);
connect (mId, SIGNAL (returnPressed()), this, SLOT (inputReturnPressed())); connect (mId, &QLineEdit::returnPressed, this, &GenericCreator::inputReturnPressed);
connect (&mData, SIGNAL (idListChanged()), this, SLOT (dataIdListChanged())); connect (&mData, &CSMWorld::Data::idListChanged, this, &GenericCreator::dataIdListChanged);
} }
void CSVWorld::GenericCreator::setEditorMaxLength (int length) void CSVWorld::GenericCreator::setEditorMaxLength (int length)
@ -317,7 +317,8 @@ void CSVWorld::GenericCreator::setScope (unsigned int scope)
"Record will be created in the reserved namespace \"session\".<p>" "Record will be created in the reserved namespace \"session\".<p>"
"Record is not available when running OpenMW via OpenCS."); "Record is not available when running OpenMW via OpenCS.");
connect (mScope, SIGNAL (currentIndexChanged (int)), this, SLOT (scopeChanged (int))); connect (mScope, qOverload<int>(&QComboBox::currentIndexChanged),
this, &GenericCreator::scopeChanged);
mScopeLabel = new QLabel ("Scope", this); mScopeLabel = new QLabel ("Scope", this);
insertAtBeginning (mScopeLabel, false); insertAtBeginning (mScopeLabel, false);

View file

@ -84,7 +84,7 @@ CSVWorld::InfoCreator::InfoCreator (CSMWorld::Data& data, QUndoStack& undoStack,
setManualEditing (false); setManualEditing (false);
connect (mTopic, SIGNAL (textChanged (const QString&)), this, SLOT (topicChanged())); connect (mTopic, &CSVWidget::DropLineEdit::textChanged, this, &InfoCreator::topicChanged);
connect (mTopic, SIGNAL (returnPressed()), this, SLOT (inputReturnPressed())); connect (mTopic, SIGNAL (returnPressed()), this, SLOT (inputReturnPressed()));
} }

View file

@ -37,8 +37,8 @@ namespace CSVWorld
insertBeforeButtons(mYLabel, false); insertBeforeButtons(mYLabel, false);
insertBeforeButtons(mY, true); insertBeforeButtons(mY, true);
connect (mX, SIGNAL(valueChanged(int)), this, SLOT(coordChanged(int))); connect (mX, qOverload<int>(&QSpinBox::valueChanged), this, &LandCreator::coordChanged);
connect (mY, SIGNAL(valueChanged(int)), this, SLOT(coordChanged(int))); connect (mY, qOverload<int>(&QSpinBox::valueChanged), this, &LandCreator::coordChanged);
} }
void LandCreator::cloneMode(const std::string& originId, const CSMWorld::UniversalId::Type type) void LandCreator::cloneMode(const std::string& originId, const CSMWorld::UniversalId::Type type)

View file

@ -35,8 +35,9 @@ namespace CSVWorld
mIndexBox->setMaximum(MaxIndex); mIndexBox->setMaximum(MaxIndex);
insertBeforeButtons(mIndexBox, true); insertBeforeButtons(mIndexBox, true);
connect(mNameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&))); connect(mNameEdit, &QLineEdit::textChanged, this, &LandTextureCreator::nameChanged);
connect(mIndexBox, SIGNAL(valueChanged(int)), this, SLOT(indexChanged(int))); connect(mIndexBox, qOverload<int>(&QSpinBox::valueChanged),
this, &LandTextureCreator::indexChanged);
} }
void LandTextureCreator::cloneMode(const std::string& originId, const CSMWorld::UniversalId::Type type) void LandTextureCreator::cloneMode(const std::string& originId, const CSMWorld::UniversalId::Type type)

View file

@ -57,20 +57,20 @@ CSVWorld::NestedTable::NestedTable(CSMDoc::Document& document,
if (!fixedRows) if (!fixedRows)
{ {
mAddNewRowAction = new QAction (tr ("Add new row"), this); mAddNewRowAction = new QAction (tr ("Add new row"), this);
connect(mAddNewRowAction, SIGNAL(triggered()), connect(mAddNewRowAction, &QAction::triggered,
this, SLOT(addNewRowActionTriggered())); this, &NestedTable::addNewRowActionTriggered);
CSMPrefs::Shortcut* addRowShortcut = new CSMPrefs::Shortcut("table-add", this); CSMPrefs::Shortcut* addRowShortcut = new CSMPrefs::Shortcut("table-add", this);
addRowShortcut->associateAction(mAddNewRowAction); addRowShortcut->associateAction(mAddNewRowAction);
mRemoveRowAction = new QAction (tr ("Remove rows"), this); mRemoveRowAction = new QAction (tr ("Remove rows"), this);
connect(mRemoveRowAction, SIGNAL(triggered()), connect(mRemoveRowAction, &QAction::triggered,
this, SLOT(removeRowActionTriggered())); this, &NestedTable::removeRowActionTriggered);
CSMPrefs::Shortcut* removeRowShortcut = new CSMPrefs::Shortcut("table-remove", this); CSMPrefs::Shortcut* removeRowShortcut = new CSMPrefs::Shortcut("table-remove", this);
removeRowShortcut->associateAction(mRemoveRowAction); removeRowShortcut->associateAction(mRemoveRowAction);
} }
mEditIdAction = new TableEditIdAction(*this, this); mEditIdAction = new TableEditIdAction(*this, this);
connect(mEditIdAction, SIGNAL(triggered()), this, SLOT(editCell())); connect(mEditIdAction, &QAction::triggered, this, &NestedTable::editCell);
} }
} }

View file

@ -42,7 +42,7 @@ CSVWorld::PathgridCreator::PathgridCreator(
mCell->setCompleter(completionManager.getCompleter(displayType).get()); mCell->setCompleter(completionManager.getCompleter(displayType).get());
insertBeforeButtons(mCell, true); insertBeforeButtons(mCell, true);
connect(mCell, SIGNAL (textChanged(const QString&)), this, SLOT (cellChanged())); connect(mCell, &CSVWidget::DropLineEdit::textChanged, this, &PathgridCreator::cellChanged);
connect(mCell, SIGNAL (returnPressed()), this, SLOT (inputReturnPressed())); connect(mCell, SIGNAL (returnPressed()), this, SLOT (inputReturnPressed()));
} }

View file

@ -44,11 +44,14 @@ CSVWorld::PreviewSubView::PreviewSubView (const CSMWorld::UniversalId& id, CSMDo
setWidget (widget); setWidget (widget);
connect (mScene, SIGNAL (closeRequest()), this, SLOT (closeRequest())); connect (mScene, &CSVRender::PreviewWidget::closeRequest,
connect (mScene, SIGNAL (referenceableIdChanged (const std::string&)), this, qOverload<>(&PreviewSubView::closeRequest));
this, SLOT (referenceableIdChanged (const std::string&))); connect (mScene, &CSVRender::PreviewWidget::referenceableIdChanged,
connect (mScene, SIGNAL (focusToolbarRequest()), toolbar, SLOT (setFocus())); this, &PreviewSubView::referenceableIdChanged);
connect (toolbar, SIGNAL (focusSceneRequest()), mScene, SLOT (setFocus())); connect (mScene, &CSVRender::PreviewWidget::focusToolbarRequest,
toolbar, qOverload<>(&CSVWidget::SceneToolbar::setFocus));
connect (toolbar, &CSVWidget::SceneToolbar::focusSceneRequest,
mScene, qOverload<>(&CSVRender::PreviewWidget::setFocus));
} }
void CSVWorld::PreviewSubView::setEditLock (bool locked) {} void CSVWorld::PreviewSubView::setEditLock (bool locked) {}

View file

@ -75,7 +75,7 @@ CSVWorld::RecordButtonBar::RecordButtonBar (const CSMWorld::UniversalId& id,
previewButton->setIcon(QIcon(":edit-preview")); previewButton->setIcon(QIcon(":edit-preview"));
previewButton->setToolTip ("Open a preview of this record"); previewButton->setToolTip ("Open a preview of this record");
buttonsLayout->addWidget(previewButton); buttonsLayout->addWidget(previewButton);
connect (previewButton, SIGNAL(clicked()), this, SIGNAL (showPreview())); connect (previewButton, &QToolButton::clicked, this, &RecordButtonBar::showPreview);
} }
if (mTable.getFeatures() & CSMWorld::IdTable::Feature_View) if (mTable.getFeatures() & CSMWorld::IdTable::Feature_View)
@ -84,7 +84,7 @@ CSVWorld::RecordButtonBar::RecordButtonBar (const CSMWorld::UniversalId& id,
viewButton->setIcon(QIcon(":/cell.png")); viewButton->setIcon(QIcon(":/cell.png"));
viewButton->setToolTip ("Open a scene view of the cell this record is located in"); viewButton->setToolTip ("Open a scene view of the cell this record is located in");
buttonsLayout->addWidget(viewButton); buttonsLayout->addWidget(viewButton);
connect (viewButton, SIGNAL(clicked()), this, SIGNAL (viewRecord())); connect (viewButton, &QToolButton::clicked, this, &RecordButtonBar::viewRecord);
} }
// right section // right section
@ -113,26 +113,28 @@ CSVWorld::RecordButtonBar::RecordButtonBar (const CSMWorld::UniversalId& id,
// connections // connections
if(mBottom && mBottom->canCreateAndDelete()) if(mBottom && mBottom->canCreateAndDelete())
{ {
connect (mAddButton, SIGNAL (clicked()), mBottom, SLOT (createRequest())); connect (mAddButton, &QToolButton::clicked, mBottom, &TableBottomBox::createRequest);
connect (mCloneButton, SIGNAL (clicked()), this, SLOT (cloneRequest())); connect (mCloneButton, &QToolButton::clicked, this, &RecordButtonBar::cloneRequest);
} }
connect (mNextButton, SIGNAL (clicked()), this, SLOT (nextId())); connect (mNextButton, &QToolButton::clicked, this, &RecordButtonBar::nextId);
connect (mPrevButton, SIGNAL (clicked()), this, SLOT (prevId())); connect (mPrevButton, &QToolButton::clicked, this, &RecordButtonBar::prevId);
if (mCommandDispatcher) if (mCommandDispatcher)
{ {
connect (mRevertButton, SIGNAL (clicked()), mCommandDispatcher, SLOT (executeRevert())); connect (mRevertButton, &QToolButton::clicked,
connect (mDeleteButton, SIGNAL (clicked()), mCommandDispatcher, SLOT (executeDelete())); mCommandDispatcher, &CSMWorld::CommandDispatcher::executeRevert);
connect (mDeleteButton, &QToolButton::clicked,
mCommandDispatcher, &CSMWorld::CommandDispatcher::executeDelete);
} }
connect (&mTable, SIGNAL (rowsInserted (const QModelIndex&, int, int)), connect (&mTable, &CSMWorld::IdTable::rowsInserted,
this, SLOT (rowNumberChanged (const QModelIndex&, int, int))); this, &RecordButtonBar::rowNumberChanged);
connect (&mTable, SIGNAL (rowsRemoved (const QModelIndex&, int, int)), connect (&mTable, &CSMWorld::IdTable::rowsRemoved,
this, SLOT (rowNumberChanged (const QModelIndex&, int, int))); this, &RecordButtonBar::rowNumberChanged);
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &RecordButtonBar::settingChanged);
updateModificationButtons(); updateModificationButtons();
updatePrevNextButtons(); updatePrevNextButtons();

View file

@ -37,7 +37,7 @@ CSVWorld::ReferenceableCreator::ReferenceableCreator (CSMWorld::Data& data, QUnd
insertBeforeButtons (mType, false); insertBeforeButtons (mType, false);
connect (mType, SIGNAL (currentIndexChanged (int)), this, SLOT (setType (int))); connect (mType, qOverload<int>(&QComboBox::currentIndexChanged), this, &ReferenceableCreator::setType);
} }
void CSVWorld::ReferenceableCreator::reset() void CSVWorld::ReferenceableCreator::reset()

View file

@ -43,7 +43,7 @@ CSVWorld::ReferenceCreator::ReferenceCreator (CSMWorld::Data& data, QUndoStack&
setManualEditing (false); setManualEditing (false);
connect (mCell, SIGNAL (textChanged (const QString&)), this, SLOT (cellChanged())); connect (mCell, &CSVWidget::DropLineEdit::textChanged, this, &ReferenceCreator::cellChanged);
connect (mCell, SIGNAL (returnPressed()), this, SLOT (inputReturnPressed())); connect (mCell, SIGNAL (returnPressed()), this, SLOT (inputReturnPressed()));
} }

View file

@ -189,35 +189,35 @@ CSVWorld::RegionMap::RegionMap (const CSMWorld::UniversalId& universalId,
resizeRowsToContents(); resizeRowsToContents();
mSelectAllAction = new QAction (tr ("Select All"), this); mSelectAllAction = new QAction (tr ("Select All"), this);
connect (mSelectAllAction, SIGNAL (triggered()), this, SLOT (selectAll())); connect (mSelectAllAction, &QAction::triggered, this, &RegionMap::selectAll);
addAction (mSelectAllAction); addAction (mSelectAllAction);
mClearSelectionAction = new QAction (tr ("Clear Selection"), this); mClearSelectionAction = new QAction (tr ("Clear Selection"), this);
connect (mClearSelectionAction, SIGNAL (triggered()), this, SLOT (clearSelection())); connect (mClearSelectionAction, &QAction::triggered, this, &RegionMap::clearSelection);
addAction (mClearSelectionAction); addAction (mClearSelectionAction);
mSelectRegionsAction = new QAction (tr ("Select Regions"), this); mSelectRegionsAction = new QAction (tr ("Select Regions"), this);
connect (mSelectRegionsAction, SIGNAL (triggered()), this, SLOT (selectRegions())); connect (mSelectRegionsAction, &QAction::triggered, this, &RegionMap::selectRegions);
addAction (mSelectRegionsAction); addAction (mSelectRegionsAction);
mCreateCellsAction = new QAction (tr ("Create Cells Action"), this); mCreateCellsAction = new QAction (tr ("Create Cells Action"), this);
connect (mCreateCellsAction, SIGNAL (triggered()), this, SLOT (createCells())); connect (mCreateCellsAction, &QAction::triggered, this, &RegionMap::createCells);
addAction (mCreateCellsAction); addAction (mCreateCellsAction);
mSetRegionAction = new QAction (tr ("Set Region"), this); mSetRegionAction = new QAction (tr ("Set Region"), this);
connect (mSetRegionAction, SIGNAL (triggered()), this, SLOT (setRegion())); connect (mSetRegionAction, &QAction::triggered, this, qOverload<>(&RegionMap::setRegion));
addAction (mSetRegionAction); addAction (mSetRegionAction);
mUnsetRegionAction = new QAction (tr ("Unset Region"), this); mUnsetRegionAction = new QAction (tr ("Unset Region"), this);
connect (mUnsetRegionAction, SIGNAL (triggered()), this, SLOT (unsetRegion())); connect (mUnsetRegionAction, &QAction::triggered, this, &RegionMap::unsetRegion);
addAction (mUnsetRegionAction); addAction (mUnsetRegionAction);
mViewAction = new QAction (tr ("View Cells"), this); mViewAction = new QAction (tr ("View Cells"), this);
connect (mViewAction, SIGNAL (triggered()), this, SLOT (view())); connect (mViewAction, &QAction::triggered, this, &RegionMap::view);
addAction (mViewAction); addAction (mViewAction);
mViewInTableAction = new QAction (tr ("View Cells in Table"), this); mViewInTableAction = new QAction (tr ("View Cells in Table"), this);
connect (mViewInTableAction, SIGNAL (triggered()), this, SLOT (viewInTable())); connect (mViewInTableAction, &QAction::triggered, this, &RegionMap::viewInTable);
addAction (mViewInTableAction); addAction (mViewInTableAction);
setAcceptDrops(true); setAcceptDrops(true);

View file

@ -10,8 +10,7 @@ CSVWorld::RegionMapSubView::RegionMapSubView (CSMWorld::UniversalId universalId,
setWidget (mRegionMap); setWidget (mRegionMap);
connect (mRegionMap, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)), connect (mRegionMap, &RegionMap::editRequest, this, &RegionMapSubView::editRequest);
this, SLOT (editRequest (const CSMWorld::UniversalId&, const std::string&)));
} }
void CSVWorld::RegionMapSubView::setEditLock (bool locked) void CSVWorld::RegionMapSubView::setEditLock (bool locked)

View file

@ -75,30 +75,32 @@ CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::D
void CSVWorld::SceneSubView::makeConnections (CSVRender::UnpagedWorldspaceWidget* widget) void CSVWorld::SceneSubView::makeConnections (CSVRender::UnpagedWorldspaceWidget* widget)
{ {
connect (widget, SIGNAL (closeRequest()), this, SLOT (closeRequest())); connect(widget, &CSVRender::UnpagedWorldspaceWidget::closeRequest,
this, qOverload<>(&SceneSubView::closeRequest));
connect(widget, SIGNAL(dataDropped(const std::vector<CSMWorld::UniversalId>&)), connect(widget, &CSVRender::UnpagedWorldspaceWidget::dataDropped,
this, SLOT(handleDrop(const std::vector<CSMWorld::UniversalId>&))); this, &SceneSubView::handleDrop);
connect(widget, SIGNAL(cellChanged(const CSMWorld::UniversalId&)), connect(widget, &CSVRender::UnpagedWorldspaceWidget::cellChanged,
this, SLOT(cellSelectionChanged(const CSMWorld::UniversalId&))); this, qOverload<const CSMWorld::UniversalId&>(&SceneSubView::cellSelectionChanged));
connect(widget, SIGNAL(requestFocus (const std::string&)), connect(widget, &CSVRender::UnpagedWorldspaceWidget::requestFocus,
this, SIGNAL(requestFocus (const std::string&))); this, &SceneSubView::requestFocus);
} }
void CSVWorld::SceneSubView::makeConnections (CSVRender::PagedWorldspaceWidget* widget) void CSVWorld::SceneSubView::makeConnections (CSVRender::PagedWorldspaceWidget* widget)
{ {
connect (widget, SIGNAL (closeRequest()), this, SLOT (closeRequest())); connect(widget, &CSVRender::PagedWorldspaceWidget::closeRequest,
this, qOverload<>(&SceneSubView::closeRequest));
connect(widget, SIGNAL(dataDropped(const std::vector<CSMWorld::UniversalId>&)), connect(widget, &CSVRender::PagedWorldspaceWidget::dataDropped,
this, SLOT(handleDrop(const std::vector<CSMWorld::UniversalId>&))); this, &SceneSubView::handleDrop);
connect (widget, SIGNAL (cellSelectionChanged (const CSMWorld::CellSelection&)), connect(widget, &CSVRender::PagedWorldspaceWidget::cellSelectionChanged,
this, SLOT (cellSelectionChanged (const CSMWorld::CellSelection&))); this, qOverload<const CSMWorld::CellSelection&>(&SceneSubView::cellSelectionChanged));
connect(widget, SIGNAL(requestFocus (const std::string&)), connect(widget, &CSVRender::PagedWorldspaceWidget::requestFocus,
this, SIGNAL(requestFocus (const std::string&))); this, &SceneSubView::requestFocus);
} }
CSVWidget::SceneToolbar* CSVWorld::SceneSubView::makeToolbar (CSVRender::WorldspaceWidget* widget, widgetType type) CSVWidget::SceneToolbar* CSVWorld::SceneSubView::makeToolbar (CSVRender::WorldspaceWidget* widget, widgetType type)
@ -244,8 +246,10 @@ void CSVWorld::SceneSubView::replaceToolbarAndWorldspace (CSVRender::WorldspaceW
mScene = widget; mScene = widget;
mToolbar = toolbar; mToolbar = toolbar;
connect (mScene, SIGNAL (focusToolbarRequest()), mToolbar, SLOT (setFocus())); connect (mScene, &CSVRender::WorldspaceWidget::focusToolbarRequest,
connect (mToolbar, SIGNAL (focusSceneRequest()), mScene, SLOT (setFocus())); mToolbar, qOverload<>(&CSVWidget::SceneToolbar::setFocus));
connect (mToolbar, &CSVWidget::SceneToolbar::focusSceneRequest,
mScene, qOverload<>(&CSVRender::WorldspaceWidget::setFocus));
mLayout->addWidget (mToolbar, 0); mLayout->addWidget (mToolbar, 0);
mLayout->addWidget (mScene, 1); mLayout->addWidget (mScene, 1);

View file

@ -88,26 +88,26 @@ CSVWorld::ScriptEdit::ScriptEdit(
<<CSMWorld::UniversalId::Type_Script <<CSMWorld::UniversalId::Type_Script
<<CSMWorld::UniversalId::Type_Region; <<CSMWorld::UniversalId::Type_Region;
connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(markOccurrences())); connect(this, &ScriptEdit::cursorPositionChanged, this, &ScriptEdit::markOccurrences);
mCommentAction = new QAction (tr ("Comment Selection"), this); mCommentAction = new QAction (tr ("Comment Selection"), this);
connect(mCommentAction, SIGNAL (triggered()), this, SLOT (commentSelection())); connect(mCommentAction, &QAction::triggered, this, &ScriptEdit::commentSelection);
CSMPrefs::Shortcut *commentShortcut = new CSMPrefs::Shortcut("script-editor-comment", this); CSMPrefs::Shortcut *commentShortcut = new CSMPrefs::Shortcut("script-editor-comment", this);
commentShortcut->associateAction(mCommentAction); commentShortcut->associateAction(mCommentAction);
mUncommentAction = new QAction (tr ("Uncomment Selection"), this); mUncommentAction = new QAction (tr ("Uncomment Selection"), this);
connect(mUncommentAction, SIGNAL (triggered()), this, SLOT (uncommentSelection())); connect(mUncommentAction, &QAction::triggered, this, &ScriptEdit::uncommentSelection);
CSMPrefs::Shortcut *uncommentShortcut = new CSMPrefs::Shortcut("script-editor-uncomment", this); CSMPrefs::Shortcut *uncommentShortcut = new CSMPrefs::Shortcut("script-editor-uncomment", this);
uncommentShortcut->associateAction(mUncommentAction); uncommentShortcut->associateAction(mUncommentAction);
mHighlighter = new ScriptHighlighter (document.getData(), mode, ScriptEdit::document()); mHighlighter = new ScriptHighlighter (document.getData(), mode, ScriptEdit::document());
connect (&document.getData(), SIGNAL (idListChanged()), this, SLOT (idListChanged())); connect (&document.getData(), &CSMWorld::Data::idListChanged, this, &ScriptEdit::idListChanged);
connect (&mUpdateTimer, SIGNAL (timeout()), this, SLOT (updateHighlighting())); connect (&mUpdateTimer, &QTimer::timeout, this, &ScriptEdit::updateHighlighting);
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &ScriptEdit::settingChanged);
{ {
ChangeLock lock (*this); ChangeLock lock (*this);
CSMPrefs::get()["Scripts"].update(); CSMPrefs::get()["Scripts"].update();
@ -121,8 +121,8 @@ CSVWorld::ScriptEdit::ScriptEdit(
mLineNumberArea = new LineNumberArea(this); mLineNumberArea = new LineNumberArea(this);
updateLineNumberAreaWidth(0); updateLineNumberAreaWidth(0);
connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberAreaWidth(int))); connect(this, &ScriptEdit::blockCountChanged, this, &ScriptEdit::updateLineNumberAreaWidth);
connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumberArea(QRect,int))); connect(this, &ScriptEdit::updateRequest, this, &ScriptEdit::updateLineNumberArea);
updateHighlighting(); updateHighlighting();
} }
@ -313,9 +313,9 @@ void CSVWorld::ScriptEdit::markOccurrences()
// prevent infinite recursion with cursor.select(), // prevent infinite recursion with cursor.select(),
// which ends up calling this function again // which ends up calling this function again
// could be fixed with blockSignals, but mDocument is const // could be fixed with blockSignals, but mDocument is const
disconnect(this, SIGNAL(cursorPositionChanged()), this, nullptr); disconnect(this, &ScriptEdit::cursorPositionChanged, this, nullptr);
cursor.select(QTextCursor::WordUnderCursor); cursor.select(QTextCursor::WordUnderCursor);
connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(markOccurrences())); connect(this, &ScriptEdit::cursorPositionChanged, this, &ScriptEdit::markOccurrences);
QString word = cursor.selectedText(); QString word = cursor.selectedText();
mHighlighter->setMarkedWord(word.toStdString()); mHighlighter->setMarkedWord(word.toStdString());

View file

@ -96,11 +96,11 @@ CSVWorld::ScriptErrorTable::ScriptErrorTable (const CSMDoc::Document& document,
Compiler::registerExtensions (mExtensions); Compiler::registerExtensions (mExtensions);
mContext.setExtensions (&mExtensions); mContext.setExtensions (&mExtensions);
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &ScriptErrorTable::settingChanged);
CSMPrefs::get()["Scripts"].update(); CSMPrefs::get()["Scripts"].update();
connect (this, SIGNAL (cellClicked (int, int)), this, SLOT (cellClicked (int, int))); connect (this, &QTableWidget::cellClicked, this, &ScriptErrorTable::cellClicked);
} }
void CSVWorld::ScriptErrorTable::update (const std::string& source) void CSVWorld::ScriptErrorTable::update (const std::string& source)

View file

@ -29,10 +29,9 @@ void CSVWorld::ScriptSubView::addButtonBar()
mLayout.insertWidget (1, mButtons); mLayout.insertWidget (1, mButtons);
connect (mButtons, SIGNAL (switchToRow (int)), this, SLOT (switchToRow (int))); connect (mButtons, &RecordButtonBar::switchToRow, this, &ScriptSubView::switchToRow);
connect (this, SIGNAL (universalIdChanged (const CSMWorld::UniversalId&)), connect (this, &ScriptSubView::universalIdChanged, mButtons, &RecordButtonBar::universalIdChanged);
mButtons, SLOT (universalIdChanged (const CSMWorld::UniversalId&)));
} }
void CSVWorld::ScriptSubView::recompile() void CSVWorld::ScriptSubView::recompile()
@ -124,36 +123,33 @@ CSVWorld::ScriptSubView::ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc:
// bottom box and buttons // bottom box and buttons
mBottom = new TableBottomBox (CreatorFactory<GenericCreator>(), document, id, this); mBottom = new TableBottomBox (CreatorFactory<GenericCreator>(), document, id, this);
connect (mBottom, SIGNAL (requestFocus (const std::string&)), connect (mBottom, &TableBottomBox::requestFocus, this, &ScriptSubView::switchToId);
this, SLOT (switchToId (const std::string&)));
mLayout.addWidget (mBottom); mLayout.addWidget (mBottom);
// signals // signals
connect (mEditor, SIGNAL (textChanged()), this, SLOT (textChanged())); connect (mEditor, &ScriptEdit::textChanged, this, &ScriptSubView::textChanged);
connect (mModel, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (mModel, &CSMWorld::IdTable::dataChanged, this, &ScriptSubView::dataChanged);
this, SLOT (dataChanged (const QModelIndex&, const QModelIndex&)));
connect (mModel, SIGNAL (rowsAboutToBeRemoved (const QModelIndex&, int, int)), connect (mModel, &CSMWorld::IdTable::rowsAboutToBeRemoved,
this, SLOT (rowsAboutToBeRemoved (const QModelIndex&, int, int))); this, &ScriptSubView::rowsAboutToBeRemoved);
updateStatusBar(); updateStatusBar();
connect(mEditor, SIGNAL(cursorPositionChanged()), this, SLOT(updateStatusBar())); connect(mEditor, &ScriptEdit::cursorPositionChanged, this, &ScriptSubView::updateStatusBar);
mErrors->update (source.toUtf8().constData()); mErrors->update (source.toUtf8().constData());
connect (mErrors, SIGNAL (highlightError (int, int)), connect (mErrors, &ScriptErrorTable::highlightError, this, &ScriptSubView::highlightError);
this, SLOT (highlightError (int, int)));
mCompileDelay = new QTimer (this); mCompileDelay = new QTimer (this);
mCompileDelay->setSingleShot (true); mCompileDelay->setSingleShot (true);
connect (mCompileDelay, SIGNAL (timeout()), this, SLOT (updateRequest())); connect (mCompileDelay, &QTimer::timeout, this, &ScriptSubView::updateRequest);
updateDeletedState(); updateDeletedState();
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &ScriptSubView::settingChanged);
CSMPrefs::get()["Scripts"].update(); CSMPrefs::get()["Scripts"].update();
} }

View file

@ -44,7 +44,7 @@ CSVWorld::StartScriptCreator::StartScriptCreator(
mScript->setCompleter(completionManager.getCompleter(displayType).get()); mScript->setCompleter(completionManager.getCompleter(displayType).get());
insertBeforeButtons(mScript, true); insertBeforeButtons(mScript, true);
connect(mScript, SIGNAL (textChanged(const QString&)), this, SLOT (scriptChanged())); connect(mScript, &CSVWidget::DropLineEdit::textChanged, this, &StartScriptCreator::scriptChanged);
connect(mScript, SIGNAL (returnPressed()), this, SLOT (inputReturnPressed())); connect(mScript, SIGNAL (returnPressed()), this, SLOT (inputReturnPressed()));
} }

View file

@ -299,7 +299,7 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
setSortingEnabled (sorting); setSortingEnabled (sorting);
mEditAction = new QAction (tr ("Edit Record"), this); mEditAction = new QAction (tr ("Edit Record"), this);
connect (mEditAction, SIGNAL (triggered()), this, SLOT (editRecord())); connect (mEditAction, &QAction::triggered, this, &Table::editRecord);
mEditAction->setIcon(QIcon(":edit-edit")); mEditAction->setIcon(QIcon(":edit-edit"));
addAction (mEditAction); addAction (mEditAction);
CSMPrefs::Shortcut* editShortcut = new CSMPrefs::Shortcut("table-edit", this); CSMPrefs::Shortcut* editShortcut = new CSMPrefs::Shortcut("table-edit", this);
@ -308,14 +308,14 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
if (createAndDelete) if (createAndDelete)
{ {
mCreateAction = new QAction (tr ("Add Record"), this); mCreateAction = new QAction (tr ("Add Record"), this);
connect (mCreateAction, SIGNAL (triggered()), this, SIGNAL (createRequest())); connect (mCreateAction, &QAction::triggered, this, &Table::createRequest);
mCreateAction->setIcon(QIcon(":edit-add")); mCreateAction->setIcon(QIcon(":edit-add"));
addAction (mCreateAction); addAction (mCreateAction);
CSMPrefs::Shortcut* createShortcut = new CSMPrefs::Shortcut("table-add", this); CSMPrefs::Shortcut* createShortcut = new CSMPrefs::Shortcut("table-add", this);
createShortcut->associateAction(mCreateAction); createShortcut->associateAction(mCreateAction);
mCloneAction = new QAction (tr ("Clone Record"), this); mCloneAction = new QAction (tr ("Clone Record"), this);
connect(mCloneAction, SIGNAL (triggered()), this, SLOT (cloneRecord())); connect(mCloneAction, &QAction::triggered, this, &Table::cloneRecord);
mCloneAction->setIcon(QIcon(":edit-clone")); mCloneAction->setIcon(QIcon(":edit-clone"));
addAction(mCloneAction); addAction(mCloneAction);
CSMPrefs::Shortcut* cloneShortcut = new CSMPrefs::Shortcut("table-clone", this); CSMPrefs::Shortcut* cloneShortcut = new CSMPrefs::Shortcut("table-clone", this);
@ -325,7 +325,7 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
if (mModel->getFeatures() & CSMWorld::IdTableBase::Feature_AllowTouch) if (mModel->getFeatures() & CSMWorld::IdTableBase::Feature_AllowTouch)
{ {
mTouchAction = new QAction(tr("Touch Record"), this); mTouchAction = new QAction(tr("Touch Record"), this);
connect(mTouchAction, SIGNAL(triggered()), this, SLOT(touchRecord())); connect(mTouchAction, &QAction::triggered, this, &Table::touchRecord);
mTouchAction->setIcon(QIcon(":edit-touch")); mTouchAction->setIcon(QIcon(":edit-touch"));
addAction(mTouchAction); addAction(mTouchAction);
CSMPrefs::Shortcut* touchShortcut = new CSMPrefs::Shortcut("table-touch", this); CSMPrefs::Shortcut* touchShortcut = new CSMPrefs::Shortcut("table-touch", this);
@ -333,85 +333,85 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
} }
mRevertAction = new QAction (tr ("Revert Record"), this); mRevertAction = new QAction (tr ("Revert Record"), this);
connect (mRevertAction, SIGNAL (triggered()), mDispatcher, SLOT (executeRevert())); connect (mRevertAction, &QAction::triggered, mDispatcher, &CSMWorld::CommandDispatcher::executeRevert);
mRevertAction->setIcon(QIcon(":edit-undo")); mRevertAction->setIcon(QIcon(":edit-undo"));
addAction (mRevertAction); addAction (mRevertAction);
CSMPrefs::Shortcut* revertShortcut = new CSMPrefs::Shortcut("table-revert", this); CSMPrefs::Shortcut* revertShortcut = new CSMPrefs::Shortcut("table-revert", this);
revertShortcut->associateAction(mRevertAction); revertShortcut->associateAction(mRevertAction);
mDeleteAction = new QAction (tr ("Delete Record"), this); mDeleteAction = new QAction (tr ("Delete Record"), this);
connect (mDeleteAction, SIGNAL (triggered()), mDispatcher, SLOT (executeDelete())); connect (mDeleteAction, &QAction::triggered, mDispatcher, &CSMWorld::CommandDispatcher::executeDelete);
mDeleteAction->setIcon(QIcon(":edit-delete")); mDeleteAction->setIcon(QIcon(":edit-delete"));
addAction (mDeleteAction); addAction (mDeleteAction);
CSMPrefs::Shortcut* deleteShortcut = new CSMPrefs::Shortcut("table-remove", this); CSMPrefs::Shortcut* deleteShortcut = new CSMPrefs::Shortcut("table-remove", this);
deleteShortcut->associateAction(mDeleteAction); deleteShortcut->associateAction(mDeleteAction);
mMoveUpAction = new QAction (tr ("Move Up"), this); mMoveUpAction = new QAction (tr ("Move Up"), this);
connect (mMoveUpAction, SIGNAL (triggered()), this, SLOT (moveUpRecord())); connect (mMoveUpAction, &QAction::triggered, this, &Table::moveUpRecord);
mMoveUpAction->setIcon(QIcon(":record-up")); mMoveUpAction->setIcon(QIcon(":record-up"));
addAction (mMoveUpAction); addAction (mMoveUpAction);
CSMPrefs::Shortcut* moveUpShortcut = new CSMPrefs::Shortcut("table-moveup", this); CSMPrefs::Shortcut* moveUpShortcut = new CSMPrefs::Shortcut("table-moveup", this);
moveUpShortcut->associateAction(mMoveUpAction); moveUpShortcut->associateAction(mMoveUpAction);
mMoveDownAction = new QAction (tr ("Move Down"), this); mMoveDownAction = new QAction (tr ("Move Down"), this);
connect (mMoveDownAction, SIGNAL (triggered()), this, SLOT (moveDownRecord())); connect (mMoveDownAction, &QAction::triggered, this, &Table::moveDownRecord);
mMoveDownAction->setIcon(QIcon(":record-down")); mMoveDownAction->setIcon(QIcon(":record-down"));
addAction (mMoveDownAction); addAction (mMoveDownAction);
CSMPrefs::Shortcut* moveDownShortcut = new CSMPrefs::Shortcut("table-movedown", this); CSMPrefs::Shortcut* moveDownShortcut = new CSMPrefs::Shortcut("table-movedown", this);
moveDownShortcut->associateAction(mMoveDownAction); moveDownShortcut->associateAction(mMoveDownAction);
mViewAction = new QAction (tr ("View"), this); mViewAction = new QAction (tr ("View"), this);
connect (mViewAction, SIGNAL (triggered()), this, SLOT (viewRecord())); connect (mViewAction, &QAction::triggered, this, &Table::viewRecord);
mViewAction->setIcon(QIcon(":/cell.png")); mViewAction->setIcon(QIcon(":/cell.png"));
addAction (mViewAction); addAction (mViewAction);
CSMPrefs::Shortcut* viewShortcut = new CSMPrefs::Shortcut("table-view", this); CSMPrefs::Shortcut* viewShortcut = new CSMPrefs::Shortcut("table-view", this);
viewShortcut->associateAction(mViewAction); viewShortcut->associateAction(mViewAction);
mPreviewAction = new QAction (tr ("Preview"), this); mPreviewAction = new QAction (tr ("Preview"), this);
connect (mPreviewAction, SIGNAL (triggered()), this, SLOT (previewRecord())); connect (mPreviewAction, &QAction::triggered, this, &Table::previewRecord);
mPreviewAction->setIcon(QIcon(":edit-preview")); mPreviewAction->setIcon(QIcon(":edit-preview"));
addAction (mPreviewAction); addAction (mPreviewAction);
CSMPrefs::Shortcut* previewShortcut = new CSMPrefs::Shortcut("table-preview", this); CSMPrefs::Shortcut* previewShortcut = new CSMPrefs::Shortcut("table-preview", this);
previewShortcut->associateAction(mPreviewAction); previewShortcut->associateAction(mPreviewAction);
mExtendedDeleteAction = new QAction (tr ("Extended Delete Record"), this); mExtendedDeleteAction = new QAction (tr ("Extended Delete Record"), this);
connect (mExtendedDeleteAction, SIGNAL (triggered()), this, SLOT (executeExtendedDelete())); connect (mExtendedDeleteAction, &QAction::triggered, this, &Table::executeExtendedDelete);
mExtendedDeleteAction->setIcon(QIcon(":edit-delete")); mExtendedDeleteAction->setIcon(QIcon(":edit-delete"));
addAction (mExtendedDeleteAction); addAction (mExtendedDeleteAction);
CSMPrefs::Shortcut* extendedDeleteShortcut = new CSMPrefs::Shortcut("table-extendeddelete", this); CSMPrefs::Shortcut* extendedDeleteShortcut = new CSMPrefs::Shortcut("table-extendeddelete", this);
extendedDeleteShortcut->associateAction(mExtendedDeleteAction); extendedDeleteShortcut->associateAction(mExtendedDeleteAction);
mExtendedRevertAction = new QAction (tr ("Extended Revert Record"), this); mExtendedRevertAction = new QAction (tr ("Extended Revert Record"), this);
connect (mExtendedRevertAction, SIGNAL (triggered()), this, SLOT (executeExtendedRevert())); connect (mExtendedRevertAction, &QAction::triggered, this, &Table::executeExtendedRevert);
mExtendedRevertAction->setIcon(QIcon(":edit-undo")); mExtendedRevertAction->setIcon(QIcon(":edit-undo"));
addAction (mExtendedRevertAction); addAction (mExtendedRevertAction);
CSMPrefs::Shortcut* extendedRevertShortcut = new CSMPrefs::Shortcut("table-extendedrevert", this); CSMPrefs::Shortcut* extendedRevertShortcut = new CSMPrefs::Shortcut("table-extendedrevert", this);
extendedRevertShortcut->associateAction(mExtendedRevertAction); extendedRevertShortcut->associateAction(mExtendedRevertAction);
mEditIdAction = new TableEditIdAction (*this, this); mEditIdAction = new TableEditIdAction (*this, this);
connect (mEditIdAction, SIGNAL (triggered()), this, SLOT (editCell())); connect (mEditIdAction, &QAction::triggered, this, &Table::editCell);
addAction (mEditIdAction); addAction (mEditIdAction);
mHelpAction = new QAction (tr ("Help"), this); mHelpAction = new QAction (tr ("Help"), this);
connect (mHelpAction, SIGNAL (triggered()), this, SLOT (openHelp())); connect (mHelpAction, &QAction::triggered, this, &Table::openHelp);
mHelpAction->setIcon(QIcon(":/info.png")); mHelpAction->setIcon(QIcon(":/info.png"));
addAction (mHelpAction); addAction (mHelpAction);
CSMPrefs::Shortcut* openHelpShortcut = new CSMPrefs::Shortcut("help", this); CSMPrefs::Shortcut* openHelpShortcut = new CSMPrefs::Shortcut("help", this);
openHelpShortcut->associateAction(mHelpAction); openHelpShortcut->associateAction(mHelpAction);
connect (mProxyModel, SIGNAL (rowsRemoved (const QModelIndex&, int, int)), connect (mProxyModel, &CSMWorld::IdTableProxyModel::rowsRemoved,
this, SLOT (tableSizeUpdate())); this, &Table::tableSizeUpdate);
connect (mProxyModel, SIGNAL (rowAdded (const std::string &)), connect (mProxyModel, &CSMWorld::IdTableProxyModel::rowAdded,
this, SLOT (rowAdded (const std::string &))); this, &Table::rowAdded);
/// \note This signal could instead be connected to a slot that filters out changes not affecting /// \note This signal could instead be connected to a slot that filters out changes not affecting
/// the records status column (for permanence reasons) /// the records status column (for permanence reasons)
connect (mProxyModel, SIGNAL (dataChanged (const QModelIndex&, const QModelIndex&)), connect (mProxyModel, &CSMWorld::IdTableProxyModel::dataChanged,
this, SLOT (dataChangedEvent(const QModelIndex&, const QModelIndex&))); this, &Table::dataChangedEvent);
connect (selectionModel(), SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)), connect (selectionModel(), &QItemSelectionModel::selectionChanged,
this, SLOT (selectionSizeUpdate ())); this, &Table::selectionSizeUpdate);
setAcceptDrops(true); setAcceptDrops(true);
@ -420,8 +420,8 @@ CSVWorld::Table::Table (const CSMWorld::UniversalId& id,
mDoubleClickActions.insert (std::make_pair (Qt::ControlModifier, Action_View)); mDoubleClickActions.insert (std::make_pair (Qt::ControlModifier, Action_View));
mDoubleClickActions.insert (std::make_pair (Qt::ShiftModifier | Qt::ControlModifier, Action_EditRecordAndClose)); mDoubleClickActions.insert (std::make_pair (Qt::ShiftModifier | Qt::ControlModifier, Action_EditRecordAndClose));
connect (&CSMPrefs::State::get(), SIGNAL (settingChanged (const CSMPrefs::Setting *)), connect (&CSMPrefs::State::get(), &CSMPrefs::State::settingChanged,
this, SLOT (settingChanged (const CSMPrefs::Setting *))); this, &Table::settingChanged);
CSMPrefs::get()["ID Tables"].update(); CSMPrefs::get()["ID Tables"].update();
new TableHeaderMouseEventHandler(this); new TableHeaderMouseEventHandler(this);

View file

@ -91,7 +91,7 @@ CSVWorld::TableBottomBox::TableBottomBox (const CreatorFactoryBase& creatorFacto
mLayout = new QStackedLayout; mLayout = new QStackedLayout;
mLayout->setContentsMargins (0, 0, 0, 0); mLayout->setContentsMargins (0, 0, 0, 0);
connect (mLayout, SIGNAL (currentChanged (int)), this, SLOT (currentWidgetChanged (int))); connect (mLayout, &QStackedLayout::currentChanged, this, &TableBottomBox::currentWidgetChanged);
mStatus = new QLabel; mStatus = new QLabel;
@ -110,16 +110,16 @@ CSVWorld::TableBottomBox::TableBottomBox (const CreatorFactoryBase& creatorFacto
mCreator->installEventFilter(this); mCreator->installEventFilter(this);
mLayout->addWidget (mCreator); mLayout->addWidget (mCreator);
connect (mCreator, SIGNAL (done()), this, SLOT (requestDone())); connect (mCreator, &Creator::done, this, &TableBottomBox::requestDone);
connect (mCreator, SIGNAL (requestFocus (const std::string&)), connect (mCreator, &Creator::requestFocus, this, &TableBottomBox::requestFocus);
this, SIGNAL (requestFocus (const std::string&)));
} }
mExtendedConfigurator = new ExtendedCommandConfigurator (document, id, this); mExtendedConfigurator = new ExtendedCommandConfigurator (document, id, this);
mExtendedConfigurator->installEventFilter(this); mExtendedConfigurator->installEventFilter(this);
mLayout->addWidget (mExtendedConfigurator); mLayout->addWidget (mExtendedConfigurator);
connect (mExtendedConfigurator, SIGNAL (done()), this, SLOT (requestDone())); connect (mExtendedConfigurator, &ExtendedCommandConfigurator::done,
this, &TableBottomBox::requestDone);
updateSize(); updateSize();
} }

View file

@ -44,7 +44,7 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
"\nCan be useful in finding the moved or modified" "\nCan be useful in finding the moved or modified"
"\nobject instance while 3D editing."); "\nobject instance while 3D editing.");
autoJump->setCheckState(Qt::Unchecked); autoJump->setCheckState(Qt::Unchecked);
connect(autoJump, SIGNAL (stateChanged(int)), mTable, SLOT (jumpAfterModChanged(int))); connect(autoJump, &QCheckBox::stateChanged, mTable, &Table::jumpAfterModChanged);
optHLayout->insertWidget(0, autoJump); optHLayout->insertWidget(0, autoJump);
optHLayout->setContentsMargins (QMargins (0, 3, 0, 0)); optHLayout->setContentsMargins (QMargins (0, 3, 0, 0));
mOptions->setLayout(optHLayout); mOptions->setLayout(optHLayout);
@ -55,7 +55,7 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
opt->setIcon (QIcon (":startup/configure")); opt->setIcon (QIcon (":startup/configure"));
opt->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed)); opt->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed));
opt->setToolTip ("Open additional options for this subview."); opt->setToolTip ("Open additional options for this subview.");
connect (opt, SIGNAL (clicked()), this, SLOT (toggleOptions())); connect (opt, &QPushButton::clicked, this, &TableSubView::toggleOptions);
QVBoxLayout *buttonLayout = new QVBoxLayout; // work around margin issues QVBoxLayout *buttonLayout = new QVBoxLayout; // work around margin issues
buttonLayout->setContentsMargins (QMargins (0/*left*/, 3/*top*/, 3/*right*/, 0/*bottom*/)); buttonLayout->setContentsMargins (QMargins (0/*left*/, 3/*top*/, 3/*right*/, 0/*bottom*/));
@ -78,13 +78,10 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
frameHeight = topLevel->frameGeometry().height() - topLevel->height(); frameHeight = topLevel->frameGeometry().height() - topLevel->height();
widget->setSizeHint(QSize(mTable->horizontalHeader()->length(), rect.height()-frameHeight)); widget->setSizeHint(QSize(mTable->horizontalHeader()->length(), rect.height()-frameHeight));
connect (mTable, SIGNAL (editRequest (const CSMWorld::UniversalId&, const std::string&)), connect (mTable, &Table::editRequest, this, &TableSubView::editRequest);
this, SLOT (editRequest (const CSMWorld::UniversalId&, const std::string&)));
connect (mTable, SIGNAL (selectionSizeChanged (int)), connect (mTable, &Table::selectionSizeChanged, mBottom, &TableBottomBox::selectionSizeChanged);
mBottom, SLOT (selectionSizeChanged (int))); connect (mTable, &Table::tableSizeChanged, mBottom, &TableBottomBox::tableSizeChanged);
connect (mTable, SIGNAL (tableSizeChanged (int, int, int)),
mBottom, SLOT (tableSizeChanged (int, int, int)));
mTable->tableSizeUpdate(); mTable->tableSizeUpdate();
mTable->selectionSizeUpdate(); mTable->selectionSizeUpdate();
@ -94,33 +91,33 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
if (mBottom->canCreateAndDelete()) if (mBottom->canCreateAndDelete())
{ {
connect (mTable, SIGNAL (createRequest()), mBottom, SLOT (createRequest())); connect (mTable, &Table::createRequest, mBottom, &TableBottomBox::createRequest);
connect (mTable, SIGNAL (cloneRequest(const CSMWorld::UniversalId&)), this, connect (mTable, &Table::cloneRequest,
SLOT(cloneRequest(const CSMWorld::UniversalId&))); this, qOverload<const CSMWorld::UniversalId&>(&TableSubView::cloneRequest));
connect (this, SIGNAL(cloneRequest(const std::string&, const CSMWorld::UniversalId::Type)), connect (this,
mBottom, SLOT(cloneRequest(const std::string&, const CSMWorld::UniversalId::Type))); qOverload<const std::string&,const CSMWorld::UniversalId::Type>(&TableSubView::cloneRequest),
mBottom, &TableBottomBox::cloneRequest);
connect (mTable, SIGNAL(touchRequest(const std::vector<CSMWorld::UniversalId>&)), connect (mTable, &Table::touchRequest,
mBottom, SLOT(touchRequest(const std::vector<CSMWorld::UniversalId>&))); mBottom, &TableBottomBox::touchRequest);
connect (mTable, SIGNAL(extendedDeleteConfigRequest(const std::vector<std::string> &)), connect (mTable, &Table::extendedDeleteConfigRequest,
mBottom, SLOT(extendedDeleteConfigRequest(const std::vector<std::string> &))); mBottom, &TableBottomBox::extendedDeleteConfigRequest);
connect (mTable, SIGNAL(extendedRevertConfigRequest(const std::vector<std::string> &)), connect (mTable, &Table::extendedRevertConfigRequest,
mBottom, SLOT(extendedRevertConfigRequest(const std::vector<std::string> &))); mBottom, &TableBottomBox::extendedRevertConfigRequest);
} }
connect (mBottom, SIGNAL (requestFocus (const std::string&)), connect (mBottom, &TableBottomBox::requestFocus, mTable, &Table::requestFocus);
mTable, SLOT (requestFocus (const std::string&)));
connect (mFilterBox, connect (mFilterBox, &CSVFilter::FilterBox::recordFilterChanged,
SIGNAL (recordFilterChanged (std::shared_ptr<CSMFilter::Node>)), mTable, &Table::recordFilterChanged);
mTable, SLOT (recordFilterChanged (std::shared_ptr<CSMFilter::Node>)));
connect(mFilterBox, SIGNAL(recordDropped(std::vector<CSMWorld::UniversalId>&, Qt::DropAction)), connect(mFilterBox, &CSVFilter::FilterBox::recordDropped,
this, SLOT(createFilterRequest(std::vector<CSMWorld::UniversalId>&, Qt::DropAction))); this, &TableSubView::createFilterRequest);
connect (mTable, SIGNAL (closeRequest()), this, SLOT (closeRequest()));
connect (mTable, &Table::closeRequest, this, qOverload<>(&TableSubView::closeRequest));
} }
void CSVWorld::TableSubView::setEditLock (bool locked) void CSVWorld::TableSubView::setEditLock (bool locked)