Utils: Replace PathChooser::{fileP,p}athChanged signals

... by a new PathChooser::textChanged signal.

They were both emitted in reaction to the underlying line edit's
textChanged() signal.

Use 'textChanged()' as name to mimic/match the Qt side. This also
makes it more clear on the user code side, when this happens.

Some textChanged() consumers should probably use editingFinished()
instead, but that's left for later changes.

Change-Id: Ib07347f616cbf1c5d09bc2f8671ca860d185d1f9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2022-09-02 11:49:36 +02:00
committed by Christian Stenger
parent b0defb65c2
commit 1567d24980
34 changed files with 69 additions and 73 deletions

View File

@@ -1087,7 +1087,7 @@ void StringAspect::addToLayout(LayoutBuilder &builder)
connect(d->m_pathChooserDisplay, &PathChooser::editingFinished, this, setPathChooserValue); connect(d->m_pathChooserDisplay, &PathChooser::editingFinished, this, setPathChooserValue);
connect(d->m_pathChooserDisplay, &PathChooser::browsingFinished, this, setPathChooserValue); connect(d->m_pathChooserDisplay, &PathChooser::browsingFinished, this, setPathChooserValue);
} else { } else {
connect(d->m_pathChooserDisplay, &PathChooser::pathChanged, connect(d->m_pathChooserDisplay, &PathChooser::textChanged,
this, [this](const QString &path) { this, [this](const QString &path) {
setValue(path); setValue(path);
}); });

View File

@@ -75,7 +75,7 @@ FileWizardPage::FileWizardPage(QWidget *parent) :
setProperty(SHORT_TITLE_PROPERTY, tr("Location")); setProperty(SHORT_TITLE_PROPERTY, tr("Location"));
registerFieldWithName(QLatin1String("Path"), d->m_pathChooser, "path", SIGNAL(pathChanged(QString))); registerFieldWithName(QLatin1String("Path"), d->m_pathChooser, "path", SIGNAL(textChanged(QString)));
registerFieldWithName(QLatin1String("FileName"), d->m_nameLineEdit); registerFieldWithName(QLatin1String("FileName"), d->m_nameLineEdit);
} }

View File

@@ -246,11 +246,7 @@ PathChooser::PathChooser(QWidget *parent) :
[this] { emit rawPathChanged(rawPath()); }); [this] { emit rawPathChanged(rawPath()); });
connect(d->m_lineEdit, &FancyLineEdit::validChanged, this, &PathChooser::validChanged); connect(d->m_lineEdit, &FancyLineEdit::validChanged, this, &PathChooser::validChanged);
connect(d->m_lineEdit, &QLineEdit::editingFinished, this, &PathChooser::editingFinished); connect(d->m_lineEdit, &QLineEdit::editingFinished, this, &PathChooser::editingFinished);
connect(d->m_lineEdit, &QLineEdit::textChanged, this, [this] { connect(d->m_lineEdit, &QLineEdit::textChanged, this, &PathChooser::textChanged);
const QString text = d->m_lineEdit->text();
emit pathChanged(text);
emit filePathChanged(FilePath::fromUserInput(text));
});
d->m_lineEdit->setMinimumWidth(120); d->m_lineEdit->setMinimumWidth(120);
d->m_hLayout->addWidget(d->m_lineEdit); d->m_hLayout->addWidget(d->m_lineEdit);

View File

@@ -26,7 +26,7 @@ class PathChooserPrivate;
class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged DESIGNABLE true) Q_PROPERTY(QString path READ path WRITE setPath NOTIFY textChanged DESIGNABLE true)
Q_PROPERTY(QString promptDialogTitle READ promptDialogTitle WRITE setPromptDialogTitle DESIGNABLE true) Q_PROPERTY(QString promptDialogTitle READ promptDialogTitle WRITE setPromptDialogTitle DESIGNABLE true)
Q_PROPERTY(QString promptDialogFilter READ promptDialogFilter WRITE setPromptDialogFilter DESIGNABLE true) Q_PROPERTY(QString promptDialogFilter READ promptDialogFilter WRITE setPromptDialogFilter DESIGNABLE true)
Q_PROPERTY(Kind expectedKind READ expectedKind WRITE setExpectedKind DESIGNABLE true) Q_PROPERTY(Kind expectedKind READ expectedKind WRITE setExpectedKind DESIGNABLE true)
@@ -150,9 +150,8 @@ private:
signals: signals:
void validChanged(bool validState); void validChanged(bool validState);
void rawPathChanged(const QString &text); void rawPathChanged(const QString &text);
void pathChanged(const QString &path); void textChanged(const QString &text); // Triggered from the line edit's textChanged()
void filePathChanged(const FilePath &path); void editingFinished(); // Triggered from the line edit's editingFinished()
void editingFinished();
void beforeBrowsing(); void beforeBrowsing();
void browsingFinished(); void browsingFinished();
void returnPressed(); void returnPressed();

