Merge remote-tracking branch 'origin/14.0'

Change-Id: Ic3c53630e16712b6493873d21485b726f0d06574
This commit is contained in:
Eike Ziller
2024-07-08 09:50:18 +02:00
97 changed files with 2201 additions and 1657 deletions

View File

@@ -45,46 +45,32 @@ static bool is32BitUserSpace()
bool startAvdAsync(const QString &avdName)
{
const FilePath emulator = AndroidConfig::emulatorToolPath();
if (!emulator.exists()) {
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [emulator] {
const FilePath emulatorPath = AndroidConfig::emulatorToolPath();
if (!emulatorPath.exists()) {
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [emulatorPath] {
QMessageBox::critical(Core::ICore::dialogParent(),
Tr::tr("Emulator Tool Is Missing"),
Tr::tr("Install the missing emulator tool (%1) to the"
" installed Android SDK.")
.arg(emulator.displayName()));
.arg(emulatorPath.displayName()));
});
return false;
}
// TODO: Here we are potentially leaking Process instance in case when shutdown happens
// after the avdProcess has started and before it has finished. Giving a parent object here
// should solve the issue. However, AndroidAvdManager is not a QObject, so no clue what parent
// would be the most appropriate. Preferably some object taken form android plugin...
Process *avdProcess = new Process;
avdProcess->setProcessChannelMode(QProcess::MergedChannels);
QObject::connect(avdProcess, &Process::done, avdProcess, [avdProcess] {
if (avdProcess->exitCode()) {
const QString errorOutput = QString::fromLatin1(avdProcess->rawStdOut());
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [errorOutput] {
const QString title = Tr::tr("AVD Start Error");
QMessageBox::critical(Core::ICore::dialogParent(), title, errorOutput);
});
}
avdProcess->deleteLater();
});
// start the emulator
CommandLine cmd(emulator);
CommandLine cmd(emulatorPath);
if (is32BitUserSpace())
cmd.addArg("-force-32bit");
cmd.addArgs(AndroidConfig::emulatorArgs(), CommandLine::Raw);
cmd.addArgs({"-avd", avdName});
qCDebug(avdManagerLog).noquote() << "Running command (startAvdAsync):" << cmd.toUserOutput();
avdProcess->setCommand(cmd);
avdProcess->start();
return avdProcess->waitForStarted(QDeadlineTimer::Forever);
if (Process::startDetached(cmd, {}, DetachedChannelMode::Discard))
return true;
QMetaObject::invokeMethod(Core::ICore::mainWindow(), [avdName] {
QMessageBox::critical(Core::ICore::dialogParent(), Tr::tr("AVD Start Error"),
Tr::tr("Failed to start AVD emulator for \"%1\" device.").arg(avdName));
});
return false;
}
QString findAvd(const QString &avdName)

View File

@@ -281,17 +281,17 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles()
FileUtils::copyRecursively(version->prefix() / "src/android/java/AndroidManifest.xml",
m_directory / "AndroidManifest.xml",
nullptr,
copy);
copy());
} else {
FileUtils::copyRecursively(version->prefix() / "src/android/templates",
m_directory,
nullptr,
copy);
copy());
if (m_copyGradle) {
FilePath gradlePath = version->prefix() / "src/3rdparty/gradle";
QTC_ASSERT(gradlePath.exists(), return);
FileUtils::copyRecursively(gradlePath, m_directory, nullptr, copy);
FileUtils::copyRecursively(gradlePath, m_directory, nullptr, copy());
}
}

View File

