Merge "Merge remote-tracking branch 'origin/4.14'"

This commit is contained in:
The Qt Project
2021-01-12 14:44:19 +00:00
12 changed files with 68 additions and 29 deletions

View File

@@ -478,6 +478,7 @@ void BackendCommunicator::documentsClosed(const FileContainers &fileContainers)
{
const DocumentsClosedMessage message(fileContainers);
m_sender->documentsClosed(message);
documentVisibilityChanged(); // QTCREATORBUG-25193
}
void BackendCommunicator::unsavedFilesUpdated(const FileContainers &fileContainers)

View File

@@ -4150,6 +4150,9 @@ void GdbEngine::setupInferior()
// Do that first, otherwise no symbols are loaded.
QFileInfo fi = executable.toFileInfo();
QString path = fi.absoluteFilePath();
// This is *not* equivalent to -file-exec-and-symbols. If the file is not executable
// (contains only debugging symbols), this should still work.
runCommand({"-file-exec-file \"" + path + '"'});
runCommand({"-file-symbol-file \"" + path + '"',
CB(handleFileExecAndSymbols)});

View File

@@ -342,10 +342,15 @@ static BuildConfiguration *currentBuildConfiguration()
return target ? target->activeBuildConfiguration() : nullptr;
}
static BuildConfiguration *activeBuildConfiguration()
static Target *activeTarget()
{
const Project * const project = SessionManager::startupProject();
const Target * const target = project ? project->activeTarget() : nullptr;
return project ? project->activeTarget() : nullptr;
}
static BuildConfiguration *activeBuildConfiguration()
{
const Target * const target = activeTarget();
return target ? target->activeBuildConfiguration() : nullptr;
}
@@ -1862,6 +1867,20 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
return project->projectFilePath().toString();
return {};
});
expander->registerVariable("ActiveProject:Kit:Name",
"The name of the active project's active kit.", // TODO: tr()
[]() -> QString {
if (const Target * const target = activeTarget())
return target->kit()->displayName();
return {};
});
expander->registerVariable("ActiveProject:BuildConfig:Name",
"The name of the active project's active build configuration.", // TODO: tr()
[]() -> QString {
if (const BuildConfiguration * const bc = activeBuildConfiguration())
return bc->displayName();
return {};
});
expander->registerVariable("ActiveProject:BuildConfig:Type",
tr("The type of the active project's active build configuration."),
[]() -> QString {

View File

@@ -74,8 +74,8 @@ bool SignalListFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &s
QModelIndex targetIndex = sourceModel()->index(sourceRow, SignalListModel::TargetColumn, sourceParent);
QModelIndex signalIndex = sourceModel()->index(sourceRow, SignalListModel::SignalColumn, sourceParent);
return (sourceModel()->data(targetIndex).toString().contains(filterRegExp())
|| sourceModel()->data(signalIndex).toString().contains(filterRegExp()));
return (sourceModel()->data(targetIndex).toString().contains(filterRegularExpression())
|| sourceModel()->data(signalIndex).toString().contains(filterRegularExpression()));
}

View File

@@ -118,8 +118,14 @@ void SignalListDialog::initialize(QStandardItemModel *model)
header->setStretchLastSection(false);
auto eventFilterFun = [this](const QString &str) {
if (auto *fm = qobject_cast<SignalListFilterModel *>(m_table->model()))
fm->setFilterFixedString(str);
if (auto *fm = qobject_cast<SignalListFilterModel *>(m_table->model())) {
const QRegularExpression::PatternOption option
= fm->filterCaseSensitivity() == Qt::CaseInsensitive
? QRegularExpression::CaseInsensitiveOption
: QRegularExpression::NoPatternOption;
fm->setFilterRegularExpression(
QRegularExpression(QRegularExpression::escape(str), option));
}
};
connect(m_searchLine, &Utils::FancyLineEdit::filterChanged, eventFilterFun);
}