View File

@@ -118,7 +118,8 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) :
d->m_stateLabel d->m_stateLabel
}.attachTo(this); }.attachTo(this);
connect(d->m_pathChooser, &PathChooser::filePathChanged, this, &ProjectIntroPage::slotChanged); connect(d->m_pathChooser, &PathChooser::textChanged,
this, &ProjectIntroPage::slotChanged);
connect(d->m_nameLineEdit, &QLineEdit::textChanged, connect(d->m_nameLineEdit, &QLineEdit::textChanged,
this, &ProjectIntroPage::slotChanged); this, &ProjectIntroPage::slotChanged);
connect(d->m_pathChooser, &PathChooser::validChanged, connect(d->m_pathChooser, &PathChooser::validChanged,
@@ -131,7 +132,7 @@ ProjectIntroPage::ProjectIntroPage(QWidget *parent) :
this, &ProjectIntroPage::slotChanged); this, &ProjectIntroPage::slotChanged);
setProperty(SHORT_TITLE_PROPERTY, tr("Location")); setProperty(SHORT_TITLE_PROPERTY, tr("Location"));
registerFieldWithName(QLatin1String("Path"), d->m_pathChooser, "path", SIGNAL(pathChanged(QString))); registerFieldWithName(QLatin1String("Path"), d->m_pathChooser, "path", SIGNAL(textChanged(QString)));
registerFieldWithName(QLatin1String("ProjectName"), d->m_nameLineEdit); registerFieldWithName(QLatin1String("ProjectName"), d->m_nameLineEdit);
} }

View File