@@ -158,8 +158,6 @@ void generateCompilationDB(
{
QTC_ASSERT(!baseDir.isEmpty(),
promise.addResult(make_unexpected(Tr::tr("Could not retrieve build directory."))); return);
QTC_ASSERT(!projectInfoList.isEmpty(),
promise.addResult(make_unexpected(Tr::tr("Could not retrieve project info."))); return);
QTC_CHECK(baseDir.ensureWritableDir());
QFile compileCommandsFile(baseDir.pathAppended("compile_commands.json").toFSPathString());
const bool fileOpened = compileCommandsFile.open(QIODevice::WriteOnly | QIODevice::Truncate);

View File

@@ -26,6 +26,43 @@ namespace CMakeProjectManager::Internal {
BuildDirParameters::BuildDirParameters() = default;
static void updateCMakePathsFromQMake(QStringList &initialCMakeArguments)
{
const CMakeConfigItem qmake = CMakeConfigItem::fromString(
Utils::findOrDefault(initialCMakeArguments, [](const QString &arg) {
return arg.startsWith("-DQT_QMAKE_EXECUTABLE");
}));
const FilePath qmakeFilePath = FilePath::fromUtf8(qmake.value);
if (qmakeFilePath.isEmpty())
return;
// ~Qt/6.x/platform/bin/qmake -> ~Qt/6.x/platform
const QByteArray qmakePrefixPath = qmakeFilePath.parentDir().parentDir().toString().toUtf8();
const QByteArrayList cmakePathsVariables = {"CMAKE_PREFIX_PATH", "CMAKE_FIND_ROOT_PATH"};
for (const QByteArray &var : cmakePathsVariables) {
const QString varPrefix = QString("-D") + var;
auto it = std::find_if(
initialCMakeArguments.begin(),
initialCMakeArguments.end(),
[varPrefix](const QString &arg) { return arg.startsWith(varPrefix); });
if (it == initialCMakeArguments.end())
continue;
CMakeConfigItem cmakeVar = CMakeConfigItem::fromString(*it);
if (cmakeVar.isNull())
continue;
if (cmakeVar.value.isEmpty())
cmakeVar.value = qmakePrefixPath;
else
cmakeVar.value += ";" + qmakePrefixPath;
*it = cmakeVar.toString();
}
}
BuildDirParameters::BuildDirParameters(CMakeBuildSystem *buildSystem)
{
QTC_ASSERT(buildSystem, return);
@@ -40,6 +77,11 @@ BuildDirParameters::BuildDirParameters(CMakeBuildSystem *buildSystem)
});
initialCMakeArguments = Utils::filtered(expandedArguments,
[](const QString &s) { return !s.isEmpty(); });
const bool noQtInstallPrefix = expander->expand(QString("%{Qt:QT_INSTALL_PREFIX}")).isEmpty();
if (noQtInstallPrefix)
updateCMakePathsFromQMake(initialCMakeArguments);
configurationChangesArguments = Utils::transform(buildSystem->configurationChangesArguments(),
[this](const QString &s) {
return expander->expand(s);

View File

@@ -534,29 +534,27 @@ void EditorView::cutForwardNavigationHistory()
void EditorView::updateNavigatorActions()
{
static const int MAX_ITEMS = 20;
FilePath last;
QString lastDisplay;
m_backMenu->clear();
int count = 0;
for (int i = m_currentNavigationHistoryPosition - 1; i >= 0; i--) {
const EditLocation &loc = m_navigationHistory.at(i);
if (loc.filePath != last) {
m_backMenu->addAction(loc.displayName(), this, [this, i] { goToNavigationHistory(i); });
last = loc.filePath;
if (!loc.displayName().isEmpty() && loc.displayName() != lastDisplay) {
lastDisplay = loc.displayName();
m_backMenu->addAction(lastDisplay, this, [this, i] { goToNavigationHistory(i); });
++count;
if (count >= MAX_ITEMS)
break;
}
}
last = {};
lastDisplay.clear();
m_forwardMenu->clear();
count = 0;
for (int i = m_currentNavigationHistoryPosition + 1; i < m_navigationHistory.size(); i++) {
const EditLocation &loc = m_navigationHistory.at(i);
if (loc.filePath != last) {
m_forwardMenu->addAction(loc.displayName(), this, [this, i] {
goToNavigationHistory(i);
});
last = loc.filePath;
if (!loc.displayName().isEmpty() && loc.displayName() != lastDisplay) {
lastDisplay = loc.displayName();
m_forwardMenu->addAction(lastDisplay, this, [this, i] { goToNavigationHistory(i); });
++count;
if (count >= MAX_ITEMS)
break;

View File

@@ -425,11 +425,12 @@ bool executePluginInstallWizard(const FilePath &archive)
return copyPluginFile(data.sourcePath, installPath);
} else {
QString error;
FileUtils::CopyAskingForOverwrite copy(ICore::dialogParent(),
postCopyOperation());
if (!FileUtils::copyRecursively(data.extractedPath,
installPath,
&error,
FileUtils::CopyAskingForOverwrite(ICore::dialogParent(),
postCopyOperation()))) {
copy())) {
QMessageBox::warning(ICore::dialogParent(),
Tr::tr("Failed to Copy Plugin Files"),
error);

View File

@@ -298,7 +298,7 @@ constexpr TextFormat searchBoxPlaceholderTF
static const QPixmap &searchBoxIcon()
{
static const QPixmap icon = Icon({{FilePath::fromString(":/core/images/search"),
static const QPixmap icon = Icon({{FilePath::fromString(":/core/images/search.png"),
Theme::Token_Text_Muted}}, Icon::Tint).pixmap();
return icon;
}
@@ -383,7 +383,7 @@ constexpr TextFormat ComboBoxTf
static const QPixmap &comboBoxIcon()
{
static const QPixmap icon = Icon({{FilePath::fromString(":/core/images/expandarrow"),
static const QPixmap icon = Icon({{FilePath::fromString(":/core/images/expandarrow.png"),
ComboBoxTf.themeColor}}, Icon::Tint).pixmap();
return icon;
}

View File

@@ -154,6 +154,18 @@ public:
QHash<QString, PerspectiveState> m_lastTypePerspectiveStates; // Perspective::settingsId() -> MainWindow::state()
};
class TweakedCombo : public QComboBox // ensures that all items of the popup are readable
{
public:
explicit TweakedCombo(QWidget *parent = nullptr) : QComboBox(parent) {}
void showPopup() override
{
QTC_ASSERT(view(), return);
view()->setMinimumWidth(view()->sizeHintForColumn(0));
QComboBox::showPopup();
}
};
DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent)
: q(parent)
{
@@ -164,7 +176,7 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *parent)
m_statusLabel->setIndent(2 * QFontMetrics(q->font()).horizontalAdvance(QChar('x')));
m_editorPlaceHolder = new EditorManagerPlaceHolder;
m_perspectiveChooser = new QComboBox;
m_perspectiveChooser = new TweakedCombo;
m_perspectiveChooser->setObjectName("PerspectiveChooser");
StyleHelper::setPanelWidget(m_perspectiveChooser);
m_perspectiveChooser->setSizeAdjustPolicy(QComboBox::AdjustToContents);

View File

@@ -10,8 +10,6 @@
#include "effectutils.h"
#include "propertyhandler.h"
//#include "qmldesigner/designercore/imagecache/midsizeimagecacheprovider.h"
#include "theme.h"
#include <coreplugin/icore.h>
#include <coreplugin/idocument.h>
@@ -20,6 +18,7 @@
#include <qmldesigner/documentmanager.h>
#include <qmldesigner/qmldesignerconstants.h>
#include <qmldesigner/qmldesignerplugin.h>
#include <qmldesigner/components/componentcore/theme.h>
#include <studioquickwidget.h>
#include <qmljs/qmljsmodelmanagerinterface.h>

View File

@@ -375,7 +375,10 @@ static QString searchText(const QModelIndex &index)
QStringList searchTexts;
searchTexts.append(index.data(RoleName).toString());
searchTexts.append(index.data(RoleTags).toStringList());
searchTexts.append(index.data(RoleDescriptionText).toStringList());
for (const auto &data : index.data(RoleDescriptionText).value<TextData>()) {
searchTexts.append(data.first);
searchTexts.append(data.second);
}
searchTexts.append(index.data(RoleVendor).toString());
return searchTexts.join(" ");
}

View File

@@ -136,6 +136,9 @@ bool HelpViewer::launchWithExternalApp(const QUrl &url)
// QHelpEngineCore::findFile returns a valid url even though the file does not exist
if (resolvedUrl.scheme() == "about" && resolvedUrl.path() == "blank")
return false;
// fake items have no associated file - they are kind of virtual folders
if (resolvedUrl.fileName().isEmpty())
return false;
const QString& path = resolvedUrl.path();
if (!canOpenPage(path)) {

View File

@@ -47,6 +47,11 @@ QtcPlugin {
condition: qbs.toolchain.contains("msvc")
cpp.cxxFlags: "/bigobj"
}
Properties {
condition: qbs.toolchain.contains("mingw")
cpp.cxxFlags: "-Wa,-mbig-obj"
}
}
Group {

View File

@@ -284,7 +284,7 @@ public:
if (!result) {
qWarning() << "Failed to load plugin" << script << ":" << result.error();
MessageManager::writeFlashing(tr("Failed to load plugin %1: %2")
MessageManager::writeFlashing(Tr::tr("Failed to load plugin %1: %2")
.arg(script.toUserOutput())
.arg(result.error()));
continue;

View File

@@ -196,11 +196,11 @@ bool AbstractProcessStep::setupProcess(Process &process)
? QTextCodec::codecForName("UTF-8") : QTextCodec::codecForLocale());
process.setStdErrCodec(QTextCodec::codecForLocale());
process.setStdOutLineCallback([this](const QString &s){
process.setStdOutCallback([this](const QString &s){
emit addOutput(s, OutputFormat::Stdout, DontAppendNewline);
});
process.setStdErrLineCallback([this](const QString &s){
process.setStdErrCallback([this](const QString &s){
emit addOutput(s, OutputFormat::Stderr, DontAppendNewline);
});

View File

@@ -857,8 +857,11 @@ QStringList GccToolchain::suggestedMkspecList() const
return {QString("linux-icc-%1").arg(targetAbi().wordWidth())};
if (m_subType == MinGW) {
if (HostOsInfo::isWindowsHost())
if (HostOsInfo::isWindowsHost()) {
if (compilerCommand().fileName().contains("clang"))
return {"win32-clang-g++"};
return {"win32-g++"};
}
if (HostOsInfo::isLinuxHost()) {
if (version().startsWith("4.6."))
return {"win32-g++-4.6-cross", "unsupported/win32-g++-4.6-cross"};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 B

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 B

After

Width:  |  Height:  |  Size: 151 B

View File

@@ -364,7 +364,7 @@ public:
: bgR.height()));
const QSize iconS = icon().deviceIndependentSize().toSize();
static const QPixmap arrow = Icon({{FilePath::fromString(":/core/images/expandarrow"),
static const QPixmap arrow = Icon({{FilePath::fromString(":/core/images/expandarrow.png"),
Theme::Token_Text_Muted}}, Icon::Tint).pixmap();
const QSize arrowS = arrow.deviceIndependentSize().toSize();
const bool arrowVisible = hovered || expanded;

View File

@@ -393,7 +393,7 @@ void DebugView::auxiliaryDataChanged(const ModelNode &node,
message << node;
message << key.type;
message << QByteArray{key.name};
message << key.name.toByteArray();
message << data.toString();
log("::auxiliaryDataChanged:", string);

View File

@@ -315,7 +315,7 @@ void MaterialEditorQmlBackend::emitSelectionChanged()
void MaterialEditorQmlBackend::setValueforAuxiliaryProperties(const QmlObjectNode &qmlObjectNode,
AuxiliaryDataKeyView key)
{
const PropertyName propertyName = auxNamePostFix(PropertyName(key.name));
const PropertyName propertyName = auxNamePostFix(key.name.toByteArray());
setValue(qmlObjectNode, propertyName, qmlObjectNode.modelNode().auxiliaryDataWithDefault(key));
}

View File

@@ -126,7 +126,7 @@ void PropertyEditorQmlBackend::setupPropertyEditorValue(const PropertyName &name
namespace {
PropertyName auxNamePostFix(Utils::SmallStringView propertyName)
{
return PropertyName(propertyName) + "__AUX";
return PropertyNameView(propertyName) + "__AUX";
}
QVariant properDefaultAuxiliaryProperties(const QmlObjectNode &qmlObjectNode,

View File

@@ -276,7 +276,7 @@ void TextureEditorQmlBackend::emitSelectionChanged()
void TextureEditorQmlBackend::setValueforAuxiliaryProperties(const QmlObjectNode &qmlObjectNode,
AuxiliaryDataKeyView key)
{
const PropertyName propertyName = auxNamePostFix(PropertyName(key.name));
const PropertyName propertyName = auxNamePostFix(key.name.toByteArray());
setValue(qmlObjectNode, propertyName, qmlObjectNode.modelNode().auxiliaryDataWithDefault(key));
}

View File

@@ -67,6 +67,7 @@
#include <projectstorage/projectstorage.h>
#include <utils/hdrimage.h>
#include <utils/smallstringview.h>
#include <coreplugin/messagemanager.h>
@@ -93,6 +94,7 @@
#include <QPicture>
#include <QTimerEvent>
#include <QUrl>
#include <QByteArray>
enum {
debug = false
@@ -634,10 +636,11 @@ void NodeInstanceView::auxiliaryDataChanged(const ModelNode &node,
case AuxiliaryDataType::Document:
if ((key == lockedProperty || key == invisibleProperty) && hasInstanceForModelNode(node)) {
NodeInstance instance = instanceForModelNode(node);
PropertyValueContainer container{instance.instanceId(),
PropertyName{key.name},
key.name,
value,
TypeName(),
{},
key.type};
m_nodeInstanceServer->changeAuxiliaryValues({{container}});
}
@@ -647,7 +650,7 @@ void NodeInstanceView::auxiliaryDataChanged(const ModelNode &node,
if (hasInstanceForModelNode(node)) {
NodeInstance instance = instanceForModelNode(node);
PropertyValueContainer container{instance.instanceId(),
PropertyName{key.name},
key.name,
value,
TypeName(),
key.type};
@@ -660,13 +663,13 @@ void NodeInstanceView::auxiliaryDataChanged(const ModelNode &node,
NodeInstance instance = instanceForModelNode(node);
if (value.isValid()) {
PropertyValueContainer container{instance.instanceId(),
PropertyName{key.name},
key.name,
value,
TypeName(),
key.type};
m_nodeInstanceServer->changeAuxiliaryValues({{container}});
} else {
PropertyName name{key.name};
const PropertyName name = key.name.toByteArray();
if (node.hasVariantProperty(name)) {
PropertyValueContainer container(instance.instanceId(),
name,

View File

@@ -4347,7 +4347,7 @@ PropertyName PropertyMetaInfo::name() const
category(),
keyValue("property declaration id", m_id)};
return PropertyName(Utils::SmallStringView(propertyData().name));
return propertyData().name.toQByteArray();
} else {
return propertyName();
}

View File

@@ -51,12 +51,12 @@ public:
using Pointer = std::shared_ptr<InternalNode>;
using WeakPointer = std::weak_ptr<InternalNode>;
explicit InternalNode(TypeName typeName,
explicit InternalNode(TypeNameView typeName,
int majorVersion,
int minorVersion,
qint32 internalId,
ModelTracing::Category::FlowTokenType flowTraceToken)
: typeName(std::move(typeName))
: typeName(typeName.toByteArray())
, majorVersion(majorVersion)
, minorVersion(minorVersion)
, isValid(true)

View File

@@ -109,7 +109,7 @@ ModelPrivate::ModelPrivate(Model *model,
changeImports(std::move(imports), {});
m_rootInternalNode = createNode(
TypeName{typeName}, -1, -1, {}, {}, {}, ModelNode::NodeWithoutSource, {}, true);
typeName, -1, -1, {}, {}, {}, ModelNode::NodeWithoutSource, {}, true);
m_currentStateNode = m_rootInternalNode;
m_currentTimelineNode = m_rootInternalNode;
@@ -285,7 +285,7 @@ void ModelPrivate::changeNodeType(const InternalNodePointer &node, const TypeNam
}
}
InternalNodePointer ModelPrivate::createNode(const TypeName &typeName,
InternalNodePointer ModelPrivate::createNode(TypeNameView typeName,
int majorVersion,
int minorVersion,
const QList<QPair<PropertyName, QVariant>> &propertyList,

View File

@@ -125,7 +125,7 @@ public:
const QUrl &fileUrl() const;
void setFileUrl(const QUrl &url);
InternalNodePointer createNode(const TypeName &typeName,
InternalNodePointer createNode(TypeNameView typeName,
int majorVersion,
int minorVersion,
const QList<QPair<PropertyName, QVariant>> &propertyList,

View File

@@ -767,7 +767,7 @@ void QmlJSEditorDocumentPrivate::settingsChanged()
qCDebug(qmllsLog) << "disabling qmlls for" << q->filePath();
if (Client *client = LanguageClientManager::clientForDocument(q)) {
qCDebug(qmllsLog) << "deactivating " << q->filePath() << "in qmlls" << newQmlls;
client->deactivateDocument(q);
LanguageClientManager::openDocumentWithClient(q, nullptr);
} else
qCWarning(qmllsLog) << "Could not find client to disable for document " << q->filePath()
<< " in LanguageClient::LanguageClientManager";

View File

@@ -5,6 +5,7 @@
#include "remotelinuxtr.h"
#include <projectexplorer/projectexplorersettings.h>
#include <utils/commandline.h>
#include <utils/fileutils.h>
#include <utils/qtcprocess.h>
@@ -50,8 +51,10 @@ static QString signalProcessGroupByNameCommandLine(const QString &filePath, int
QString RemoteLinuxSignalOperation::killProcessByNameCommandLine(const QString &filePath) const
{
return QString::fromLatin1("%1; %2").arg(signalProcessGroupByNameCommandLine(filePath, 15),
signalProcessGroupByNameCommandLine(filePath, 9));
return QString::fromLatin1("%1; sleep %2; %3")
.arg(signalProcessGroupByNameCommandLine(filePath, 15))
.arg(projectExplorerSettings().reaperTimeoutInSeconds)
.arg(signalProcessGroupByNameCommandLine(filePath, 9));
}
QString RemoteLinuxSignalOperation::interruptProcessByNameCommandLine(const QString &filePath) const