forked from qt-creator/qt-creator
Utils: Modernize connections
Change-Id: I4650abc84e7c82a4054197319f6c849af9e5b8ce Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -121,10 +121,10 @@ CheckableMessageBox::CheckableMessageBox(QWidget *parent) :
|
||||
{
|
||||
setModal(true);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
connect(d->buttonBox, SIGNAL(accepted()), SLOT(accept()));
|
||||
connect(d->buttonBox, SIGNAL(rejected()), SLOT(reject()));
|
||||
connect(d->buttonBox, SIGNAL(clicked(QAbstractButton*)),
|
||||
SLOT(slotClicked(QAbstractButton*)));
|
||||
connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
connect(d->buttonBox, &QDialogButtonBox::clicked,
|
||||
this, [this](QAbstractButton *b) { d->clickedButton = b; });
|
||||
}
|
||||
|
||||
CheckableMessageBox::~CheckableMessageBox()
|
||||
@@ -132,11 +132,6 @@ CheckableMessageBox::~CheckableMessageBox()
|
||||
delete d;
|
||||
}
|
||||
|
||||
void CheckableMessageBox::slotClicked(QAbstractButton *b)
|
||||
{
|
||||
d->clickedButton = b;
|
||||
}
|
||||
|
||||
QAbstractButton *CheckableMessageBox::clickedButton() const
|
||||
{
|
||||
return d->clickedButton;
|
||||
|
@@ -130,9 +130,6 @@ public:
|
||||
static QString msgDoNotAskAgain();
|
||||
static QString msgDoNotShowAgain();
|
||||
|
||||
private slots:
|
||||
void slotClicked(QAbstractButton *b);
|
||||
|
||||
private:
|
||||
CheckableMessageBoxPrivate *d;
|
||||
};
|
||||
|
@@ -121,7 +121,8 @@ void CompletingTextEdit::setCompleter(QCompleter *c)
|
||||
|
||||
completer()->setWidget(this);
|
||||
completer()->setCompletionMode(QCompleter::PopupCompletion);
|
||||
connect(completer(), SIGNAL(activated(QString)), this, SLOT(insertCompletion(QString)));
|
||||
connect(completer(), static_cast<void (QCompleter::*)(const QString &)>(&QCompleter::activated),
|
||||
this, [this](const QString &str) { d->insertCompletion(str); });
|
||||
}
|
||||
|
||||
QCompleter *CompletingTextEdit::completer() const
|
||||
|
@@ -65,7 +65,6 @@ protected:
|
||||
|
||||
private:
|
||||
class CompletingTextEditPrivate *d;
|
||||
Q_PRIVATE_SLOT(d, void insertCompletion(const QString &))
|
||||
};
|
||||
|
||||
} // namespace Utils
|
||||
|
@@ -62,7 +62,8 @@ ConsoleProcessPrivate::ConsoleProcessPrivate() :
|
||||
ConsoleProcess::ConsoleProcess(QObject *parent) :
|
||||
QObject(parent), d(new ConsoleProcessPrivate)
|
||||
{
|
||||
connect(&d->m_stubServer, SIGNAL(newConnection()), SLOT(stubConnectionAvailable()));
|
||||
connect(&d->m_stubServer, &QLocalServer::newConnection,
|
||||
this, &ConsoleProcess::stubConnectionAvailable);
|
||||
|
||||
d->m_process.setProcessChannelMode(QProcess::ForwardedChannels);
|
||||
}
|
||||
@@ -177,7 +178,7 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
|
||||
return false;
|
||||
}
|
||||
d->m_stubConnectTimer = new QTimer(this);
|
||||
connect(d->m_stubConnectTimer, SIGNAL(timeout()), SLOT(stop()));
|
||||
connect(d->m_stubConnectTimer, &QTimer::timeout, this, &ConsoleProcess::stop);
|
||||
d->m_stubConnectTimer->setSingleShot(true);
|
||||
d->m_stubConnectTimer->start(10000);
|
||||
d->m_executable = program;
|
||||
@@ -282,8 +283,8 @@ void ConsoleProcess::stubConnectionAvailable()
|
||||
d->m_stubConnected = true;
|
||||
emit stubStarted();
|
||||
d->m_stubSocket = d->m_stubServer.nextPendingConnection();
|
||||
connect(d->m_stubSocket, SIGNAL(readyRead()), SLOT(readStubOutput()));
|
||||
connect(d->m_stubSocket, SIGNAL(disconnected()), SLOT(stubExited()));
|
||||
connect(d->m_stubSocket, &QIODevice::readyRead, this, &ConsoleProcess::readStubOutput);
|
||||
connect(d->m_stubSocket, &QLocalSocket::disconnected, this, &ConsoleProcess::stubExited);
|
||||
}
|
||||
|
||||
static QString errorMsg(int code)
|
||||
|
@@ -58,7 +58,8 @@ ConsoleProcessPrivate::ConsoleProcessPrivate() :
|
||||
ConsoleProcess::ConsoleProcess(QObject *parent) :
|
||||
QObject(parent), d(new ConsoleProcessPrivate)
|
||||
{
|
||||
connect(&d->m_stubServer, SIGNAL(newConnection()), SLOT(stubConnectionAvailable()));
|
||||
connect(&d->m_stubServer, &QLocalServer::newConnection,
|
||||
this, &ConsoleProcess::stubConnectionAvailable);
|
||||
}
|
||||
|
||||
qint64 ConsoleProcess::applicationMainThreadID() const
|
||||
@@ -156,7 +157,8 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
|
||||
}
|
||||
|
||||
d->processFinishedNotifier = new QWinEventNotifier(d->m_pid->hProcess, this);
|
||||
connect(d->processFinishedNotifier, SIGNAL(activated(HANDLE)), SLOT(stubExited()));
|
||||
connect(d->processFinishedNotifier, &QWinEventNotifier::activated,
|
||||
this, &ConsoleProcess::stubExited);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -210,7 +212,7 @@ void ConsoleProcess::stubConnectionAvailable()
|
||||
{
|
||||
emit stubStarted();
|
||||
d->m_stubSocket = d->m_stubServer.nextPendingConnection();
|
||||
connect(d->m_stubSocket, SIGNAL(readyRead()), SLOT(readStubOutput()));
|
||||
connect(d->m_stubSocket, &QIODevice::readyRead, this, &ConsoleProcess::readStubOutput);
|
||||
}
|
||||
|
||||
void ConsoleProcess::readStubOutput()
|
||||
@@ -240,7 +242,8 @@ void ConsoleProcess::readStubOutput()
|
||||
continue;
|
||||
}
|
||||
d->inferiorFinishedNotifier = new QWinEventNotifier(d->m_hInferior, this);
|
||||
connect(d->inferiorFinishedNotifier, SIGNAL(activated(HANDLE)), SLOT(inferiorExited()));
|
||||
connect(d->inferiorFinishedNotifier, &QWinEventNotifier::activated,
|
||||
this, &ConsoleProcess::inferiorExited);
|
||||
emit processStarted();
|
||||
} else {
|
||||
emitError(QProcess::UnknownError, msgUnexpectedOutput(out));
|
||||
|
@@ -310,7 +310,7 @@ void CrumblePath::pushElement(const QString &title, const QVariant &data)
|
||||
{
|
||||
CrumblePathButton *newButton = new CrumblePathButton(title, this);
|
||||
newButton->hide();
|
||||
connect(newButton, SIGNAL(clicked()), SLOT(emitElementClicked()));
|
||||
connect(newButton, &QAbstractButton::clicked, this, &CrumblePath::emitElementClicked);
|
||||
|
||||
int segType = CrumblePathButton::MiddleSegment;
|
||||
if (!d->m_buttons.isEmpty()) {
|
||||
@@ -339,7 +339,7 @@ void CrumblePath::addChild(const QString &title, const QVariant &data)
|
||||
|
||||
QAction *childAction = new QAction(title, lastButton);
|
||||
childAction->setData(data);
|
||||
connect(childAction, SIGNAL(triggered()), this, SLOT(emitElementClicked()));
|
||||
connect(childAction, &QAction::triggered, this, &CrumblePath::emitElementClicked);
|
||||
childList->addAction(childAction);
|
||||
lastButton->setMenu(childList);
|
||||
}
|
||||
|
@@ -209,12 +209,12 @@ DetailsWidget::DetailsWidget(QWidget *parent) :
|
||||
|
||||
setUseCheckBox(false);
|
||||
|
||||
connect(d->m_detailsButton, SIGNAL(toggled(bool)),
|
||||
this, SLOT(setExpanded(bool)));
|
||||
connect(d->m_summaryCheckBox, SIGNAL(toggled(bool)),
|
||||
this, SIGNAL(checked(bool)));
|
||||
connect(d->m_summaryLabel, SIGNAL(linkActivated(QString)),
|
||||
this, SIGNAL(linkActivated(QString)));
|
||||
connect(d->m_detailsButton, &QAbstractButton::toggled,
|
||||
this, &DetailsWidget::setExpanded);
|
||||
connect(d->m_summaryCheckBox, &QAbstractButton::toggled,
|
||||
this, &DetailsWidget::checked);
|
||||
connect(d->m_summaryLabel, &QLabel::linkActivated,
|
||||
this, &DetailsWidget::linkActivated);
|
||||
d->updateControls();
|
||||
}
|
||||
|
||||
|
@@ -112,7 +112,7 @@ private slots:
|
||||
QPropertyAnimation *anim = new QPropertyAnimation(m_effect, "opacity", this);
|
||||
anim->setDuration(200);
|
||||
anim->setEndValue(0.);
|
||||
connect(anim, SIGNAL(finished()), this, SLOT(deleteLater()));
|
||||
connect(anim, &QAbstractAnimation::finished, this, &QObject::deleteLater);
|
||||
anim->start(QAbstractAnimation::DeleteWhenStopped);
|
||||
}
|
||||
|
||||
|
@@ -165,9 +165,9 @@ FancyLineEdit::FancyLineEdit(QWidget *parent) :
|
||||
ensurePolished();
|
||||
updateMargins();
|
||||
|
||||
connect(d->m_iconbutton[Left], SIGNAL(clicked()), this, SLOT(iconClicked()));
|
||||
connect(d->m_iconbutton[Right], SIGNAL(clicked()), this, SLOT(iconClicked()));
|
||||
connect(this, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged(QString)));
|
||||
connect(d->m_iconbutton[Left], &QAbstractButton::clicked, this, &FancyLineEdit::iconClicked);
|
||||
connect(d->m_iconbutton[Right], &QAbstractButton::clicked, this, &FancyLineEdit::iconClicked);
|
||||
connect(this, &QLineEdit::textChanged, this, &FancyLineEdit::onTextChanged);
|
||||
}
|
||||
|
||||
FancyLineEdit::~FancyLineEdit()
|
||||
@@ -316,8 +316,8 @@ void FancyLineEdit::setHistoryCompleter(const QString &historyKey, bool restoreL
|
||||
// being emitted and more updates finally calling setText() (again).
|
||||
// To make sure we report the "final" content delay the addEntry()
|
||||
// "a bit".
|
||||
connect(this, SIGNAL(editingFinished()),
|
||||
this, SLOT(onEditingFinished()), Qt::QueuedConnection);
|
||||
connect(this, &QLineEdit::editingFinished,
|
||||
this, &FancyLineEdit::onEditingFinished, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void FancyLineEdit::onEditingFinished()
|
||||
@@ -371,9 +371,9 @@ void FancyLineEdit::setFiltering(bool on)
|
||||
setPlaceholderText(tr("Filter"));
|
||||
setButtonToolTip(Right, tr("Clear text"));
|
||||
setAutoHideButton(Right, true);
|
||||
connect(this, SIGNAL(rightButtonClicked()), this, SLOT(clear()));
|
||||
connect(this, &FancyLineEdit::rightButtonClicked, this, &QLineEdit::clear);
|
||||
} else {
|
||||
disconnect(this, SIGNAL(rightButtonClicked()), this, SLOT(clear()));
|
||||
disconnect(this, &FancyLineEdit::rightButtonClicked, this, &QLineEdit::clear);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -462,10 +462,8 @@ void FancyLineEdit::onTextChanged(const QString &t)
|
||||
d->m_state = newState;
|
||||
d->m_firstChange = false;
|
||||
setTextColor(this, newState == Invalid ? d->m_errorTextColor : d->m_okTextColor);
|
||||
if (validHasChanged) {
|
||||
if (validHasChanged)
|
||||
emit validChanged(newState == Valid);
|
||||
emit validChanged();
|
||||
}
|
||||
}
|
||||
bool block = blockSignals(true);
|
||||
const QString fixedString = fixInputString(t);
|
||||
|
@@ -156,7 +156,6 @@ signals:
|
||||
|
||||
void filterChanged(const QString &);
|
||||
|
||||
void validChanged();
|
||||
void validChanged(bool validState);
|
||||
void validReturnPressed();
|
||||
|
||||
|
@@ -198,10 +198,10 @@ void FileSystemWatcher::init()
|
||||
qDebug() << this << "Created watcher for id " << d->m_id;
|
||||
}
|
||||
++(d->m_staticData->m_objectCount);
|
||||
connect(d->m_staticData->m_watcher, SIGNAL(fileChanged(QString)),
|
||||
this, SLOT(slotFileChanged(QString)));
|
||||
connect(d->m_staticData->m_watcher, SIGNAL(directoryChanged(QString)),
|
||||
this, SLOT(slotDirectoryChanged(QString)));
|
||||
connect(d->m_staticData->m_watcher, &QFileSystemWatcher::fileChanged,
|
||||
this, &FileSystemWatcher::slotFileChanged);
|
||||
connect(d->m_staticData->m_watcher, &QFileSystemWatcher::directoryChanged,
|
||||
this, &FileSystemWatcher::slotDirectoryChanged);
|
||||
}
|
||||
|
||||
FileSystemWatcher::~FileSystemWatcher()
|
||||
|
@@ -64,11 +64,15 @@ FileWizardPage::FileWizardPage(QWidget *parent) :
|
||||
d(new FileWizardPagePrivate)
|
||||
{
|
||||
d->m_ui.setupUi(this);
|
||||
connect(d->m_ui.pathChooser, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));
|
||||
connect(d->m_ui.nameLineEdit, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));
|
||||
connect(d->m_ui.pathChooser, &PathChooser::validChanged,
|
||||
this, &FileWizardPage::slotValidChanged);
|
||||
connect(d->m_ui.nameLineEdit, &FancyLineEdit::validChanged,
|
||||
this, &FileWizardPage::slotValidChanged);
|
||||
|
||||
connect(d->m_ui.pathChooser, SIGNAL(returnPressed()), this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.nameLineEdit, SIGNAL(validReturnPressed()), this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.pathChooser, &PathChooser::returnPressed,
|
||||
this, &FileWizardPage::slotActivated);
|
||||
connect(d->m_ui.nameLineEdit, &FancyLineEdit::validReturnPressed,
|
||||
this, &FileWizardPage::slotActivated);
|
||||
|
||||
setProperty(SHORT_TITLE_PROPERTY, tr("Location"));
|
||||
|
||||
|
@@ -83,14 +83,18 @@ public:
|
||||
QFutureWatcher<R> *watcher = new QFutureWatcher<R>();
|
||||
watchers.insert(object, watcher);
|
||||
finished.insert(watcher, false);
|
||||
connect(watcher, SIGNAL(finished()), this, SLOT(setFinished()));
|
||||
connect(watcher, SIGNAL(progressRangeChanged(int,int)), this, SLOT(setProgressRange(int,int)));
|
||||
connect(watcher, SIGNAL(progressValueChanged(int)), this, SLOT(setProgressValue(int)));
|
||||
connect(watcher, SIGNAL(progressTextChanged(QString)), this, SLOT(setProgressText(QString)));
|
||||
connect(watcher, &QFutureWatcherBase::finished,
|
||||
this, &MultiTask::setFinished);
|
||||
connect(watcher, &QFutureWatcherBase::progressRangeChanged,
|
||||
this, &MultiTask::setProgressRange);
|
||||
connect(watcher, &QFutureWatcherBase::progressValueChanged,
|
||||
this, &MultiTask::setProgressValue);
|
||||
connect(watcher, &QFutureWatcherBase::progressTextChanged,
|
||||
this, &MultiTask::setProgressText);
|
||||
watcher->setFuture(QtConcurrent::run(fn, object));
|
||||
}
|
||||
selfWatcher = new QFutureWatcher<R>();
|
||||
connect(selfWatcher, SIGNAL(canceled()), this, SLOT(cancelSelf()));
|
||||
connect(selfWatcher, &QFutureWatcherBase::canceled, this, &MultiTask::cancelSelf);
|
||||
selfWatcher->setFuture(futureInterface.future());
|
||||
loop = new QEventLoop;
|
||||
loop->exec();
|
||||
|
@@ -98,44 +98,45 @@ NewClassWidget::NewClassWidget(QWidget *parent) :
|
||||
|
||||
setNamesDelimiter(QLatin1String("::"));
|
||||
|
||||
connect(d->m_ui.classLineEdit, SIGNAL(updateFileName(QString)),
|
||||
this, SLOT(slotUpdateFileNames(QString)));
|
||||
connect(d->m_ui.classLineEdit, SIGNAL(textEdited(QString)),
|
||||
this, SLOT(classNameEdited()));
|
||||
connect(d->m_ui.baseClassComboBox, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(suggestClassNameFromBase()));
|
||||
connect(d->m_ui.baseClassComboBox, SIGNAL(editTextChanged(QString)),
|
||||
this, SLOT(slotValidChanged()));
|
||||
connect(d->m_ui.classLineEdit, SIGNAL(validChanged()),
|
||||
this, SLOT(slotValidChanged()));
|
||||
connect(d->m_ui.headerFileLineEdit, SIGNAL(validChanged()),
|
||||
this, SLOT(slotValidChanged()));
|
||||
connect(d->m_ui.sourceFileLineEdit, SIGNAL(validChanged()),
|
||||
this, SLOT(slotValidChanged()));
|
||||
connect(d->m_ui.formFileLineEdit, SIGNAL(validChanged()),
|
||||
this, SLOT(slotValidChanged()));
|
||||
connect(d->m_ui.pathChooser, SIGNAL(validChanged()),
|
||||
this, SLOT(slotValidChanged()));
|
||||
connect(d->m_ui.generateFormCheckBox, SIGNAL(toggled(bool)),
|
||||
this, SLOT(slotValidChanged()));
|
||||
connect(d->m_ui.classLineEdit, &ClassNameValidatingLineEdit::updateFileName,
|
||||
this, &NewClassWidget::slotUpdateFileNames);
|
||||
connect(d->m_ui.classLineEdit, &QLineEdit::textEdited,
|
||||
this, &NewClassWidget::classNameEdited);
|
||||
connect(d->m_ui.baseClassComboBox,
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &NewClassWidget::suggestClassNameFromBase);
|
||||
connect(d->m_ui.baseClassComboBox, &QComboBox::editTextChanged,
|
||||
this, &NewClassWidget::slotValidChanged);
|
||||
connect(d->m_ui.classLineEdit, &FancyLineEdit::validChanged,
|
||||
this, &NewClassWidget::slotValidChanged);
|
||||
connect(d->m_ui.headerFileLineEdit, &FancyLineEdit::validChanged,
|
||||
this, &NewClassWidget::slotValidChanged);
|
||||
connect(d->m_ui.sourceFileLineEdit, &FancyLineEdit::validChanged,
|
||||
this, &NewClassWidget::slotValidChanged);
|
||||
connect(d->m_ui.formFileLineEdit, &FancyLineEdit::validChanged,
|
||||
this, &NewClassWidget::slotValidChanged);
|
||||
connect(d->m_ui.pathChooser, &PathChooser::validChanged,
|
||||
this, &NewClassWidget::slotValidChanged);
|
||||
connect(d->m_ui.generateFormCheckBox, &QAbstractButton::toggled,
|
||||
this, &NewClassWidget::slotValidChanged);
|
||||
|
||||
connect(d->m_ui.classLineEdit, SIGNAL(validReturnPressed()),
|
||||
this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.headerFileLineEdit, SIGNAL(validReturnPressed()),
|
||||
this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.sourceFileLineEdit, SIGNAL(validReturnPressed()),
|
||||
this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.formFileLineEdit, SIGNAL(validReturnPressed()),
|
||||
this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.formFileLineEdit, SIGNAL(validReturnPressed()),
|
||||
this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.pathChooser, SIGNAL(returnPressed()),
|
||||
this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.classLineEdit, &FancyLineEdit::validReturnPressed,
|
||||
this, &NewClassWidget::slotActivated);
|
||||
connect(d->m_ui.headerFileLineEdit, &FancyLineEdit::validReturnPressed,
|
||||
this, &NewClassWidget::slotActivated);
|
||||
connect(d->m_ui.sourceFileLineEdit, &FancyLineEdit::validReturnPressed,
|
||||
this, &NewClassWidget::slotActivated);
|
||||
connect(d->m_ui.formFileLineEdit, &FancyLineEdit::validReturnPressed,
|
||||
this, &NewClassWidget::slotActivated);
|
||||
connect(d->m_ui.formFileLineEdit, &FancyLineEdit::validReturnPressed,
|
||||
this, &NewClassWidget::slotActivated);
|
||||
connect(d->m_ui.pathChooser, &PathChooser::returnPressed,
|
||||
this, &NewClassWidget::slotActivated);
|
||||
|
||||
connect(d->m_ui.generateFormCheckBox, SIGNAL(stateChanged(int)),
|
||||
this, SLOT(slotFormInputChecked()));
|
||||
connect(d->m_ui.baseClassComboBox, SIGNAL(editTextChanged(QString)),
|
||||
this, SLOT(slotBaseClassEdited(QString)));
|
||||
connect(d->m_ui.generateFormCheckBox, &QCheckBox::stateChanged,
|
||||
this, &NewClassWidget::slotFormInputChecked);
|
||||
connect(d->m_ui.baseClassComboBox, &QComboBox::editTextChanged,
|
||||
this, &NewClassWidget::slotBaseClassEdited);
|
||||
d->m_ui.generateFormCheckBox->setChecked(true);
|
||||
setFormInputCheckable(false, true);
|
||||
setClassType(NoClassType);
|
||||
|
@@ -234,12 +234,11 @@ PathChooser::PathChooser(QWidget *parent) :
|
||||
{
|
||||
d->m_hLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
connect(d->m_lineEdit, SIGNAL(validReturnPressed()), this, SIGNAL(returnPressed()));
|
||||
connect(d->m_lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed(QString)));
|
||||
connect(d->m_lineEdit, SIGNAL(validChanged()), this, SIGNAL(validChanged()));
|
||||
connect(d->m_lineEdit, SIGNAL(validChanged(bool)), this, SIGNAL(validChanged(bool)));
|
||||
connect(d->m_lineEdit, SIGNAL(editingFinished()), this, SIGNAL(editingFinished()));
|
||||
connect(d->m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged()));
|
||||
connect(d->m_lineEdit, &FancyLineEdit::validReturnPressed, this, &PathChooser::returnPressed);
|
||||
connect(d->m_lineEdit, &QLineEdit::textChanged, this, &PathChooser::changed);
|
||||
connect(d->m_lineEdit, &FancyLineEdit::validChanged, this, &PathChooser::validChanged);
|
||||
connect(d->m_lineEdit, &QLineEdit::editingFinished, this, &PathChooser::editingFinished);
|
||||
connect(d->m_lineEdit, &QLineEdit::textChanged, this, &PathChooser::slotTextChanged);
|
||||
|
||||
d->m_lineEdit->setMinimumWidth(120);
|
||||
d->m_hLayout->addWidget(d->m_lineEdit);
|
||||
|
@@ -142,7 +142,6 @@ private:
|
||||
QString makeDialogTitle(const QString &title);
|
||||
|
||||
signals:
|
||||
void validChanged();
|
||||
void validChanged(bool validState);
|
||||
void changed(const QString &text);
|
||||
void pathChanged(const QString &path);
|
||||
|
@@ -135,7 +135,7 @@ PathListEditor::PathListEditor(QWidget *parent) :
|
||||
d->toolButton->setPopupMode(QToolButton::MenuButtonPopup);
|
||||
d->toolButton->setText(tr("Insert..."));
|
||||
d->toolButton->setMenu(d->buttonMenu);
|
||||
connect(d->toolButton, SIGNAL(clicked()), this, SLOT(slotInsert()));
|
||||
connect(d->toolButton, &QAbstractButton::clicked, this, &PathListEditor::slotInsert);
|
||||
|
||||
addAction(tr("Add..."), this, SLOT(slotAdd()));
|
||||
addAction(tr("Delete Line"), this, SLOT(deletePathAtCursor()));
|
||||
@@ -255,7 +255,9 @@ void PathListEditor::addEnvVariableImportAction(const QString &var)
|
||||
{
|
||||
if (!d->envVarMapper) {
|
||||
d->envVarMapper = new QSignalMapper(this);
|
||||
connect(d->envVarMapper, SIGNAL(mapped(QString)), this, SLOT(setPathListFromEnvVariable(QString)));
|
||||
connect(d->envVarMapper,
|
||||
static_cast<void (QSignalMapper::*)(const QString &)>(&QSignalMapper::mapped),
|
||||
this, &PathListEditor::setPathListFromEnvVariable);
|
||||
}
|
||||
|
||||
QAction *a = insertAction(lastAddActionIndex() + 1,
|
||||
|
@@ -93,12 +93,19 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) :
|
||||
d->m_ui.projectComboBox->setVisible(d->m_forceSubProject);
|
||||
d->m_ui.pathChooser->setDisabled(d->m_forceSubProject);
|
||||
d->m_ui.projectsDirectoryCheckBox->setDisabled(d->m_forceSubProject);
|
||||
connect(d->m_ui.pathChooser, SIGNAL(changed(QString)), this, SLOT(slotChanged()));
|
||||
connect(d->m_ui.nameLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotChanged()));
|
||||
connect(d->m_ui.pathChooser, SIGNAL(validChanged()), this, SLOT(slotChanged()));
|
||||
connect(d->m_ui.pathChooser, SIGNAL(returnPressed()), this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.nameLineEdit, SIGNAL(validReturnPressed()), this, SLOT(slotActivated()));
|
||||
connect(d->m_ui.projectComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotChanged()));
|
||||
connect(d->m_ui.pathChooser, &PathChooser::changed,
|
||||
this, &ProjectIntroPage::slotChanged);
|
||||
connect(d->m_ui.nameLineEdit, &QLineEdit::textChanged,
|
||||
this, &ProjectIntroPage::slotChanged);
|
||||
connect(d->m_ui.pathChooser, &PathChooser::validChanged,
|
||||
this, &ProjectIntroPage::slotChanged);
|
||||
connect(d->m_ui.pathChooser, &PathChooser::returnPressed,
|
||||
this, &ProjectIntroPage::slotActivated);
|
||||
connect(d->m_ui.nameLineEdit, &FancyLineEdit::validReturnPressed,
|
||||
this, &ProjectIntroPage::slotActivated);
|
||||
connect(d->m_ui.projectComboBox,
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &ProjectIntroPage::slotChanged);
|
||||
|
||||
setProperty(SHORT_TITLE_PROPERTY, tr("Location"));
|
||||
registerFieldWithName(QLatin1String("Path"), d->m_ui.pathChooser, "path", SIGNAL(pathChanged(QString)));
|
||||
|
@@ -39,7 +39,7 @@ ProxyAction::ProxyAction(QObject *parent) :
|
||||
m_showShortcut(false),
|
||||
m_block(false)
|
||||
{
|
||||
connect(this, SIGNAL(changed()), this, SLOT(updateToolTipWithKeySequence()));
|
||||
connect(this, &QAction::changed, this, &ProxyAction::updateToolTipWithKeySequence);
|
||||
updateState();
|
||||
}
|
||||
|
||||
@@ -68,18 +68,18 @@ void ProxyAction::updateState()
|
||||
void ProxyAction::disconnectAction()
|
||||
{
|
||||
if (m_action) {
|
||||
disconnect(m_action, SIGNAL(changed()), this, SLOT(actionChanged()));
|
||||
disconnect(this, SIGNAL(triggered(bool)), m_action, SIGNAL(triggered(bool)));
|
||||
disconnect(this, SIGNAL(toggled(bool)), m_action, SLOT(setChecked(bool)));
|
||||
disconnect(m_action.data(), &QAction::changed, this, &ProxyAction::actionChanged);
|
||||
disconnect(this, &QAction::triggered, m_action.data(), &QAction::triggered);
|
||||
disconnect(this, &QAction::toggled, m_action.data(), &QAction::setChecked);
|
||||
}
|
||||
}
|
||||
|
||||
void ProxyAction::connectAction()
|
||||
{
|
||||
if (m_action) {
|
||||
connect(m_action, SIGNAL(changed()), this, SLOT(actionChanged()));
|
||||
connect(this, SIGNAL(triggered(bool)), m_action, SIGNAL(triggered(bool)));
|
||||
connect(this, SIGNAL(toggled(bool)), m_action, SLOT(setChecked(bool)));
|
||||
connect(m_action.data(), &QAction::changed, this, &ProxyAction::actionChanged);
|
||||
connect(this, &QAction::triggered, m_action.data(), &QAction::triggered);
|
||||
connect(this, &ProxyAction::toggled, m_action.data(), &QAction::setChecked);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ void ProxyAction::update(QAction *action, bool initialize)
|
||||
if (!action)
|
||||
return;
|
||||
disconnectAction();
|
||||
disconnect(this, SIGNAL(changed()), this, SLOT(updateToolTipWithKeySequence()));
|
||||
disconnect(this, &QAction::changed, this, &ProxyAction::updateToolTipWithKeySequence);
|
||||
if (initialize) {
|
||||
setSeparator(action->isSeparator());
|
||||
setMenuRole(action->menuRole());
|
||||
@@ -146,7 +146,7 @@ void ProxyAction::update(QAction *action, bool initialize)
|
||||
setVisible(action->isVisible());
|
||||
}
|
||||
connectAction();
|
||||
connect(this, SIGNAL(changed()), this, SLOT(updateToolTipWithKeySequence()));
|
||||
connect(this, &QAction::changed, this, &ProxyAction::updateToolTipWithKeySequence);
|
||||
}
|
||||
|
||||
bool ProxyAction::shortcutVisibleInToolTip() const
|
||||
|
@@ -133,7 +133,7 @@ QtColorButton::QtColorButton(QWidget *parent)
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
||||
connect(this, SIGNAL(clicked()), d_ptr, SLOT(slotEditColor()));
|
||||
connect(this, &QtColorButton::clicked, d_ptr, &QtColorButtonPrivate::slotEditColor);
|
||||
setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
|
||||
}
|
||||
|
||||
|
@@ -72,11 +72,14 @@ SettingsSelector::SettingsSelector(QWidget *parent) :
|
||||
|
||||
updateButtonState();
|
||||
|
||||
connect(m_addButton, SIGNAL(clicked()), this, SIGNAL(add()));
|
||||
connect(m_removeButton, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
|
||||
connect(m_renameButton, SIGNAL(clicked()), this, SLOT(renameButtonClicked()));
|
||||
connect(m_configurationCombo, SIGNAL(currentIndexChanged(int)),
|
||||
this, SIGNAL(currentChanged(int)));
|
||||
connect(m_addButton, &QAbstractButton::clicked, this, &SettingsSelector::add);
|
||||
connect(m_removeButton, &QAbstractButton::clicked,
|
||||
this, &SettingsSelector::removeButtonClicked);
|
||||
connect(m_renameButton, &QAbstractButton::clicked,
|
||||
this, &SettingsSelector::renameButtonClicked);
|
||||
connect(m_configurationCombo,
|
||||
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &SettingsSelector::currentChanged);
|
||||
}
|
||||
|
||||
SettingsSelector::~SettingsSelector()
|
||||
@@ -85,12 +88,14 @@ SettingsSelector::~SettingsSelector()
|
||||
void SettingsSelector::setConfigurationModel(QAbstractItemModel *model)
|
||||
{
|
||||
if (m_configurationCombo->model()) {
|
||||
disconnect(m_configurationCombo->model(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(updateButtonState()));
|
||||
disconnect(m_configurationCombo->model(), SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(updateButtonState()));
|
||||
disconnect(m_configurationCombo->model(), &QAbstractItemModel::rowsInserted,
|
||||
this, &SettingsSelector::updateButtonState);
|
||||
disconnect(m_configurationCombo->model(), &QAbstractItemModel::rowsRemoved,
|
||||
this, &SettingsSelector::updateButtonState);
|
||||
}
|
||||
m_configurationCombo->setModel(model);
|
||||
connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(updateButtonState()));
|
||||
connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(updateButtonState()));
|
||||
connect(model, &QAbstractItemModel::rowsInserted, this, &SettingsSelector::updateButtonState);
|
||||
connect(model, &QAbstractItemModel::rowsRemoved, this, &SettingsSelector::updateButtonState);
|
||||
|
||||
updateButtonState();
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ void StatusLabel::showStatusMessage(const QString &message, int timeoutMS)
|
||||
if (!m_timer) {
|
||||
m_timer = new QTimer(this);
|
||||
m_timer->setSingleShot(true);
|
||||
connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
|
||||
connect(m_timer, &QTimer::timeout, this, &StatusLabel::slotTimeout);
|
||||
}
|
||||
m_timer->start(timeoutMS);
|
||||
} else {
|
||||
|
@@ -249,13 +249,16 @@ SynchronousProcess::SynchronousProcess() :
|
||||
d(new SynchronousProcessPrivate)
|
||||
{
|
||||
d->m_timer.setInterval(1000);
|
||||
connect(&d->m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
|
||||
connect(&d->m_process, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(finished(int,QProcess::ExitStatus)));
|
||||
connect(&d->m_process, SIGNAL(error(QProcess::ProcessError)), this, SLOT(error(QProcess::ProcessError)));
|
||||
connect(&d->m_process, SIGNAL(readyReadStandardOutput()),
|
||||
this, SLOT(stdOutReady()));
|
||||
connect(&d->m_process, SIGNAL(readyReadStandardError()),
|
||||
this, SLOT(stdErrReady()));
|
||||
connect(&d->m_timer, &QTimer::timeout, this, &SynchronousProcess::slotTimeout);
|
||||
connect(&d->m_process,
|
||||
static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
||||
this, &SynchronousProcess::finished);
|
||||
connect(&d->m_process, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error),
|
||||
this, &SynchronousProcess::error);
|
||||
connect(&d->m_process, &QProcess::readyReadStandardOutput,
|
||||
this, &SynchronousProcess::stdOutReady);
|
||||
connect(&d->m_process, &QProcess::readyReadStandardError,
|
||||
this, &SynchronousProcess::stdErrReady);
|
||||
}
|
||||
|
||||
SynchronousProcess::~SynchronousProcess()
|
||||
|
@@ -45,7 +45,7 @@ TextFieldCheckBox::TextFieldCheckBox(const QString &text, QWidget *parent) :
|
||||
QCheckBox(text, parent),
|
||||
m_trueText(QLatin1String("true")), m_falseText(QLatin1String("false"))
|
||||
{
|
||||
connect(this, SIGNAL(stateChanged(int)), this, SLOT(slotStateChanged(int)));
|
||||
connect(this, &QCheckBox::stateChanged, this, &TextFieldCheckBox::slotStateChanged);
|
||||
}
|
||||
|
||||
QString TextFieldCheckBox::text() const
|
||||
|
@@ -48,8 +48,8 @@ TextFieldComboBox::TextFieldComboBox(QWidget *parent) :
|
||||
QComboBox(parent)
|
||||
{
|
||||
setEditable(false);
|
||||
connect(this, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(slotCurrentIndexChanged(int)));
|
||||
connect(this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
this, &TextFieldComboBox::slotCurrentIndexChanged);
|
||||
}
|
||||
|
||||
QString TextFieldComboBox::text() const
|
||||
|
@@ -142,20 +142,20 @@ LinearProgressWidget::LinearProgressWidget(WizardProgress *progress, QWidget *pa
|
||||
m_dotsItemWidget->setVisible(false);
|
||||
m_dotsItemWidget->setEnabled(false);
|
||||
|
||||
connect(m_wizardProgress, SIGNAL(itemAdded(WizardProgressItem*)),
|
||||
this, SLOT(slotItemAdded(WizardProgressItem*)));
|
||||
connect(m_wizardProgress, SIGNAL(itemRemoved(WizardProgressItem*)),
|
||||
this, SLOT(slotItemRemoved(WizardProgressItem*)));
|
||||
connect(m_wizardProgress, SIGNAL(itemChanged(WizardProgressItem*)),
|
||||
this, SLOT(slotItemChanged(WizardProgressItem*)));
|
||||
connect(m_wizardProgress, SIGNAL(nextItemsChanged(WizardProgressItem*,QList<WizardProgressItem*>)),
|
||||
this, SLOT(slotNextItemsChanged(WizardProgressItem*,QList<WizardProgressItem*>)));
|
||||
connect(m_wizardProgress, SIGNAL(nextShownItemChanged(WizardProgressItem*,WizardProgressItem*)),
|
||||
this, SLOT(slotNextShownItemChanged(WizardProgressItem*,WizardProgressItem*)));
|
||||
connect(m_wizardProgress, SIGNAL(startItemChanged(WizardProgressItem*)),
|
||||
this, SLOT(slotStartItemChanged(WizardProgressItem*)));
|
||||
connect(m_wizardProgress, SIGNAL(currentItemChanged(WizardProgressItem*)),
|
||||
this, SLOT(slotCurrentItemChanged(WizardProgressItem*)));
|
||||
connect(m_wizardProgress, &WizardProgress::itemAdded,
|
||||
this, &LinearProgressWidget::slotItemAdded);
|
||||
connect(m_wizardProgress, &WizardProgress::itemRemoved,
|
||||
this, &LinearProgressWidget::slotItemRemoved);
|
||||
connect(m_wizardProgress, &WizardProgress::itemChanged,
|
||||
this, &LinearProgressWidget::slotItemChanged);
|
||||
connect(m_wizardProgress, &WizardProgress::nextItemsChanged,
|
||||
this, &LinearProgressWidget::slotNextItemsChanged);
|
||||
connect(m_wizardProgress, &WizardProgress::nextShownItemChanged,
|
||||
this, &LinearProgressWidget::slotNextShownItemChanged);
|
||||
connect(m_wizardProgress, &WizardProgress::startItemChanged,
|
||||
this, &LinearProgressWidget::slotStartItemChanged);
|
||||
connect(m_wizardProgress, &WizardProgress::currentItemChanged,
|
||||
this, &LinearProgressWidget::slotCurrentItemChanged);
|
||||
|
||||
QList<WizardProgressItem *> items = m_wizardProgress->items();
|
||||
for (int i = 0; i < items.count(); i++)
|
||||
|
@@ -166,7 +166,7 @@ SuppressionDialog::SuppressionDialog(MemcheckErrorView *view, const QList<Error>
|
||||
|
||||
m_suppressionEdit->setPlainText(suppressions);
|
||||
|
||||
connect(m_fileChooser, static_cast<void (Utils::PathChooser:: *)()>(&Utils::PathChooser::validChanged),
|
||||
connect(m_fileChooser, &Utils::PathChooser::validChanged,
|
||||
this, &SuppressionDialog::validate);
|
||||
connect(m_suppressionEdit->document(), &QTextDocument::contentsChanged,
|
||||
this, &SuppressionDialog::validate);
|
||||
|
@@ -81,8 +81,7 @@ BaseCheckoutWizardPage::BaseCheckoutWizardPage(QWidget *parent) :
|
||||
|
||||
d->ui.pathChooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
|
||||
d->ui.pathChooser->setHistoryCompleter(QLatin1String("Vcs.CheckoutDir.History"));
|
||||
connect(d->ui.pathChooser,
|
||||
static_cast<void (Utils::PathChooser::*)()>(&Utils::PathChooser::validChanged),
|
||||
connect(d->ui.pathChooser, &Utils::PathChooser::validChanged,
|
||||
this, &BaseCheckoutWizardPage::slotChanged);
|
||||
|
||||
d->ui.branchComboBox->setEnabled(false);
|
||||
|
Reference in New Issue
Block a user