@@ -208,7 +208,8 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup()
keystoreLocationChooser->setInitialBrowsePathBackup(FileUtils::homePath()); keystoreLocationChooser->setInitialBrowsePathBackup(FileUtils::homePath());
keystoreLocationChooser->setPromptDialogFilter(tr("Keystore files (*.keystore *.jks)")); keystoreLocationChooser->setPromptDialogFilter(tr("Keystore files (*.keystore *.jks)"));
keystoreLocationChooser->setPromptDialogTitle(tr("Select Keystore File")); keystoreLocationChooser->setPromptDialogTitle(tr("Select Keystore File"));
connect(keystoreLocationChooser, &PathChooser::filePathChanged, this, [this](const FilePath &file) { connect(keystoreLocationChooser, &PathChooser::textChanged, this, [this, keystoreLocationChooser] {
const FilePath file = keystoreLocationChooser->rawFilePath();
m_step->setKeystorePath(file); m_step->setKeystorePath(file);
m_signPackageCheckBox->setChecked(!file.isEmpty()); m_signPackageCheckBox->setChecked(!file.isEmpty());
if (!file.isEmpty()) if (!file.isEmpty())

View File

@@ -154,8 +154,9 @@ ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
m_sourceDirectoryWarning->setWordWrap(true); m_sourceDirectoryWarning->setWordWrap(true);
m_layout->addRow(m_sourceDirectoryWarning); m_layout->addRow(m_sourceDirectoryWarning);
connect(m_androidPackageSourceDir, &PathChooser::filePathChanged, connect(m_androidPackageSourceDir, &PathChooser::textChanged, m_wizard, [this] {
m_wizard, &CreateAndroidManifestWizard::setDirectory); m_wizard->setDirectory(m_androidPackageSourceDir->rawFilePath());
});
if (wizard->copyGradle()) { if (wizard->copyGradle()) {
auto checkBox = new QCheckBox(this); auto checkBox = new QCheckBox(this);

View File

@@ -219,7 +219,7 @@ GdbServerProviderConfigWidget::GdbServerProviderConfigWidget(
connect(m_startupModeComboBox, &QComboBox::currentIndexChanged, connect(m_startupModeComboBox, &QComboBox::currentIndexChanged,
this, &GdbServerProviderConfigWidget::dirty); this, &GdbServerProviderConfigWidget::dirty);
connect(m_peripheralDescriptionFileChooser, &PathChooser::filePathChanged, connect(m_peripheralDescriptionFileChooser, &PathChooser::textChanged,
this, &GdbServerProviderConfigWidget::dirty); this, &GdbServerProviderConfigWidget::dirty);
} }

View File

@@ -277,7 +277,7 @@ UvscServerProviderConfigWidget::UvscServerProviderConfigWidget(UvscServerProvide
connect(m_hostWidget, &HostWidget::dataChanged, connect(m_hostWidget, &HostWidget::dataChanged,
this, &UvscServerProviderConfigWidget::dirty); this, &UvscServerProviderConfigWidget::dirty);
connect(m_toolsIniChooser, &PathChooser::filePathChanged, connect(m_toolsIniChooser, &PathChooser::textChanged,
this, &UvscServerProviderConfigWidget::dirty); this, &UvscServerProviderConfigWidget::dirty);
connect(m_deviceSelector, &DeviceSelector::selectionChanged, connect(m_deviceSelector, &DeviceSelector::selectionChanged,
this, &UvscServerProviderConfigWidget::dirty); this, &UvscServerProviderConfigWidget::dirty);
@@ -290,7 +290,7 @@ UvscServerProviderConfigWidget::UvscServerProviderConfigWidget(UvscServerProvide
m_driverSelector->setToolsIniFile(toolsIniFile); m_driverSelector->setToolsIniFile(toolsIniFile);
}; };
connect(m_toolsIniChooser, &PathChooser::filePathChanged, this, updateSelectors); connect(m_toolsIniChooser, &PathChooser::textChanged, this, updateSelectors);
updateSelectors(); updateSelectors();
} }

View File

@@ -83,7 +83,7 @@ DeviceSelectorDetailsPanel::DeviceSelectorDetailsPanel(DeviceSelection &selectio
m_selection.algorithmIndex = index; m_selection.algorithmIndex = index;
emit selectionChanged(); emit selectionChanged();
}); });
connect(m_peripheralDescriptionFileChooser, &Utils::PathChooser::filePathChanged, connect(m_peripheralDescriptionFileChooser, &Utils::PathChooser::textChanged,
this, &DeviceSelectorDetailsPanel::selectionChanged); this, &DeviceSelectorDetailsPanel::selectionChanged);
} }

View File

@@ -89,11 +89,11 @@ public:
label->setWordWrap(true); label->setWordWrap(true);
vlayout->addWidget(label); vlayout->addWidget(label);
auto path = new PathChooser; auto chooser = new PathChooser;
path->setExpectedKind(PathChooser::Any); chooser->setExpectedKind(PathChooser::Any);
vlayout->addWidget(path); vlayout->addWidget(chooser);
connect(path, &PathChooser::pathChanged, this, [this, path] { connect(chooser, &PathChooser::textChanged, this, [this, chooser] {
m_data->sourcePath = path->filePath(); m_data->sourcePath = chooser->filePath();
updateWarnings(); updateWarnings();
}); });

View File

