forked from qt-creator/qt-creator
Various Plugins: Add context object into connections
Change-Id: I360677bebfef16a3233b3b8177cff6da57ec7c31 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -205,7 +205,7 @@ void AxivionPluginPrivate::onStartupProjectChanged()
|
||||
void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName)
|
||||
{
|
||||
if (m_runningQuery) { // re-schedule
|
||||
QTimer::singleShot(3000, [this, projectName]{ fetchProjectInfo(projectName); });
|
||||
QTimer::singleShot(3000, this, [this, projectName] { fetchProjectInfo(projectName); });
|
||||
return;
|
||||
}
|
||||
clearAllMarks();
|
||||
@@ -228,7 +228,7 @@ void AxivionPluginPrivate::fetchProjectInfo(const QString &projectName)
|
||||
void AxivionPluginPrivate::fetchRuleInfo(const QString &id)
|
||||
{
|
||||
if (m_runningQuery) {
|
||||
QTimer::singleShot(3000, [this, id]{ fetchRuleInfo(id); });
|
||||
QTimer::singleShot(3000, this, [this, id] { fetchRuleInfo(id); });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ SessionNameInputDialog::SessionNameInputDialog(QWidget *parent)
|
||||
}.attachTo(this);
|
||||
// clang-format on
|
||||
|
||||
connect(m_newSessionLineEdit, &QLineEdit::textChanged, [this](const QString &text) {
|
||||
connect(m_newSessionLineEdit, &QLineEdit::textChanged, this, [this](const QString &text) {
|
||||
m_okButton->setEnabled(!text.isEmpty());
|
||||
m_switchToButton->setEnabled(!text.isEmpty());
|
||||
});
|
||||
|
||||
@@ -54,10 +54,10 @@ SessionView::SessionView(QWidget *parent)
|
||||
selectionModel()->select(firstRow, QItemSelectionModel::QItemSelectionModel::
|
||||
SelectCurrent);
|
||||
|
||||
connect(this, &Utils::TreeView::activated, [this](const QModelIndex &index){
|
||||
connect(this, &Utils::TreeView::activated, this, [this](const QModelIndex &index){
|
||||
emit sessionActivated(m_sessionModel.sessionAt(index.row()));
|
||||
});
|
||||
connect(selectionModel(), &QItemSelectionModel::selectionChanged, [this] {
|
||||
connect(selectionModel(), &QItemSelectionModel::selectionChanged, this, [this] {
|
||||
emit sessionsSelected(selectedSessions());
|
||||
});
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
CppcheckPluginPrivate::CppcheckPluginPrivate()
|
||||
{
|
||||
tool.updateOptions();
|
||||
connect(&settings(), &AspectContainer::changed, [this] {
|
||||
connect(&settings(), &AspectContainer::changed, this, [this] {
|
||||
tool.updateOptions();
|
||||
trigger.recheck();
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ CtfStatisticsView::CtfStatisticsView(CtfStatisticsModel *model, QWidget *parent)
|
||||
setUniformRowHeights(true);
|
||||
setSortingEnabled(true);
|
||||
|
||||
connect(selectionModel(), &QItemSelectionModel::currentChanged,
|
||||
connect(selectionModel(), &QItemSelectionModel::currentChanged, this,
|
||||
[this] (const QModelIndex ¤t, const QModelIndex &previous)
|
||||
{
|
||||
Q_UNUSED(previous);
|
||||
|
||||
@@ -97,8 +97,7 @@ void CtfVisualizerTool::createViews()
|
||||
|
||||
m_statisticsView = new CtfStatisticsView(m_statisticsModel.get());
|
||||
m_statisticsView->setWindowTitle(Tr::tr("Statistics"));
|
||||
connect(m_statisticsView, &CtfStatisticsView::eventTypeSelected, [this] (QString title)
|
||||
{
|
||||
connect(m_statisticsView, &CtfStatisticsView::eventTypeSelected, this, [this](QString title) {
|
||||
int typeId = m_traceManager->getSelectionId(title.toStdString());
|
||||
m_traceView->selectByTypeId(typeId);
|
||||
});
|
||||
|
||||
@@ -502,7 +502,7 @@ FakeVimExCommandsMappings::FakeVimExCommandsMappings()
|
||||
|
||||
auto infoLabel = new InfoLabel(Tr::tr("Invalid regular expression."), InfoLabel::Error);
|
||||
infoLabel->setVisible(false);
|
||||
connect(m_commandEdit, &FancyLineEdit::validChanged, [infoLabel](bool valid){
|
||||
connect(m_commandEdit, &FancyLineEdit::validChanged, this, [infoLabel](bool valid){
|
||||
infoLabel->setVisible(!valid);
|
||||
});
|
||||
commandBoxLayout->addWidget(infoLabel);
|
||||
|
||||
@@ -915,8 +915,10 @@ void FossilClient::log(const FilePath &workingDir, const QStringList &files,
|
||||
if (VcsBaseEditorConfig *editorConfig = createLogEditor(fossilEditor)) {
|
||||
editorConfig->setBaseArguments(extraOptions);
|
||||
// editor has been just created, createVcsEditor() didn't set a configuration widget yet
|
||||
connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested,
|
||||
[=]() { this->log(workingDir, files, editorConfig->arguments(), enableAnnotationContextMenu, addAuthOptions); } );
|
||||
connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested, this, [=] {
|
||||
log(workingDir, files, editorConfig->arguments(), enableAnnotationContextMenu,
|
||||
addAuthOptions);
|
||||
});
|
||||
fossilEditor->setEditorConfig(editorConfig);
|
||||
}
|
||||
}
|
||||
@@ -968,8 +970,10 @@ void FossilClient::logCurrentFile(const FilePath &workingDir, const QStringList
|
||||
if (VcsBaseEditorConfig *editorConfig = createLogCurrentFileEditor(fossilEditor)) {
|
||||
editorConfig->setBaseArguments(extraOptions);
|
||||
// editor has been just created, createVcsEditor() didn't set a configuration widget yet
|
||||
connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested,
|
||||
[=]() { this->logCurrentFile(workingDir, files, editorConfig->arguments(), enableAnnotationContextMenu, addAuthOptions); } );
|
||||
connect(editorConfig, &VcsBaseEditorConfig::commandExecutionRequested, this, [=] {
|
||||
logCurrentFile(workingDir, files, editorConfig->arguments(),
|
||||
enableAnnotationContextMenu, addAuthOptions);
|
||||
});
|
||||
fossilEditor->setEditorConfig(editorConfig);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,14 +323,11 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
|
||||
helpTargetButton->setProperty(Utils::StyleHelper::C_NO_ARROW, true);
|
||||
helpTargetButton->setPopupMode(QToolButton::DelayedPopup);
|
||||
helpTargetButton->setMenu(createHelpTargetMenu(helpTargetButton));
|
||||
connect(LocalHelpManager::instance(),
|
||||
&LocalHelpManager::contextHelpOptionChanged,
|
||||
connect(LocalHelpManager::instance(), &LocalHelpManager::contextHelpOptionChanged, this,
|
||||
[this, helpTargetAction] {
|
||||
helpTargetAction->setChecked(isTargetOfContextHelp(m_style));
|
||||
});
|
||||
connect(helpTargetAction,
|
||||
&QAction::triggered,
|
||||
this,
|
||||
connect(helpTargetAction, &QAction::triggered, this,
|
||||
[this, helpTargetAction, helpTargetButton](bool checked) {
|
||||
if (checked) {
|
||||
LocalHelpManager::setContextHelpOption(optionForStyle(m_style));
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
connect(m_sectionedProducts, &SectionedProducts::toggleProgressIndicator,
|
||||
progressIndicator, &Utils::ProgressIndicator::setVisible);
|
||||
connect(m_sectionedProducts, &SectionedProducts::errorOccurred,
|
||||
connect(m_sectionedProducts, &SectionedProducts::errorOccurred, this,
|
||||
[this, progressIndicator, searchBox](int, const QString &message) {
|
||||
progressIndicator->hide();
|
||||
progressIndicator->deleteLater();
|
||||
|
||||
@@ -89,9 +89,9 @@ McuKitCreationDialog::McuKitCreationDialog(const MessagesList &messages,
|
||||
if (qtMCUPackage->isValidStatus())
|
||||
m_qtMCUsPathLabel->setText(
|
||||
Tr::tr("Qt for MCUs path %1").arg(qtMCUPackage->path().toUserOutput()));
|
||||
connect(m_nextButton, &QPushButton::clicked, [=] { updateMessage(1); });
|
||||
connect(m_previousButton, &QPushButton::clicked, [=] { updateMessage(-1); });
|
||||
connect(fixButton, &QPushButton::clicked, [=] {
|
||||
connect(m_nextButton, &QPushButton::clicked, this, [this] { updateMessage(1); });
|
||||
connect(m_previousButton, &QPushButton::clicked, this, [this] { updateMessage(-1); });
|
||||
connect(fixButton, &QPushButton::clicked, this, [this, settingsHandler] {
|
||||
// Open the MCU Options widget on the current platform
|
||||
settingsHandler->setInitialPlatformName(m_messages[m_currentIndex].platform);
|
||||
Core::ICore::showOptionsDialog(Constants::SETTINGS_ID);
|
||||
|
||||
@@ -221,7 +221,8 @@ public:
|
||||
|
||||
m_showProgressTimer.setSingleShot(true);
|
||||
m_showProgressTimer.setInterval(50); // don't show progress for < 50ms tasks
|
||||
connect(&m_showProgressTimer, &QTimer::timeout, [this]() { m_progressIndicator.show(); });
|
||||
connect(&m_showProgressTimer, &QTimer::timeout,
|
||||
this, [this] { m_progressIndicator.show(); });
|
||||
connect(&m_optionsModel, &BuidOptionsModel::configurationChanged, this, [configureButton] {
|
||||
configureButton->setEnabled(true);
|
||||
});
|
||||
@@ -274,13 +275,15 @@ public:
|
||||
optionsTreeView,
|
||||
[tree = optionsTreeView](const QModelIndex &idx) { tree->edit(idx); });
|
||||
|
||||
connect(configureButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] {
|
||||
connect(configureButton, &QPushButton::clicked,
|
||||
this, [this, bs, configureButton, optionsTreeView] {
|
||||
optionsTreeView->setEnabled(false);
|
||||
configureButton->setEnabled(false);
|
||||
m_showProgressTimer.start();
|
||||
bs->configure();
|
||||
});
|
||||
connect(wipeButton, &QPushButton::clicked, [this, bs, configureButton, optionsTreeView] {
|
||||
connect(wipeButton, &QPushButton::clicked,
|
||||
this, [this, bs, configureButton, optionsTreeView] {
|
||||
optionsTreeView->setEnabled(false);
|
||||
configureButton->setEnabled(false);
|
||||
m_showProgressTimer.start();
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
NimSuggestCache()
|
||||
{
|
||||
setExecutablePath(settings().nimSuggestPath());
|
||||
QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, [this] {
|
||||
QObject::connect(&settings().nimSuggestPath, &StringAspect::changed, this, [this] {
|
||||
setExecutablePath(settings().nimSuggestPath());
|
||||
});
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ QString SerialControl::baudRateText() const
|
||||
void SerialControl::pulseDataTerminalReady()
|
||||
{
|
||||
m_serialPort.setDataTerminalReady(!m_initialDtrState);
|
||||
QTimer::singleShot(Constants::RESET_DELAY, [&]() {
|
||||
QTimer::singleShot(Constants::RESET_DELAY, this, [this] {
|
||||
m_serialPort.setDataTerminalReady(m_initialDtrState);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -257,14 +257,12 @@ void SerialOutputPane::createNewOutputWindow(SerialControl *rc)
|
||||
return;
|
||||
|
||||
// Signals to update buttons
|
||||
connect(rc, &SerialControl::started,
|
||||
[this, rc]() {
|
||||
connect(rc, &SerialControl::started, this, [this, rc] {
|
||||
if (isCurrent(rc))
|
||||
enableButtons(rc, true);
|
||||
});
|
||||
|
||||
connect(rc, &SerialControl::finished,
|
||||
[this, rc]() {
|
||||
connect(rc, &SerialControl::finished, this, [this, rc] {
|
||||
const int tabIndex = indexOf(rc);
|
||||
if (tabIndex != -1)
|
||||
m_serialControlTabs[tabIndex].window->flush();
|
||||
|
||||
@@ -351,12 +351,12 @@ WelcomeMode::WelcomeMode()
|
||||
|
||||
m_modeWidget = new ResizeSignallingWidget;
|
||||
m_modeWidget->setPalette(palette);
|
||||
connect(m_modeWidget, &ResizeSignallingWidget::resized,
|
||||
connect(m_modeWidget, &ResizeSignallingWidget::resized, this,
|
||||
[this](const QSize &size, const QSize &) {
|
||||
const bool hideSideArea = size.width() <= 750;
|
||||
const bool hideBottomArea = size.width() <= 850;
|
||||
const bool compactVertically = size.height() <= 530;
|
||||
QTimer::singleShot(0, [this, hideSideArea, hideBottomArea, compactVertically]() {
|
||||
QTimer::singleShot(0, this, [this, hideSideArea, hideBottomArea, compactVertically] {
|
||||
m_sideArea->setVisible(!hideSideArea);
|
||||
m_bottomArea->setVisible(!(hideBottomArea || compactVertically));
|
||||
m_topArea->setCompact(compactVertically);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
QTimer::singleShot(0, [] {
|
||||
QTimer::singleShot(0, &app, [] {
|
||||
QInputDialog dlg;
|
||||
const QStringList appArgs = qApp->arguments();
|
||||
QString labelText = QCoreApplication::translate("qtc-askpass",
|
||||
|
||||
Reference in New Issue
Block a user