@@ -372,7 +372,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD
return; return;
} }
}; };
connect(&d->clangdChooser, &Utils::PathChooser::filePathChanged, this, updateWarningLabel); connect(&d->clangdChooser, &Utils::PathChooser::textChanged, this, updateWarningLabel);
updateWarningLabel(); updateWarningLabel();
connect(&d->useClangdCheckBox, &QCheckBox::toggled, connect(&d->useClangdCheckBox, &QCheckBox::toggled,
@@ -389,7 +389,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD
this, &ClangdSettingsWidget::settingsDataChanged); this, &ClangdSettingsWidget::settingsDataChanged);
connect(&d->documentUpdateThreshold, &QSpinBox::valueChanged, connect(&d->documentUpdateThreshold, &QSpinBox::valueChanged,
this, &ClangdSettingsWidget::settingsDataChanged); this, &ClangdSettingsWidget::settingsDataChanged);
connect(&d->clangdChooser, &Utils::PathChooser::filePathChanged, connect(&d->clangdChooser, &Utils::PathChooser::textChanged,
this, &ClangdSettingsWidget::settingsDataChanged); this, &ClangdSettingsWidget::settingsDataChanged);
connect(d->configSelectionWidget, &ClangDiagnosticConfigsSelectionWidget::changed, connect(d->configSelectionWidget, &ClangDiagnosticConfigsSelectionWidget::changed,
this, &ClangdSettingsWidget::settingsDataChanged); this, &ClangdSettingsWidget::settingsDataChanged);

View File

@@ -324,9 +324,9 @@ DebuggerItemConfigWidget::DebuggerItemConfigWidget()
formLayout->addRow(new QLabel(Tr::tr("Version:")), m_versionLabel); formLayout->addRow(new QLabel(Tr::tr("Version:")), m_versionLabel);
formLayout->addRow(new QLabel(Tr::tr("Working directory:")), m_workingDirectoryChooser); formLayout->addRow(new QLabel(Tr::tr("Working directory:")), m_workingDirectoryChooser);
connect(m_binaryChooser, &PathChooser::filePathChanged, connect(m_binaryChooser, &PathChooser::textChanged,
this, &DebuggerItemConfigWidget::binaryPathHasChanged); this, &DebuggerItemConfigWidget::binaryPathHasChanged);
connect(m_workingDirectoryChooser, &PathChooser::filePathChanged, connect(m_workingDirectoryChooser, &PathChooser::textChanged,
this, &DebuggerItemConfigWidget::store); this, &DebuggerItemConfigWidget::store);
connect(m_displayNameLineEdit, &QLineEdit::textChanged, connect(m_displayNameLineEdit, &QLineEdit::textChanged,
this, &DebuggerItemConfigWidget::store); this, &DebuggerItemConfigWidget::store);

View File

@@ -272,7 +272,7 @@ DebuggerSourcePathMappingWidget::DebuggerSourcePathMappingWidget() :
m_targetChooser->setHistoryCompleter("Debugger.MappingTarget.History"); m_targetChooser->setHistoryCompleter("Debugger.MappingTarget.History");
connect(m_sourceLineEdit, &QLineEdit::textChanged, connect(m_sourceLineEdit, &QLineEdit::textChanged,
this, &DebuggerSourcePathMappingWidget::slotEditSourceFieldChanged); this, &DebuggerSourcePathMappingWidget::slotEditSourceFieldChanged);
connect(m_targetChooser, &PathChooser::filePathChanged, connect(m_targetChooser, &PathChooser::textChanged,
this, &DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged); this, &DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged);
auto editLayout = new QFormLayout; auto editLayout = new QFormLayout;
const QString sourceToolTip = Tr::tr("<p>The source path contained in the " const QString sourceToolTip = Tr::tr("<p>The source path contained in the "

View File

@@ -276,9 +276,13 @@ AttachCoreDialog::~AttachCoreDialog()
int AttachCoreDialog::exec() int AttachCoreDialog::exec()
{ {
connect(d->selectRemoteCoreButton, &QAbstractButton::clicked, this, &AttachCoreDialog::selectRemoteCoreFile); connect(d->selectRemoteCoreButton, &QAbstractButton::clicked, this, &AttachCoreDialog::selectRemoteCoreFile);
connect(d->remoteCoreFileName, &PathChooser::filePathChanged, this, &AttachCoreDialog::coreFileChanged); connect(d->remoteCoreFileName, &PathChooser::textChanged, this, [this] {
connect(d->symbolFileName, &PathChooser::filePathChanged, this, &AttachCoreDialog::changed); coreFileChanged(d->remoteCoreFileName->rawFilePath());
connect(d->localCoreFileName, &PathChooser::filePathChanged, this, &AttachCoreDialog::coreFileChanged); });
connect(d->symbolFileName, &PathChooser::textChanged, this, &AttachCoreDialog::changed);
connect(d->localCoreFileName, &PathChooser::textChanged, this, [this] {
coreFileChanged(d->localCoreFileName->rawFilePath());
});
connect(d->forceLocalCheckBox, &QCheckBox::stateChanged, this, &AttachCoreDialog::changed); connect(d->forceLocalCheckBox, &QCheckBox::stateChanged, this, &AttachCoreDialog::changed);
connect(d->kitChooser, &KitChooser::currentIndexChanged, this, &AttachCoreDialog::changed); connect(d->kitChooser, &KitChooser::currentIndexChanged, this, &AttachCoreDialog::changed);
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);

View File

@@ -145,7 +145,7 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
this, &UnstartedAppWatcherDialog::selectExecutable); this, &UnstartedAppWatcherDialog::selectExecutable);
connect(m_watchingPushButton, &QAbstractButton::toggled, connect(m_watchingPushButton, &QAbstractButton::toggled,
this, &UnstartedAppWatcherDialog::startStopWatching); this, &UnstartedAppWatcherDialog::startStopWatching);
connect(m_pathChooser, &Utils::PathChooser::filePathChanged, connect(m_pathChooser, &Utils::PathChooser::textChanged,
this, &UnstartedAppWatcherDialog::stopAndCheckExecutable); this, &UnstartedAppWatcherDialog::stopAndCheckExecutable);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(&m_timer, &QTimer::timeout, connect(&m_timer, &QTimer::timeout,

View File

@@ -83,9 +83,9 @@ ChangeSelectionDialog::ChangeSelectionDialog(const FilePath &workingDirectory, I
connect(m_changeNumberEdit, &CompletingLineEdit::textChanged, connect(m_changeNumberEdit, &CompletingLineEdit::textChanged,
this, &ChangeSelectionDialog::changeTextChanged); this, &ChangeSelectionDialog::changeTextChanged);
connect(m_workingDirectoryChooser, &PathChooser::filePathChanged, connect(m_workingDirectoryChooser, &PathChooser::textChanged,
this, &ChangeSelectionDialog::recalculateDetails); this, &ChangeSelectionDialog::recalculateDetails);
connect(m_workingDirectoryChooser, &PathChooser::filePathChanged, connect(m_workingDirectoryChooser, &PathChooser::textChanged,
this, &ChangeSelectionDialog::recalculateCompletion); this, &ChangeSelectionDialog::recalculateCompletion);
connect(selectFromHistoryButton, &QPushButton::clicked, connect(selectFromHistoryButton, &QPushButton::clicked,
this, &ChangeSelectionDialog::selectCommitFromRecentHistory); this, &ChangeSelectionDialog::selectCommitFromRecentHistory);

View File

@@ -91,7 +91,7 @@ GitLabCloneDialog::GitLabCloneDialog(const Project &project, QWidget *parent)
QTC_ASSERT(slashIndex > 0, return); QTC_ASSERT(slashIndex > 0, return);
m_directoryLE->setText(path.mid(slashIndex + 1)); m_directoryLE->setText(path.mid(slashIndex + 1));
connect(m_pathChooser, &Utils::PathChooser::filePathChanged, this, [this]() { connect(m_pathChooser, &Utils::PathChooser::textChanged, this, [this] {
m_directoryLE->validate(); m_directoryLE->validate();
GitLabCloneDialog::updateUi(); GitLabCloneDialog::updateUi();
}); });

View File

@@ -260,7 +260,7 @@ QWidget *McuPackage::widget()
QObject::connect(this, &McuPackage::statusChanged, this, [this] { updateStatusUi(); }); QObject::connect(this, &McuPackage::statusChanged, this, [this] { updateStatusUi(); });
QObject::connect(m_fileChooser, &PathChooser::filePathChanged, this, [this] { QObject::connect(m_fileChooser, &PathChooser::textChanged, this, [this] {
updatePath(); updatePath();
emit changed(); emit changed();
}); });

View File

@@ -45,7 +45,7 @@ void ExtPropertiesMView::visitMPackage(const qmt::MPackage *package)
m_configPath->setInitialBrowsePathBackup( m_configPath->setInitialBrowsePathBackup(
Utils::FilePath::fromString(project->fileName()).absolutePath()); Utils::FilePath::fromString(project->fileName()).absolutePath());
addRow(tr("Config path:"), m_configPath, "configpath"); addRow(tr("Config path:"), m_configPath, "configpath");
connect(m_configPath, &Utils::PathChooser::filePathChanged, connect(m_configPath, &Utils::PathChooser::textChanged,
this, &ExtPropertiesMView::onConfigPathChanged); this, &ExtPropertiesMView::onConfigPathChanged);
} }
if (!m_configPath->hasFocus()) { if (!m_configPath->hasFocus()) {
@@ -64,8 +64,9 @@ void ExtPropertiesMView::visitMPackage(const qmt::MPackage *package)
} }
} }
void ExtPropertiesMView::onConfigPathChanged(const Utils::FilePath &path) void ExtPropertiesMView::onConfigPathChanged()
{ {
const Utils::FilePath path = m_configPath->rawFilePath();
bool modified = false; bool modified = false;
qmt::Project *project = m_projectController->project(); qmt::Project *project = m_projectController->project();
if (path.isEmpty()) { if (path.isEmpty()) {

View File

@@ -7,10 +7,7 @@
namespace qmt { class ProjectController; } namespace qmt { class ProjectController; }
namespace Utils { namespace Utils { class PathChooser; }
class FilePath;
class PathChooser;
} // Utils
namespace ModelEditor { namespace ModelEditor {
namespace Internal { namespace Internal {
@@ -28,7 +25,7 @@ public:
void visitMPackage(const qmt::MPackage *package) override; void visitMPackage(const qmt::MPackage *package) override;
private: private:
void onConfigPathChanged(const Utils::FilePath &path); void onConfigPathChanged();
private: private:
qmt::ProjectController *m_projectController = nullptr; qmt::ProjectController *m_projectController = nullptr;

View File

@@ -10,8 +10,9 @@
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/environment.h> #include <utils/environment.h>
#include <utils/pathchooser.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
#include <QFormLayout> #include <QFormLayout>
@@ -84,7 +85,13 @@ NimToolChainConfigWidget::NimToolChainConfigWidget(NimToolChain *tc)
fillUI(); fillUI();
// Connect // Connect
connect(m_compilerCommand, &PathChooser::pathChanged, this, &NimToolChainConfigWidget::onCompilerCommandChanged); connect(m_compilerCommand, &PathChooser::textChanged, this, [this] {
const FilePath path = m_compilerCommand->rawFilePath();
auto tc = static_cast<NimToolChain *>(toolChain());
QTC_ASSERT(tc, return);
tc->setCompilerCommand(path);
fillUI();
});
} }
void NimToolChainConfigWidget::applyImpl() void NimToolChainConfigWidget::applyImpl()
@@ -121,12 +128,4 @@ void NimToolChainConfigWidget::fillUI()
m_compilerVersion->setText(tc->compilerVersion()); m_compilerVersion->setText(tc->compilerVersion());
} }
void NimToolChainConfigWidget::onCompilerCommandChanged(const QString &path)
{
auto tc = static_cast<NimToolChain *>(toolChain());
Q_ASSERT(tc);
tc->setCompilerCommand(FilePath::fromString(path));
fillUI();
}
} }

View File

@@ -36,10 +36,9 @@ protected:
private: private:
void fillUI(); void fillUI();
void onCompilerCommandChanged(const QString &path);
Utils::PathChooser *m_compilerCommand; Utils::PathChooser *m_compilerCommand;
QLineEdit *m_compilerVersion; QLineEdit *m_compilerVersion;
}; };
} } // Nim

View File

@@ -135,7 +135,7 @@ void SshSettingsWidget::setupPathChooser(PathChooser &chooser, const FilePath &i
{ {
chooser.setExpectedKind(PathChooser::ExistingCommand); chooser.setExpectedKind(PathChooser::ExistingCommand);
chooser.setFilePath(initialPath); chooser.setFilePath(initialPath);
connect(&chooser, &PathChooser::filePathChanged, [&changedFlag] { changedFlag = true; }); connect(&chooser, &PathChooser::textChanged, [&changedFlag] { changedFlag = true; });
} }
void SshSettingsWidget::updateCheckboxEnabled() void SshSettingsWidget::updateCheckboxEnabled()

View File

@@ -834,7 +834,7 @@ QWidget *PathChooserField::createWidget(const QString &displayName, JsonFieldPag
auto w = new PathChooser; auto w = new PathChooser;
if (!m_historyId.isEmpty()) if (!m_historyId.isEmpty())
w->setHistoryCompleter(m_historyId); w->setHistoryCompleter(m_historyId);
QObject::connect(w, &PathChooser::filePathChanged, [this, w] { QObject::connect(w, &PathChooser::textChanged, [this, w] {
if (w->filePath() != m_path) if (w->filePath() != m_path)
setHasUserChanges(); setHasUserChanges();
}); });

View File

@@ -58,7 +58,7 @@ public:
m_chooser->setExpectedKind(PathChooser::ExistingDirectory); m_chooser->setExpectedKind(PathChooser::ExistingDirectory);
m_chooser->setHistoryCompleter(QLatin1String("PE.SysRoot.History")); m_chooser->setHistoryCompleter(QLatin1String("PE.SysRoot.History"));
m_chooser->setFilePath(SysRootKitAspect::sysRoot(k)); m_chooser->setFilePath(SysRootKitAspect::sysRoot(k));
connect(m_chooser, &PathChooser::filePathChanged, connect(m_chooser, &PathChooser::textChanged,
this, &SysRootKitAspectWidget::pathWasChanged); this, &SysRootKitAspectWidget::pathWasChanged);
} }

View File

@@ -172,7 +172,7 @@ void WorkingDirectoryAspect::addToLayout(LayoutBuilder &builder)
m_chooser->setPromptDialogTitle(tr("Select Working Directory")); m_chooser->setPromptDialogTitle(tr("Select Working Directory"));
m_chooser->setBaseDirectory(m_defaultWorkingDirectory); m_chooser->setBaseDirectory(m_defaultWorkingDirectory);
m_chooser->setFilePath(m_workingDirectory.isEmpty() ? m_defaultWorkingDirectory : m_workingDirectory); m_chooser->setFilePath(m_workingDirectory.isEmpty() ? m_defaultWorkingDirectory : m_workingDirectory);
connect(m_chooser.data(), &PathChooser::filePathChanged, this, [this] { connect(m_chooser.data(), &PathChooser::textChanged, this, [this] {
m_workingDirectory = m_chooser->rawFilePath(); m_workingDirectory = m_chooser->rawFilePath();
m_resetButton->setEnabled(m_workingDirectory != m_defaultWorkingDirectory); m_resetButton->setEnabled(m_workingDirectory != m_defaultWorkingDirectory);
}); });

View File

@@ -87,7 +87,7 @@ public:
m_executable->setExpectedKind(PathChooser::ExistingCommand); m_executable->setExpectedKind(PathChooser::ExistingCommand);
connect(m_name, &QLineEdit::textChanged, this, &InterpreterDetailsWidget::changed); connect(m_name, &QLineEdit::textChanged, this, &InterpreterDetailsWidget::changed);
connect(m_executable, &PathChooser::filePathChanged, this, &InterpreterDetailsWidget::changed); connect(m_executable, &PathChooser::textChanged, this, &InterpreterDetailsWidget::changed);
Form { Form {
Tr::tr("Name:"), m_name, br, Tr::tr("Name:"), m_name, br,

View File

@@ -161,7 +161,7 @@ public:
layout->addRow(tr("Default installation directory:"), &m_defaultInstallDirLineEdit); layout->addRow(tr("Default installation directory:"), &m_defaultInstallDirLineEdit);
layout->addRow(tr("Qbs version:"), &m_versionLabel); layout->addRow(tr("Qbs version:"), &m_versionLabel);
connect(&m_qbsExePathChooser, &PathChooser::filePathChanged, [this] { connect(&m_qbsExePathChooser, &PathChooser::textChanged, [this] {
m_versionLabel.setText(getQbsVersionString()); m_versionLabel.setText(getQbsVersionString());
}); });
} }

View File

@@ -94,12 +94,10 @@ void CmakeProjectConverterDialog::pathValidChanged()
{ {
bool valid = isValid(); bool valid = isValid();
if (valid) { if (valid)
m_newProjectDir = FilePath::fromString(m_dirSelector->path()).pathAppended(m_nameEditor->text()); m_newProjectDir = m_dirSelector->filePath().pathAppended(m_nameEditor->text());
} else
else {
m_newProjectDir = FilePath(); m_newProjectDir = FilePath();
}
const QString error = errorText(); const QString error = errorText();
m_errorLabel->setType(error.isEmpty() ? InfoLabel::None : InfoLabel::Warning); m_errorLabel->setType(error.isEmpty() ? InfoLabel::None : InfoLabel::Warning);

View File

@@ -196,7 +196,7 @@ GenericLinuxDeviceConfigurationWizardKeyDeploymentPage::GenericLinuxDeviceConfig
deployLayout->addWidget(&d->iconLabel); deployLayout->addWidget(&d->iconLabel);
deployLayout->addStretch(); deployLayout->addStretch();
mainLayout->addLayout(deployLayout); mainLayout->addLayout(deployLayout);
connect(&d->keyFileChooser, &PathChooser::filePathChanged, this, [this, deployButton] { connect(&d->keyFileChooser, &PathChooser::textChanged, this, [this, deployButton] {
deployButton->setEnabled(d->keyFileChooser.filePath().exists()); deployButton->setEnabled(d->keyFileChooser.filePath().exists());
d->iconLabel.clear(); d->iconLabel.clear();
emit completeChanged(); emit completeChanged();

View File

@@ -59,7 +59,7 @@ OpenSquishSuitesDialog::OpenSquishSuitesDialog(QWidget *parent)
}.attachTo(this); }.attachTo(this);
connect(m_directoryLineEdit, connect(m_directoryLineEdit,
&Utils::PathChooser::pathChanged, &Utils::PathChooser::textChanged,
this, this,
&OpenSquishSuitesDialog::onDirectoryChanged); &OpenSquishSuitesDialog::onDirectoryChanged);
connect(selectAllPushButton, connect(selectAllPushButton,

View File

@@ -149,8 +149,8 @@ QWidget *FindInFiles::createConfigWidget()
m_directory = new PathChooser; m_directory = new PathChooser;
m_directory->setExpectedKind(PathChooser::ExistingDirectory); m_directory->setExpectedKind(PathChooser::ExistingDirectory);
m_directory->setPromptDialogTitle(tr("Directory to Search")); m_directory->setPromptDialogTitle(tr("Directory to Search"));
connect(m_directory.data(), &PathChooser::filePathChanged, connect(m_directory.data(), &PathChooser::textChanged, this,
this, &FindInFiles::pathChanged); [this] { pathChanged(m_directory->rawFilePath()); });
m_directory->setHistoryCompleter(QLatin1String(HistoryKey), m_directory->setHistoryCompleter(QLatin1String(HistoryKey),
/*restoreLastItemFromHistory=*/ true); /*restoreLastItemFromHistory=*/ true);
if (!HistoryCompleter::historyExistsFor(QLatin1String(HistoryKey))) { if (!HistoryCompleter::historyExistsFor(QLatin1String(HistoryKey))) {

View File

@@ -67,7 +67,7 @@ WebAssemblyOptionsWidget::WebAssemblyOptionsWidget()
m_emSdkPathChooser->setExpectedKind(PathChooser::Directory); m_emSdkPathChooser->setExpectedKind(PathChooser::Directory);
m_emSdkPathChooser->setInitialBrowsePathBackup(FileUtils::homePath()); m_emSdkPathChooser->setInitialBrowsePathBackup(FileUtils::homePath());
m_emSdkPathChooser->setFilePath(WebAssemblyEmSdk::registeredEmSdk()); m_emSdkPathChooser->setFilePath(WebAssemblyEmSdk::registeredEmSdk());
connect(m_emSdkPathChooser, &PathChooser::filePathChanged, connect(m_emSdkPathChooser, &PathChooser::textChanged,
this, &WebAssemblyOptionsWidget::updateStatus); this, &WebAssemblyOptionsWidget::updateStatus);
layout->addWidget(m_emSdkPathChooser); layout->addWidget(m_emSdkPathChooser);
m_emSdkVersionDisplay = new InfoLabel(this); m_emSdkVersionDisplay = new InfoLabel(this);