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

This commit is contained in:
The Qt Project
2021-03-25 10:48:57 +00:00
143 changed files with 986 additions and 1081 deletions

View File

@@ -237,7 +237,7 @@ ClangTextMark::ClangTextMark(const FilePath &fileName,
QVector<QAction *> actions;
QAction *action = new QAction();
action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon()));
action->setToolTip(tr("Copy to Clipboard"));
action->setToolTip(QApplication::translate("Clang Code Model Marks", "Copy to Clipboard"));
QObject::connect(action, &QAction::triggered, [diagnostic]() {
const QString text = ClangDiagnosticWidget::createText({diagnostic},
ClangDiagnosticWidget::InfoBar);
@@ -250,7 +250,8 @@ ClangTextMark::ClangTextMark(const FilePath &fileName,
if (project && isDiagnosticConfigChangable(project, diagnostic)) {
action = new QAction();
action->setIcon(Icons::BROKEN.icon());
action->setToolTip(tr("Disable Diagnostic in Current Project"));
action->setToolTip(QApplication::translate("Clang Code Model Marks",
"Disable Diagnostic in Current Project"));
QObject::connect(action, &QAction::triggered, [diagnostic]() {
disableDiagnosticInCurrentProjectConfig(diagnostic);
});

View File

@@ -38,8 +38,10 @@
#include <android/androidconstants.h>
#include <ios/iosconstants.h>
#include <webassembly/webassemblyconstants.h>
#include <coreplugin/find/itemviewfind.h>
#include <coreplugin/icore.h>
#include <projectexplorer/buildaspects.h>
#include <projectexplorer/buildinfo.h>
@@ -58,6 +60,7 @@
#include <utils/algorithm.h>
#include <utils/categorysortfiltermodel.h>
#include <utils/checkablemessagebox.h>
#include <utils/detailswidget.h>
#include <utils/headerviewstretcher.h>
#include <utils/infolabel.h>
@@ -94,11 +97,15 @@ static Q_LOGGING_CATEGORY(cmakeBuildConfigurationLog, "qtc.cmake.bc", QtWarningM
const char CONFIGURATION_KEY[] = "CMake.Configuration";
const char DEVELOPMENT_TEAM_FLAG[] = "Ios:DevelopmentTeam:Flag";
const char PROVISIONING_PROFILE_FLAG[] = "Ios:ProvisioningProfile:Flag";
const char CMAKE_QT6_TOOLCHAIN_FILE_ARG[] =
"-DCMAKE_TOOLCHAIN_FILE:PATH=%{Qt:QT_INSTALL_PREFIX}/lib/cmake/Qt6/qt.toolchain.cmake";
namespace Internal {
class CMakeBuildSettingsWidget : public NamedWidget
{
Q_DECLARE_TR_FUNCTIONS(CMakeProjectManager::Internal::CMakeBuildSettingsWidget)
public:
CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc);
@@ -178,6 +185,34 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
m_configModel->flush(); // clear out config cache...;
});
auto clearCMakeConfiguration = new QPushButton(tr("Re-configure with Initial Parameters"));
connect(clearCMakeConfiguration, &QPushButton::clicked, this, [bc]() {
auto *settings = CMakeProjectPlugin::projectTypeSpecificSettings();
bool doNotAsk{!settings->askBeforeReConfigureInitialParams()};
if (!doNotAsk) {
QDialogButtonBox::StandardButton reply = Utils::CheckableMessageBox::question(
nullptr,
tr("Re-configure with Initial Parameters"),
tr("Clear CMake configuration and configure with initial parameters?"),
tr("Do not ask again"),
&doNotAsk,
QDialogButtonBox::Yes | QDialogButtonBox::No,
QDialogButtonBox::Yes);
settings->setAskBeforeReConfigureInitialParams(!doNotAsk);
settings->toSettings(Core::ICore::settings());
if (reply != QDialogButtonBox::Yes) {
return;
}
}
auto cbc = static_cast<CMakeBuildSystem*>(bc->buildSystem());
cbc->clearCMakeCache();
if (ProjectExplorerPlugin::saveModifiedFiles())
cbc->runCMake();
});
auto buildTypeAspect = bc->aspect<BuildTypeAspect>();
connect(buildTypeAspect, &BaseAspect::changed, this, [this, buildTypeAspect]() {
if (!m_buildConfiguration->isMultiConfig()) {
@@ -309,6 +344,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
buildDirAspect,
bc->aspect<InitialCMakeArgumentsAspect>(),
bc->aspect<BuildTypeAspect>(),
QString(), clearCMakeConfiguration,
qmlDebugAspect
},
Space(10),
@@ -427,7 +463,11 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
this, &CMakeBuildSettingsWidget::updateFromKit);
connect(m_buildConfiguration, &CMakeBuildConfiguration::enabledChanged,
this, [this]() {
setError(m_buildConfiguration->disabledReason());
if (m_buildConfiguration->isEnabled())
setError(QString());
m_batchEditButton->setEnabled(m_buildConfiguration->isEnabled());
m_addButton->setEnabled(m_buildConfiguration->isEnabled());
});
updateSelection();
@@ -744,6 +784,11 @@ static bool isIos(const Kit *k)
|| deviceType == Ios::Constants::IOS_SIMULATOR_TYPE;
}
static bool isWebAssembly(const Kit *k)
{
return DeviceTypeKitAspect::deviceTypeId(k) == WebAssembly::Constants::WEBASSEMBLY_DEVICE_TYPE;
}
static QStringList defaultInitialCMakeArguments(const Kit *k, const QString buildType)
{
// Generator:
@@ -909,8 +954,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
const QString sysroot = deviceType == Ios::Constants::IOS_DEVICE_TYPE
? QLatin1String("iphoneos")
: QLatin1String("iphonesimulator");
initialArgs.append("-DCMAKE_TOOLCHAIN_FILE:PATH=%{Qt:QT_INSTALL_PREFIX}/lib/cmake/"
"Qt6/qt.toolchain.cmake");
initialArgs.append(CMAKE_QT6_TOOLCHAIN_FILE_ARG);
initialArgs.append("-DCMAKE_OSX_ARCHITECTURES:STRING=" + architecture);
initialArgs.append("-DCMAKE_OSX_SYSROOT:STRING=" + sysroot);
initialArgs.append("%{" + QLatin1String(DEVELOPMENT_TEAM_FLAG) + "}");
@@ -918,6 +962,12 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
}
}
if (isWebAssembly(k)) {
const QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k);
if (qt && qt->qtVersion().majorVersion >= 6)
initialArgs.append(CMAKE_QT6_TOOLCHAIN_FILE_ARG);
}
if (info.buildDirectory.isEmpty()) {
setBuildDirectory(shadowBuildDirectory(target->project()->projectFilePath(),
k,

View File

@@ -541,13 +541,18 @@ void CMakeBuildSystem::clearCMakeCache()
stopParsingAndClearState();
const FilePath cmakeCache = m_parameters.workDirectory / "CMakeCache.txt";
const FilePath cmakeFiles = m_parameters.workDirectory / "CMakeFiles";
const QList<FilePath> pathsToDelete = {
m_parameters.workDirectory / "CMakeCache.txt",
m_parameters.workDirectory / "CMakeCache.txt.prev",
m_parameters.workDirectory / "CMakeFiles",
m_parameters.workDirectory / ".cmake/api/v1/reply",
m_parameters.workDirectory / ".cmake/api/v1/reply.prev"
};
if (cmakeCache.exists())
Utils::FileUtils::removeRecursively(cmakeCache);
if (cmakeFiles.exists())
Utils::FileUtils::removeRecursively(cmakeFiles);
for (const FilePath &path : pathsToDelete) {
if (path.exists())
Utils::FileUtils::removeRecursively(path);
}
}
std::unique_ptr<CMakeProjectNode> CMakeBuildSystem::generateProjectTree(

View File

@@ -35,6 +35,8 @@ namespace Internal {
class CMakeProjectImporter : public QtSupport::QtProjectImporter
{
Q_DECLARE_TR_FUNCTIONS(CMakeProjectManager::Internal::CMakeProjectImporter)
public:
CMakeProjectImporter(const Utils::FilePath &path);

View File

@@ -33,6 +33,7 @@ static const char SETTINGS_KEY[] = "CMakeSpecificSettings";
static const char AFTER_ADD_FILE_ACTION_KEY[] = "ProjectPopupSetting";
static const char NINJA_PATH[] = "NinjaPath";
static const char PACKAGE_MANAGER_AUTO_SETUP[] = "PackageManagerAutoSetup";
static const char ASK_RECONFIGURE_INITIAL_PARAMS[] = "AskReConfigureInitialParams";
}
void CMakeSpecificSettings::fromSettings(QSettings *settings)
@@ -53,6 +54,7 @@ void CMakeSpecificSettings::toSettings(QSettings *settings) const
settings->beginGroup(QString(SETTINGS_KEY));
settings->setValue(QString(AFTER_ADD_FILE_ACTION_KEY), static_cast<int>(m_afterAddFileToProjectSetting));
settings->setValue(QString(PACKAGE_MANAGER_AUTO_SETUP), m_packageManagerAutoSetup);
settings->setValue(QString(ASK_RECONFIGURE_INITIAL_PARAMS), m_askBeforeReConfigureInitialParams);
settings->endGroup();
}
}

View File

@@ -53,10 +53,13 @@ public:
void setPackageManagerAutoSetup(bool checked) { m_packageManagerAutoSetup = checked; }
bool packageManagerAutoSetup() const { return m_packageManagerAutoSetup; }
bool askBeforeReConfigureInitialParams() const { return m_askBeforeReConfigureInitialParams; }
void setAskBeforeReConfigureInitialParams(bool doAsk) { m_askBeforeReConfigureInitialParams = doAsk; }
private:
AfterAddFileAction m_afterAddFileToProjectSetting;
Utils::FilePath m_ninjaPath;
bool m_packageManagerAutoSetup = true;
bool m_askBeforeReConfigureInitialParams = true;
};
}

View File

@@ -72,6 +72,7 @@ CMakeSpecificSettingWidget::CMakeSpecificSettingWidget(CMakeSpecificSettings *se
}
m_ui.packageManagerAutoSetup->setChecked(settings->packageManagerAutoSetup());
m_ui.askBeforeReConfigureWithInitialParams->setChecked(settings->askBeforeReConfigureInitialParams());
}
void CMakeSpecificSettingWidget::apply()
@@ -80,6 +81,7 @@ void CMakeSpecificSettingWidget::apply()
m_settings->setAfterAddFileSetting(popupSetting == -1 ? AfterAddFileAction::ASK_USER
: static_cast<AfterAddFileAction>(popupSetting));
m_settings->setPackageManagerAutoSetup(m_ui.packageManagerAutoSetup->isChecked());
m_settings->setAskBeforeReConfigureInitialParams(m_ui.askBeforeReConfigureWithInitialParams->isChecked());
m_settings->toSettings(Core::ICore::settings());
}

View File

@@ -70,6 +70,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="askBeforeReConfigureWithInitialParams">
<property name="text">
<string>Ask before re-configuring with initial parameters</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">

View File

@@ -896,7 +896,21 @@ FileApiData FileApiParser::parseData(const QFileInfo &replyFileInfo, const QStri
return QString::compare(cfg.name, cmakeBuildType, Qt::CaseInsensitive) == 0;
});
if (it == codeModels.cend()) {
errorMessage = QString("No '%1' CMake configuration found!").arg(cmakeBuildType);
QStringList buildTypes;
for (const Configuration &cfg: codeModels)
buildTypes << cfg.name;
if (result.replyFile.isMultiConfig) {
errorMessage = tr("No \"%1\" CMake configuration found. Available configurations: \"%2\".\n"
"Make sure that CMAKE_CONFIGURATION_TYPES variable contains the \"Build type\" field.")
.arg(cmakeBuildType)
.arg(buildTypes.join(", "));
} else {
errorMessage = tr("No \"%1\" CMake configuration found. Available configuration: \"%2\".\n"
"Make sure that CMAKE_BUILD_TYPE variable matches the \"Build type\" field.")
.arg(cmakeBuildType)
.arg(buildTypes.join(", "));
}
qWarning() << errorMessage;
return result;
}

View File

@@ -245,6 +245,7 @@ public:
class FileApiParser
{
Q_DECLARE_TR_FUNCTIONS(FileApiParser)
public:
static FileApiData parseData(const QFileInfo &replyFileInfo, const QString& cmakeBuildType,
QString &errorMessage);

View File

@@ -125,11 +125,12 @@ static const char preferredEditorFactoriesKey[] = "EditorManager/PreferredEditor
static const char scratchBufferKey[] = "_q_emScratchBuffer";
// for lupdate
using namespace Core;
using namespace Core::Internal;
using namespace Utils;
namespace Core {
//===================EditorManager=====================
/*!
@@ -3876,5 +3877,3 @@ void CorePlugin::testSplitLineAndColumnNumber_data()
}
#endif // WITH_TESTS
} // namespace Core

View File

@@ -8530,7 +8530,7 @@ public:
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
switch (section) {
case 0:
return tr("Base Class Constructors");
return CppQuickFixFactory::tr("Base Class Constructors");
}
}
return {};

View File

@@ -177,13 +177,13 @@ class Filter : public Core::SearchResultFilter
const auto widget = new QWidget;
const auto layout = new QVBoxLayout(widget);
layout->setContentsMargins(0, 0, 0, 0);
const auto readsCheckBox = new QCheckBox(tr("Reads"));
const auto readsCheckBox = new QCheckBox(CppFindReferences::tr("Reads"));
readsCheckBox->setChecked(m_showReads);
const auto writesCheckBox = new QCheckBox(tr("Writes"));
const auto writesCheckBox = new QCheckBox(CppFindReferences::tr("Writes"));
writesCheckBox->setChecked(m_showWrites);
const auto declsCheckBox = new QCheckBox(tr("Declarations"));
const auto declsCheckBox = new QCheckBox(CppFindReferences::tr("Declarations"));
declsCheckBox->setChecked(m_showDecls);
const auto otherCheckBox = new QCheckBox(tr("Other"));
const auto otherCheckBox = new QCheckBox(CppFindReferences::tr("Other"));
otherCheckBox->setChecked(m_showOther);
layout->addWidget(readsCheckBox);
layout->addWidget(writesCheckBox);

View File

@@ -193,7 +193,7 @@ LanguageClientSettingsPageWidget::LanguageClientSettingsPageWidget(LanguageClien
auto addMenu = new QMenu;
addMenu->clear();
for (const ClientType &type : clientTypes()) {
auto action = new QAction(tr("New %1").arg(type.name));
auto action = new QAction(LanguageClientSettingsPage::tr("New %1").arg(type.name));
connect(action, &QAction::triggered, this, [this, id = type.id]() { addItem(id); });
addMenu->addAction(action);
}

View File

@@ -235,7 +235,7 @@ LspLogWidget::LspLogWidget()
m_clientDetails = new MessageDetailWidget;
m_clientDetails->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_clientDetails->setTitle(tr("Client Message"));
m_clientDetails->setTitle(LspInspector::tr("Client Message"));
addWidget(m_clientDetails);
setStretchFactor(0, 1);
@@ -243,7 +243,7 @@ LspLogWidget::LspLogWidget()
m_messages = new QListView;
m_messages->setModel(&m_model);
m_messages->setAlternatingRowColors(true);
m_model.setHeader({tr("Messages")});
m_model.setHeader({LspInspector::tr("Messages")});
m_messages->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
m_messages->setSelectionMode(QAbstractItemView::MultiSelection);
addWidget(m_messages);
@@ -251,7 +251,7 @@ LspLogWidget::LspLogWidget()
m_serverDetails = new MessageDetailWidget;
m_serverDetails->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
m_serverDetails->setTitle(tr("Server Message"));
m_serverDetails->setTitle(LspInspector::tr("Server Message"));
addWidget(m_serverDetails);
setStretchFactor(2, 1);
@@ -341,7 +341,7 @@ void LspLogWidget::saveLog()
stream << "\n\n";
});
const QString fileName = QFileDialog::getSaveFileName(this, tr("Log File"));
const QString fileName = QFileDialog::getSaveFileName(this, LspInspector::tr("Log File"));
if (fileName.isEmpty())
return;
Utils::FileSaver saver(fileName, QIODevice::Text);

View File

@@ -743,7 +743,7 @@ QMakeStepFactory::QMakeStepFactory()
setSupportedConfiguration(Constants::QMAKE_BC_ID);
setSupportedStepList(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
//: QMakeStep default display name
setDisplayName(QMakeStep::tr("qmake"));
setDisplayName(::QmakeProjectManager::QMakeStep::tr("qmake"));
setFlags(BuildStepInfo::UniqueStep);
}

View File

@@ -33,6 +33,7 @@
#include "rewriterview.h"
#include "qmlitemnode.h"
#include "qmlobjectnode.h"
#include "coreplugin/editormanager/editormanager.h"
#include "utils/qtcassert.h"
#include "utils/runextensions.h"
#include "variantproperty.h"
@@ -307,6 +308,16 @@ void AssetExporter::preprocessQmlFile(const Utils::FilePath &path)
.arg(path.toString()).arg(saver.errorString()));
return;
}
// Close the document if already open.
// UUIDS are changed and editor must reopen the document, otherwise stale state of the
// document is loaded.
for (Core::IDocument *doc : Core::DocumentModel::openedDocuments()) {
if (doc->filePath() == path) {
Core::EditorManager::closeDocuments({doc}, false);
break;
}
}
}
// Cache component UUID

View File

@@ -96,7 +96,8 @@ void SignalList::prepareDialog()
m_dialog = new SignalListDialog(Core::ICore::dialogParent());
m_dialog->setAttribute(Qt::WA_DeleteOnClose);
m_dialog->initialize(m_model);
m_dialog->setWindowTitle(tr("Signal List for ") + m_modelNode.validId());
m_dialog->setWindowTitle(::QmlDesigner::SignalList::tr("Signal List for ")
+ m_modelNode.validId());
auto *delegate = static_cast<SignalListDelegate *>(m_dialog->tableView()->itemDelegate());
connect(delegate, &SignalListDelegate::connectClicked, this, &SignalList::connectClicked);

View File

@@ -141,6 +141,15 @@ void ItemLibraryAddImportModel::update(const QList<Import> &possibleImports)
endResetModel();
}
Import ItemLibraryAddImportModel::getImport(const QString &importUrl) const
{
for (const Import &import : std::as_const(m_importList))
if (import.url() == importUrl)
return import;
return {};
}
void ItemLibraryAddImportModel::setSearchText(const QString &searchText)
{
QString lowerSearchText = searchText.toLower();

View File

@@ -51,6 +51,7 @@ public:
Import getImportAt(int index) const;
void setPriorityImports(const QSet<QString> &priorityImports);
Import getImport(const QString &importUrl) const;
private:
QString m_searchText;

View File

@@ -60,7 +60,7 @@ QObject *ItemLibraryCategory::itemModel()
return &m_itemModel;
}
bool ItemLibraryCategory::updateItemVisibility(const QString &searchText, bool *changed, bool expand)
bool ItemLibraryCategory::updateItemVisibility(const QString &searchText, bool *changed)
{
bool hasVisibleItems = false;
@@ -81,7 +81,7 @@ bool ItemLibraryCategory::updateItemVisibility(const QString &searchText, bool *
}
// expand category if it has an item matching search criteria
if (expand && hasVisibleItems && !categoryExpanded())
if (!searchText.isEmpty() && hasVisibleItems && !categoryExpanded())
setExpanded(true);
return hasVisibleItems;

View File

@@ -50,7 +50,7 @@ public:
void addItem(ItemLibraryItem *item);
QObject *itemModel();
bool updateItemVisibility(const QString &searchText, bool *changed, bool expand = false);
bool updateItemVisibility(const QString &searchText, bool *changed);
bool setVisible(bool isVisible);
bool isVisible() const;

View File

@@ -110,14 +110,14 @@ void ItemLibraryImport::expandCategories(bool expand)
m_categoryModel.expandCategories(expand);
}
bool ItemLibraryImport::updateCategoryVisibility(const QString &searchText, bool *changed, bool expand)
bool ItemLibraryImport::updateCategoryVisibility(const QString &searchText, bool *changed)
{
bool hasVisibleCategories = false;
*changed = false;
for (const auto &category : m_categoryModel.categorySections()) {
bool categoryChanged = false;
bool hasVisibleItems = category->updateItemVisibility(searchText, &categoryChanged, expand);
bool hasVisibleItems = category->updateItemVisibility(searchText, &categoryChanged);
categoryChanged |= category->setVisible(hasVisibleItems);
*changed |= categoryChanged;

View File

@@ -70,7 +70,7 @@ public:
void addCategory(ItemLibraryCategory *category);
QObject *categoryModel();
bool updateCategoryVisibility(const QString &searchText, bool *changed, bool expand = false);
bool updateCategoryVisibility(const QString &searchText, bool *changed);
bool setVisible(bool isVisible);
void setImportUsed(bool importUsed);
void sortCategorySections();

View File

@@ -163,7 +163,7 @@ void ItemLibraryModel::setSearchText(const QString &searchText)
m_searchText = lowerSearchText;
bool changed = false;
updateVisibility(&changed, !m_searchText.isEmpty());
updateVisibility(&changed);
}
}
@@ -401,18 +401,18 @@ void ItemLibraryModel::updateUsedImports(const QList<Import> &usedImports)
}
}
void ItemLibraryModel::updateVisibility(bool *changed, bool expand)
void ItemLibraryModel::updateVisibility(bool *changed)
{
for (ItemLibraryImport *import : std::as_const(m_importList)) {
bool categoryChanged = false;
bool hasVisibleItems = import->updateCategoryVisibility(m_searchText, &categoryChanged, expand);
bool hasVisibleItems = import->updateCategoryVisibility(m_searchText, &categoryChanged);
*changed |= categoryChanged;
if (import->sectionType() == ItemLibraryImport::SectionType::Unimported)
*changed |= import->setVisible(!m_searchText.isEmpty());
// expand import if it has an item matching search criteria
if (expand && hasVisibleItems && !import->importExpanded())
if (!m_searchText.isEmpty() && hasVisibleItems && !import->importExpanded())
import->setImportExpanded();
}

View File

@@ -72,7 +72,7 @@ public:
Import entryToImport(const ItemLibraryEntry &entry);
private:
void updateVisibility(bool *changed, bool expand = false);
void updateVisibility(bool *changed);
void addRoleNames();
void sortSections();
void clearSections();

View File

@@ -434,12 +434,12 @@ void ItemLibraryWidget::removeImport(const QString &importUrl)
m_model->changeImports({}, {importSection->importEntry()});
}
void ItemLibraryWidget::addImportForItem(const QVariant &entry)
void ItemLibraryWidget::addImportForItem(const QString &importUrl)
{
QTC_ASSERT(m_itemLibraryModel, return);
QTC_ASSERT(m_model, return);
Import import = m_itemLibraryModel->entryToImport(entry.value<ItemLibraryEntry>());
Import import = m_itemLibraryAddImportModel->getImport(importUrl);
m_model->changeImports({import}, {});
}

View File

@@ -90,7 +90,7 @@ public:
Q_INVOKABLE void startDragAndDrop(const QVariant &itemLibEntry, const QPointF &mousePos);
Q_INVOKABLE void removeImport(const QString &importUrl);
Q_INVOKABLE void addImportForItem(const QVariant &entry);
Q_INVOKABLE void addImportForItem(const QString &importUrl);
Q_INVOKABLE void handleTabChanged(int index);
Q_INVOKABLE void handleAddModule();
Q_INVOKABLE void handleAddAsset();

View File

@@ -79,18 +79,18 @@ static int pathRankForModelNode(const ModelNode &modelNode) {
if (modelNode.hasNodeProperty("path")) {
ModelNode pathNode = modelNode.nodeProperty("path").modelNode();
if (pathNode.metaInfo().isSubclassOf("QtQuick.Path") && pathNode.hasNodeListProperty("pathElements")) {
QList<ModelNode> pathElements = pathNode.nodeListProperty("pathElements").toModelNodeList();
const QList<ModelNode> pathElements = pathNode.nodeListProperty("pathElements")
.toModelNodeList();
if (pathElements.isEmpty())
return 0;
foreach (const ModelNode &pathElement, pathElements) {
for (const ModelNode &pathElement : pathElements) {
if (isNonSupportedPathElement(pathElement))
return 0;
}
}
return 20;
}
return 20;
}
return 0;

View File

@@ -317,8 +317,7 @@ void StatesEditorView::setWhenCondition(int internalNodeId, const QString &condi
return;
m_block = true;
auto guard = [this](int* p) { m_block = false; delete p; };
std::unique_ptr<int, decltype(guard)> scopeGuard(new int, guard);
auto guard = qScopeGuard([&]() { m_block = false; });
if (hasModelNodeForInternalId(internalNodeId)) {
QmlModelState state(modelNodeForInternalId(internalNodeId));
@@ -338,8 +337,7 @@ void StatesEditorView::resetWhenCondition(int internalNodeId)
return;
m_block = true;
auto guard = [this](int* p) { m_block = false; delete p; };
std::unique_ptr<int, decltype(guard)> scopeGuard(new int, guard);
auto guard = qScopeGuard([&]() { m_block = false; });
if (hasModelNodeForInternalId(internalNodeId)) {
QmlModelState state(modelNodeForInternalId(internalNodeId));
@@ -359,8 +357,7 @@ void StatesEditorView::setStateAsDefault(int internalNodeId)
return;
m_block = true;
auto guard = [this](int* p) { m_block = false; delete p; };
std::unique_ptr<int, decltype(guard)> scopeGuard(new int, guard);
auto guard = qScopeGuard([&]() { m_block = false; });
if (hasModelNodeForInternalId(internalNodeId)) {
QmlModelState state(modelNodeForInternalId(internalNodeId));
@@ -380,8 +377,7 @@ void StatesEditorView::resetDefaultState()
return;
m_block = true;
auto guard = [this](int* p) { m_block = false; delete p; };
std::unique_ptr<int, decltype(guard)> scopeGuard(new int, guard);
auto guard = qScopeGuard([&]() { m_block = false; });
try {
if (rootModelNode().hasProperty("state"))
@@ -403,8 +399,7 @@ void StatesEditorView::setAnnotation(int internalNodeId)
return;
m_block = true;
auto guard = [this](int* p) { m_block = false; delete p; };
std::unique_ptr<int, decltype(guard)> scopeGuard(new int, guard);
auto guard = qScopeGuard([&]() { m_block = false; });
if (hasModelNodeForInternalId(internalNodeId)) {
QmlModelState state(modelNodeForInternalId(internalNodeId));
@@ -433,8 +428,7 @@ void StatesEditorView::removeAnnotation(int internalNodeId)
return;
m_block = true;
auto guard = [this](int* p) { m_block = false; delete p; };
std::unique_ptr<int, decltype(guard)> scopeGuard(new int, guard);
auto guard = qScopeGuard([&]() { m_block = false; });
if (hasModelNodeForInternalId(internalNodeId)) {
QmlModelState state(modelNodeForInternalId(internalNodeId));
@@ -555,8 +549,7 @@ void StatesEditorView::variantPropertiesChanged(const QList<VariantProperty> &pr
return;
m_block = true;
auto guard = [this](int* p) { m_block = false; delete p; };
std::unique_ptr<int, decltype(guard)> scopeGuard(new int, guard);
auto guard = qScopeGuard([&]() { m_block = false; });
for (const VariantProperty &property : propertyList) {
if (property.name() == "name" && QmlModelState::isValidQmlModelState(property.parentModelNode()))

View File

@@ -285,7 +285,8 @@ void NodeInstanceView::handleCrash()
if (elaspsedTimeSinceLastCrash > forceRestartTime)
restartProcess();
else
emitDocumentMessage(tr("Qt Quick emulation layer crashed."));
emitDocumentMessage(
::QmlDesigner::NodeInstanceView::tr("Qt Quick emulation layer crashed."));
emitCustomNotification(QStringLiteral("puppet crashed"));
}
@@ -1507,7 +1508,7 @@ void NodeInstanceView::token(const TokenCommand &command)
void NodeInstanceView::debugOutput(const DebugOutputCommand & command)
{
DocumentMessage error(tr("Qt Quick emulation layer crashed."));
DocumentMessage error(::QmlDesigner::NodeInstanceView::tr("Qt Quick emulation layer crashed."));
if (command.instanceIds().isEmpty()) {
emitDocumentMessage(command.text());
} else {
@@ -1695,7 +1696,8 @@ QVariant NodeInstanceView::previewImageDataForImageNode(const ModelNode &modelNo
imageData.pixmap.setDevicePixelRatio(ratio);
}
imageData.info = QObject::tr("Source item: %1").arg(boundNode.id());
imageData.info = ::QmlDesigner::NodeInstanceView::tr("Source item: %1")
.arg(boundNode.id());
}
}
} else {
@@ -1746,7 +1748,10 @@ QVariant NodeInstanceView::previewImageDataForImageNode(const ModelNode &modelNo
imageData.pixmap.setDevicePixelRatio(ratio);
double imgSize = double(imageFi.size());
static QStringList units({QObject::tr("B"), QObject::tr("KB"), QObject::tr("MB"), QObject::tr("GB")});
static QStringList units({::QmlDesigner::NodeInstanceView::tr("B"),
::QmlDesigner::NodeInstanceView::tr("KB"),
::QmlDesigner::NodeInstanceView::tr("MB"),
::QmlDesigner::NodeInstanceView::tr("GB")});
int unitIndex = 0;
while (imgSize > 1024. && unitIndex < units.size() - 1) {
++unitIndex;

View File

@@ -80,7 +80,6 @@ void DesignerSettings::fromSettings(QSettings *settings)
restoreValue(settings, DesignerSettingsKey::SIMPLE_COLOR_PALETTE_CONTENT, QStringList());
restoreValue(settings, DesignerSettingsKey::ALWAYS_DESIGN_MODE, true);
restoreValue(settings, DesignerSettingsKey::DISABLE_ITEM_LIBRARY_UPDATE_TIMER, true);
restoreValue(settings, DesignerSettingsKey::OPEN_QMLPROJECT_IN_QDS, false);
settings->endGroup();
settings->endGroup();

View File

@@ -70,7 +70,6 @@ const char ENABLE_TIMELINEVIEW[] = "EnableTimelineView";
const char SIMPLE_COLOR_PALETTE_CONTENT[] = "SimpleColorPaletteContent";
const char ALWAYS_DESIGN_MODE[] = "AlwaysDesignMode";
const char DISABLE_ITEM_LIBRARY_UPDATE_TIMER[] = "DisableItemLibraryUpdateTimer";
const char OPEN_QMLPROJECT_IN_QDS[] = "OpenQmlprojectInQDS"; /* This key value is used in QmlProjectManager */
}
class QMLDESIGNERCORE_EXPORT DesignerSettings : public QHash<QByteArray, QVariant>

View File

@@ -178,8 +178,6 @@ DesignerSettings SettingsPageWidget::settings() const
m_ui.featureTimelineEditorCheckBox->isChecked());
settings.insert(DesignerSettingsKey::ALWAYS_DESIGN_MODE,
m_ui.designerAlwaysDesignModeCheckBox->isChecked());
settings.insert(DesignerSettingsKey::OPEN_QMLPROJECT_IN_QDS,
m_ui.openQmlprojectInQDSCheckBox->isChecked());
return settings;
}
@@ -249,13 +247,10 @@ void SettingsPageWidget::setSettings(const DesignerSettings &settings)
DesignerSettingsKey::ALWAYS_DESIGN_MODE).toBool());
m_ui.featureTimelineEditorCheckBox->setChecked(settings.value(
DesignerSettingsKey::ENABLE_TIMELINEVIEW).toBool());
m_ui.openQmlprojectInQDSCheckBox->setChecked(settings.value(
DesignerSettingsKey::OPEN_QMLPROJECT_IN_QDS).toBool());
if (settings.value(DesignerSettingsKey::STANDALONE_MODE).toBool()) {
m_ui.debugGroupBox->hide();
m_ui.featureTimelineEditorCheckBox->hide();
m_ui.openQmlprojectInQDSCheckBox->hide();
}
}

View File

@@ -430,13 +430,6 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="openQmlprojectInQDSCheckBox">
<property name="text">
<string>Open &quot;Qt Quick Prototype&quot; projects (.qmlproject) in Qt Design Studio</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@@ -49,7 +49,6 @@
#include <qmljs/qmljsbind.h>
#include <qmljs/qmljsfindexportedcpptypes.h>
#include <qmljs/qmljsplugindumper.h>
#include <qtsupport/qmldumptool.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
#include <texteditor/textdocument.h>
@@ -128,14 +127,10 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
Kit *activeKit = activeTarget ? activeTarget->kit() : KitManager::defaultKit();
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitAspect::qtVersion(activeKit);
bool preferDebugDump = false;
bool setPreferDump = false;
projectInfo.tryQmlDump = false;
if (activeTarget) {
if (BuildConfiguration *bc = activeTarget->activeBuildConfiguration()) {
preferDebugDump = bc->buildType() == BuildConfiguration::Debug;
setPreferDump = true;
// Append QML2_IMPORT_PATH if it is defined in build configuration.
// It enables qmlplugindump to correctly dump custom plugins or other dependent
// plugins that are not installed in default Qt qml installation directory.
@@ -149,8 +144,6 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
projectInfo.applicationDirectories.append(target.targetFilePath.parentDir().toString());
}
}
if (!setPreferDump && qtVersion)
preferDebugDump = (qtVersion->defaultBuildConfig() & QtSupport::BaseQtVersion::DebugBuild);
if (qtVersion && qtVersion->isValid()) {
projectInfo.tryQmlDump = project && qtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT);
projectInfo.qtQmlPath = qtVersion->qmlPath().toFileInfo().canonicalFilePath();
@@ -160,16 +153,13 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
projectInfo.qtVersionString = QLatin1String(qVersion());
}
if (projectInfo.tryQmlDump) {
QtSupport::QmlDumpTool::pathAndEnvironment(activeKit,
preferDebugDump, &projectInfo.qmlDumpPath,
&projectInfo.qmlDumpEnvironment);
projectInfo.qmlDumpHasRelocatableFlag = qtVersion->hasQmlDumpWithRelocatableFlag();
} else {
projectInfo.qmlDumpPath.clear();
projectInfo.qmlDumpEnvironment.clear();
projectInfo.qmlDumpHasRelocatableFlag = true;
projectInfo.qmlDumpPath.clear();
const QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(activeKit);
if (version && projectInfo.tryQmlDump) {
projectInfo.qmlDumpPath = version->qmlplugindumpCommand();
projectInfo.qmlDumpHasRelocatableFlag = version->hasQmlDumpWithRelocatableFlag();
}
setupProjectInfoQmlBundles(projectInfo);
return projectInfo;
}

View File

@@ -53,7 +53,7 @@
#include <texteditor/textdocument.h>
#include <utils/algorithm.h>
#include <utils/checkablemessagebox.h>
#include <utils/infobar.h>
#include <QDebug>
#include <QLoggingCategory>
@@ -73,6 +73,24 @@ Q_LOGGING_CATEGORY(infoLogger, "QmlProjectManager.QmlBuildSystem", QtInfoMsg)
namespace QmlProjectManager {
const char openInQDSAppSetting[] = "OpenInQDSApp";
static void openQDS(const QString &qdsPath, const Utils::FilePath &fileName)
{
bool qdsStarted = false;
//-a and -client arguments help to append project to open design studio application
if (Utils::HostOsInfo::isMacHost())
qdsStarted = QProcess::startDetached("/usr/bin/open", {"-a", qdsPath, fileName.toString()});
else
qdsStarted = QProcess::startDetached(qdsPath, {"-client", fileName.toString()});
if (!qdsStarted) {
QMessageBox::warning(Core::ICore::dialogParent(),
fileName.fileName(),
QObject::tr("Failed to start Qt Design Studio."));
}
}
QmlProject::QmlProject(const Utils::FilePath &fileName)
: Project(QString::fromLatin1(Constants::QMLPROJECT_MIMETYPE), fileName)
{
@@ -95,45 +113,16 @@ QmlProject::QmlProject(const Utils::FilePath &fileName)
if (foundQDS) {
auto lambda = [fileName, qdsPath]() {
const QString projectName = fileName.fileName();
const QString doNotShowAgainKey = "OpenInQDSApp"; //entry that is used only here
const QString openInQDSKey = "QML/Designer/OpenQmlprojectInQDS"; //entry from qml settings
QSettings *settings = Core::ICore::settings();
const bool shouldAskAgain = Utils::CheckableMessageBox::shouldAskAgain(settings,
doNotShowAgainKey);
bool openInQDS = false;
if (shouldAskAgain) {
bool dontShow = false;
const auto dialogResult =
Utils::CheckableMessageBox::question(Core::ICore::dialogParent(),
projectName,
tr("Would you like to open the project in Qt Design Studio?"),
tr("Do not show this dialog anymore."),
&dontShow);
openInQDS = (dialogResult == QDialogButtonBox::Yes);
if (dontShow) {
Utils::CheckableMessageBox::doNotAskAgain(settings, doNotShowAgainKey);
settings->setValue(openInQDSKey, openInQDS);
}
} else {
openInQDS = settings->value(openInQDSKey, false).toBool();
}
if (openInQDS) {
bool qdsStarted = false;
//-a and -client arguments help to append project to open design studio application
if (Utils::HostOsInfo::isMacHost())
qdsStarted = QProcess::startDetached("/usr/bin/open", {"-a", qdsPath, fileName.toString()});
else
qdsStarted = QProcess::startDetached(qdsPath, {"-client", fileName.toString()});
if (!qdsStarted) {
QMessageBox::warning(Core::ICore::dialogParent(),
projectName,
tr("Failed to start Qt Design Studio."));
}
if (Core::ICore::infoBar()->canInfoBeAdded(openInQDSAppSetting)) {
Utils::InfoBarEntry
info(openInQDSAppSetting,
tr("Would you like to open the project in Qt Design Studio?"),
Utils::InfoBarEntry::GlobalSuppression::Enabled);
info.setCustomButtonInfo(tr("Open in Qt Design Studio"), [&, qdsPath, fileName] {
Core::ICore::infoBar()->removeInfo(openInQDSAppSetting);
openQDS(qdsPath, fileName);
});
Core::ICore::infoBar()->addInfo(info);
}
};
@@ -271,6 +260,11 @@ QString QmlBuildSystem::mainFile() const
return QString();
}
Utils::FilePath QmlBuildSystem::mainFilePath() const
{
return projectDirectory().pathAppended(mainFile());
}
bool QmlBuildSystem::qtForMCUs() const
{
if (m_projectItem)

View File

@@ -76,6 +76,8 @@ public:
Utils::FilePath canonicalProjectDir() const;
QString mainFile() const;
Utils::FilePath mainFilePath() const;
bool qtForMCUs() const;
void setMainFile(const QString &mainFilePath);
Utils::FilePath targetDirectory() const;
@@ -90,6 +92,7 @@ public:
void refreshProjectFile();
static Utils::FilePath activeMainFilePath();
static QStringList makeAbsolute(const Utils::FilePath &path, const QStringList &relativePaths);
void generateProjectTree();

View File

@@ -11,7 +11,6 @@ add_qtc_plugin(QtSupport
exampleslistmodel.cpp exampleslistmodel.h
gettingstartedwelcomepage.cpp gettingstartedwelcomepage.h
profilereader.cpp profilereader.h
qmldumptool.cpp qmldumptool.h
qscxmlcgenerator.cpp qscxmlcgenerator.h
qtbuildaspects.cpp qtbuildaspects.h
qtconfigwidget.cpp qtconfigwidget.h

View File

@@ -25,7 +25,6 @@
#include "baseqtversion.h"
#include "qtconfigwidget.h"
#include "qmldumptool.h"
#include "qtkitinformation.h"
#include "qtversionfactory.h"
@@ -48,6 +47,7 @@
#include <qtsupport/qtsupportconstants.h>
#include <utils/algorithm.h>
#include <utils/buildablehelperlibrary.h>
#include <utils/displayname.h>
#include <utils/fileinprojectfinder.h>
#include <utils/hostosinfo.h>
@@ -110,6 +110,7 @@ public:
Utils::FilePath prefix;
Utils::FilePath binPath;
Utils::FilePath libExecPath;
Utils::FilePath configurationPath;
Utils::FilePath dataPath;
Utils::FilePath demosPath;
@@ -124,6 +125,7 @@ public:
Utils::FilePath translationsPath;
Utils::FilePath hostBinPath;
Utils::FilePath hostLibexecPath;
Utils::FilePath hostDataPath;
Utils::FilePath hostPrefixPath;
@@ -211,7 +213,6 @@ public:
QtVersionData m_data;
bool m_isUpdating = false;
bool m_hasQmlDump = false; // controlled by m_versionInfoUpToDate
bool m_mkspecUpToDate = false;
bool m_mkspecReadUpToDate = false;
bool m_defaultConfigIsDebug = true;
@@ -238,6 +239,7 @@ public:
QString m_linguistCommand;
QString m_qscxmlcCommand;
QString m_qmlsceneCommand;
QString m_qmlplugindumpCommand;
MacroExpanderWrapper m_expander;
};
@@ -558,6 +560,11 @@ FilePath BaseQtVersion::binPath() const // QT_INSTALL_BINS
return d->m_data.binPath;
}
FilePath BaseQtVersion::libExecPath() const // QT_INSTALL_LIBEXECS
{
d->updateVersionInfo();
return d->m_data.libExecPath;
}
FilePath BaseQtVersion::configurationPath() const // QT_INSTALL_CONFIGURATION
{
d->updateVersionInfo();
@@ -618,6 +625,12 @@ FilePath BaseQtVersion::hostBinPath() const // QT_HOST_BINS
return d->m_data.hostBinPath;
}
FilePath BaseQtVersion::hostLibexecPath() const // QT_HOST_LIBEXECS
{
d->updateVersionInfo();
return d->m_data.hostLibexecPath;
}
FilePath BaseQtVersion::hostDataPath() const // QT_HOST_DATA
{
d->updateVersionInfo();
@@ -639,12 +652,6 @@ FilePath BaseQtVersion::mkspecsPath() const
return result.pathAppended("mkspecs");
}
FilePath BaseQtVersion::qmlBinPath() const
{
d->updateVersionInfo();
return FilePath::fromUserInput(d->m_mkspecValues.value("QT.qml.bins"));
}
FilePath BaseQtVersion::librarySearchPath() const
{
return HostOsInfo::isWindowsHost() ? binPath() : libraryPath();
@@ -1000,16 +1007,30 @@ QString BaseQtVersion::qmlsceneCommand() const
if (!d->m_qmlsceneCommand.isNull())
return d->m_qmlsceneCommand;
ensureMkSpecParsed();
const QString path =
qmlBinPath().pathAppended(HostOsInfo::withExecutableSuffix("qmlscene")).toString();
const QString path
= binPath().pathAppended(HostOsInfo::withExecutableSuffix("qmlscene")).toString();
d->m_qmlsceneCommand = QFileInfo(path).isFile() ? path : QString();
return d->m_qmlsceneCommand;
}
QString BaseQtVersion::qmlplugindumpCommand() const
{
if (!isValid())
return QString();
if (!d->m_qmlplugindumpCommand.isNull())
return d->m_qmlplugindumpCommand;
const QString path
= binPath().pathAppended(HostOsInfo::withExecutableSuffix("qmlplugindump")).toString();
d->m_qmlplugindumpCommand = QFileInfo(path).isFile() ? path : QString();
return d->m_qmlplugindumpCommand;
}
QString BaseQtVersionPrivate::findHostBinary(HostBinaries binary) const
{
QString baseDir;
@@ -1165,12 +1186,8 @@ void BaseQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
else if (value == "qt_framework")
d->m_frameworkBuild = true;
}
const QString qmlBins = "QT.qml.bins";
const QString declarativeBins = "QT.declarative.bins";
const QString libinfix = MKSPEC_VALUE_LIBINFIX;
const QString ns = MKSPEC_VALUE_NAMESPACE;
d->m_mkspecValues.insert(qmlBins, evaluator->value(qmlBins));
d->m_mkspecValues.insert(declarativeBins, evaluator->value(declarativeBins));
d->m_mkspecValues.insert(libinfix, evaluator->value(libinfix));
d->m_mkspecValues.insert(ns, evaluator->value(ns));
}
@@ -1261,7 +1278,6 @@ void BaseQtVersionPrivate::updateVersionInfo()
m_data.installed = true;
m_data.hasExamples = false;
m_data.hasDocumentation = false;
m_hasQmlDump = false;
if (!queryQMakeVariables(m_qmakeCommand, q->qmakeRunEnvironment(), &m_versionInfo)) {
m_qmakeIsExecutable = false;
@@ -1274,6 +1290,7 @@ void BaseQtVersionPrivate::updateVersionInfo()
m_data.prefix = FilePath::fromUserInput(qmakeProperty("QT_INSTALL_PREFIX"));
m_data.binPath = FilePath::fromUserInput(qmakeProperty("QT_INSTALL_BINS"));
m_data.libExecPath = FilePath::fromUserInput(qmakeProperty("QT_INSTALL_LIBEXECS"));
m_data.configurationPath = FilePath::fromUserInput(qmakeProperty("QT_INSTALL_CONFIGURATION"));
m_data.dataPath = FilePath::fromUserInput(qmakeProperty("QT_INSTALL_DATA"));
m_data.demosPath = FilePath::fromString(
@@ -1289,20 +1306,12 @@ void BaseQtVersionPrivate::updateVersionInfo()
m_data.translationsPath = FilePath::fromUserInput(qmakeProperty("QT_INSTALL_TRANSLATIONS"));
m_data.hostBinPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_BINS"));
m_data.hostLibexecPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_LIBEXECS"));
m_data.hostDataPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_DATA"));
m_data.hostPrefixPath = FilePath::fromUserInput(qmakeProperty("QT_HOST_PREFIX"));
const QString qtInstallBins = q->binPath().toString();
const QString qtHeaderData = q->headerPath().toString();
if (!qtInstallBins.isNull()) {
if (!qtInstallBins.isEmpty()) {
m_hasQmlDump
= !QmlDumpTool::toolForQtPaths(qtInstallBins, false).isEmpty()
|| !QmlDumpTool::toolForQtPaths(qtInstallBins, true).isEmpty();
}
}
// Now check for a qt that is configured with a prefix but not installed
QString installDir = q->hostBinPath().toString();
if (!installDir.isNull()) {
@@ -1476,6 +1485,13 @@ BaseQtVersion::createMacroExpander(const std::function<const BaseQtVersion *()>
return version->hostPrefixPath().toString();
}));
expander->registerVariable("Qt:QT_HOST_LIBEXECS",
QtKitAspect::tr("The installation location of the current Qt "
"version's internal host executable files."),
versionProperty([](const BaseQtVersion *version) {
return version->hostLibexecPath().toString();
}));
expander->registerVariable(
"Qt:QT_INSTALL_HEADERS",
QtKitAspect::tr("The installation location of the current Qt version's header files."),
@@ -1500,6 +1516,13 @@ BaseQtVersion::createMacroExpander(const std::function<const BaseQtVersion *()>
QtKitAspect::tr("The installation location of the current Qt version's executable files."),
versionProperty([](const BaseQtVersion *version) { return version->binPath().toString(); }));
expander->registerVariable(
"Qt:QT_INSTALL_LIBEXECS",
QtKitAspect::tr(
"The installation location of the current Qt version's internal executable files."),
versionProperty(
[](const BaseQtVersion *version) { return version->libExecPath().toString(); }));
expander
->registerVariable("Qt:QT_INSTALL_PLUGINS",
QtKitAspect::tr(
@@ -1676,29 +1699,12 @@ Environment BaseQtVersion::qmakeRunEnvironment() const
return Environment::systemEnvironment();
}
bool BaseQtVersion::hasQmlDump() const
{
d->updateVersionInfo();
return d->m_hasQmlDump;
}
bool BaseQtVersion::hasQmlDumpWithRelocatableFlag() const
{
return ((qtVersion() > QtVersionNumber(4, 8, 4) && qtVersion() < QtVersionNumber(5, 0, 0))
|| qtVersion() >= QtVersionNumber(5, 1, 0));
}
bool BaseQtVersion::needsQmlDump() const
{
return qtVersion() < QtVersionNumber(4, 8, 0);
}
QString BaseQtVersion::qmlDumpTool(bool debugVersion) const
{
const QString qtInstallBins = binPath().toString();
return QmlDumpTool::toolForQtPaths(qtInstallBins, debugVersion);
}
Tasks BaseQtVersion::reportIssuesImpl(const QString &proFile, const QString &buildDir) const
{
Q_UNUSED(proFile)

View File

@@ -138,6 +138,7 @@ public:
QString linguistCommand() const;
QString qscxmlcCommand() const;
QString qmlsceneCommand() const;
QString qmlplugindumpCommand() const;
QString qtVersionString() const;
QtVersionNumber qtVersion() const;
@@ -181,11 +182,7 @@ public:
static bool isQtQuickCompilerSupported(const ProjectExplorer::Kit *k, QString *reason = nullptr);
bool isQtQuickCompilerSupported(QString *reason = nullptr) const;
QString qmlDumpTool(bool debugVersion) const;
bool hasQmlDump() const;
bool hasQmlDumpWithRelocatableFlag() const;
bool needsQmlDump() const;
virtual QtConfigWidget *createConfigurationWidget() const;
@@ -198,6 +195,7 @@ public:
Utils::FilePath prefix() const;
Utils::FilePath binPath() const;
Utils::FilePath libExecPath() const;
Utils::FilePath configurationPath() const;
Utils::FilePath dataPath() const;
Utils::FilePath demosPath() const;
@@ -212,11 +210,11 @@ public:
Utils::FilePath translationsPath() const;
Utils::FilePath hostBinPath() const;
Utils::FilePath hostLibexecPath() const;
Utils::FilePath hostDataPath() const;
Utils::FilePath hostPrefixPath() const;
Utils::FilePath mkspecsPath() const;
Utils::FilePath qmlBinPath() const;
Utils::FilePath librarySearchPath() const;
Utils::FilePaths directoriesToIgnoreInProjectTree() const;

View File

@@ -1,116 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "qmldumptool.h"
#include "qtkitinformation.h"
#include "qtsupportconstants.h"
#include "qtversionmanager.h"
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <projectexplorer/project.h>
#include <utils/runextensions.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QCoreApplication>
#include <QDir>
#include <QDebug>
#include <QHash>
#include <QStandardPaths>
namespace QtSupport {
static inline QStringList validPrebuiltFilenames(bool debugBuild)
{
QStringList list = QStringList(QLatin1String("qmlplugindump"));
list.append(QLatin1String("qmlplugindump.app/Contents/MacOS/qmlplugindump"));
if (debugBuild)
list.prepend(QLatin1String("qmlplugindumpd.exe"));
else
list.prepend(QLatin1String("qmlplugindump.exe"));
return list;
}
QString QmlDumpTool::toolForVersion(const BaseQtVersion *version, bool debugDump)
{
if (version) {
const QString qtInstallBins = version->binPath().toString();
return toolForQtPaths(qtInstallBins, debugDump);
}
return QString();
}
QString QmlDumpTool::toolForQtPaths(const QString &qtInstallBins,
bool debugDump)
{
if (!Core::ICore::instance())
return QString();
// check for prebuilt binary first
QFileInfo fileInfo;
if (getHelperFileInfoFor(validPrebuiltFilenames(debugDump), qtInstallBins + QLatin1Char('/'), &fileInfo))
return fileInfo.absoluteFilePath();
return QString();
}
void QmlDumpTool::pathAndEnvironment(const ProjectExplorer::Kit *k, bool preferDebug,
QString *dumperPath, Utils::Environment *env)
{
if (!k)
return;
const BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(k);
if (version && !version->hasQmlDump())
return;
QString path;
path = toolForVersion(version, preferDebug);
if (path.isEmpty())
path = toolForVersion(version, !preferDebug);
if (!path.isEmpty()) {
QFileInfo qmldumpFileInfo(path);
if (!qmldumpFileInfo.exists()) {
qWarning() << "QmlDumpTool::qmlDumpPath: qmldump executable does not exist at" << path;
path.clear();
} else if (!qmldumpFileInfo.isFile()) {
qWarning() << "QmlDumpTool::qmlDumpPath: " << path << " is not a file";
path.clear();
}
}
if (!path.isEmpty() && version && dumperPath && env) {
*dumperPath = path;
k->addToEnvironment(*env);
}
}
} // namespace QtSupport

View File

@@ -1,54 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include "qtsupport_global.h"
#include <utils/buildablehelperlibrary.h>
namespace ProjectExplorer { class Kit; }
namespace Utils { class Environment; }
namespace ProjectExplorer {
class Project;
class ToolChain;
}
namespace QtSupport {
class BaseQtVersion;
class QTSUPPORT_EXPORT QmlDumpTool : public Utils::BuildableHelperLibrary
{
public:
static QString toolForVersion(const BaseQtVersion *version, bool debugDump);
static QString toolForQtPaths(const QString &qtInstallBins,
bool debugDump);
static void pathAndEnvironment(const ProjectExplorer::Kit *k, bool preferDebug,
QString *path, Utils::Environment *env);
};
} // namespace

View File

@@ -821,7 +821,9 @@ static Utils::optional<QString> currentlyLinkedQtDir(bool *hasInstallSettings)
static QString linkingPurposeText()
{
return QtOptionsPageWidget::tr(
"Linking with a Qt installation automatically registers Qt versions and kits.");
"Linking with a Qt installation automatically registers Qt versions and kits, and other "
"tools that were installed with that Qt installer, in this Qt Creator installation. Other "
"Qt Creator installations are not affected.");
}
static bool canLinkWithQt(QString *toolTip)
@@ -961,7 +963,9 @@ void QtOptionsPageWidget::linkWithQt()
dialog.setWindowTitle(title);
auto layout = new QVBoxLayout;
dialog.setLayout(layout);
layout->addWidget(new QLabel(linkingPurposeText()));
auto tipLabel = new QLabel(linkingPurposeText());
tipLabel->setWordWrap(true);
layout->addWidget(tipLabel);
auto pathLayout = new QHBoxLayout;
layout->addLayout(pathLayout);
auto pathLabel = new QLabel(tr("Qt installation path:"));
@@ -983,6 +987,7 @@ void QtOptionsPageWidget::linkWithQt()
const Utils::optional<QString> currentLink = currentlyLinkedQtDir(nullptr);
pathInput->setPath(currentLink ? *currentLink : defaultQtInstallationPath());
auto buttons = new QDialogButtonBox;
layout->addStretch(10);
layout->addWidget(buttons);
auto linkButton = buttons->addButton(tr("Link with Qt"), QDialogButtonBox::AcceptRole);
connect(linkButton, &QPushButton::clicked, &dialog, &QDialog::accept);

View File

@@ -22,7 +22,6 @@ HEADERS += \
qtversionmanager.h \
qtversionfactory.h \
baseqtversion.h \
qmldumptool.h \
qtoptionspage.h \
qtsupportconstants.h \
profilereader.h \
@@ -49,7 +48,6 @@ SOURCES += \
qttestparser.cpp \
qtversionmanager.cpp \
baseqtversion.cpp \
qmldumptool.cpp \
qtoptionspage.cpp \
profilereader.cpp \
qtparser.cpp \

View File

@@ -78,8 +78,6 @@ Project {
"exampleslistmodel.h",
"profilereader.cpp",
"profilereader.h",
"qmldumptool.cpp",
"qmldumptool.h",
"qscxmlcgenerator.cpp",
"qscxmlcgenerator.h",
"qtkitinformation.cpp",

View File

@@ -159,6 +159,15 @@ void QtSupportPlugin::extensionsInitialized()
return qt ? qt->binPath().toUserOutput() : QString();
});
expander->registerVariable(
"CurrentDocument:Project:QT_HOST_LIBEXECS",
tr("Full path to the host libexec directory of the Qt version in the active kit "
"of the project containing the current document."),
[]() {
const BaseQtVersion *const qt = currentQtVersion();
return qt ? qt->hostLibexecPath().toUserOutput() : QString();
});
static const auto activeQtVersion = []() -> const BaseQtVersion * {
ProjectExplorer::Project *project = SessionManager::startupProject();
if (!project || !project->activeTarget())
@@ -185,6 +194,15 @@ void QtSupportPlugin::extensionsInitialized()
return qt ? qt->binPath().toUserOutput() : QString();
});
expander->registerVariable(
"ActiveProject::QT_HOST_LIBEXECS",
tr("Full path to the libexec bin directory of the Qt version in the active kit "
"of the active project."),
[]() {
const BaseQtVersion *const qt = activeQtVersion();
return qt ? qt->hostLibexecPath().toUserOutput() : QString();
});
askAboutQtInstallation();
}

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
@@ -105,7 +105,7 @@ Image {
width: 270
height: 24
color: "#ffffff"
text: qsTr("Copyright 2008 - 2020 The Qt Company")
text: qsTr("Copyright 2008 - 2021 The Qt Company")
font.pixelSize: 16
font.family: StudioFonts.titilliumWeb_light
}

View File

@@ -75,6 +75,13 @@ ListModel {
displayName: "Washing Machine"
}
ListElement {
projectName: "SimpleKeyboard"
qmlFileName: "SimpleKeyboard.qml"
thumbnail: "images/virtualkeyboard_thumbnail.png"
displayName: "Virtual Keyboard"
}
ListElement {
projectName: "highendivisystem"
qmlFileName: "Screen01.ui.qml"
@@ -83,4 +90,13 @@ ListModel {
url: "https://download.qt.io/learning/examples/qtdesignstudio/highendivisystem.zip"
showDownload: true
}
ListElement {
projectName: "highendivisystem"
qmlFileName: "Screen01.ui.qml"
thumbnail: "images/digital_cluster_thumbnail.png"
displayName: "Digital Cluster"
url: "https://download.qt.io/learning/examples/qtdesignstudio/digitalcluster.zip"
showDownload: true
}
}

View File

@@ -141,8 +141,20 @@ ListModel {
}
ListElement {
displayName: "Getting Started - Create New Project"
displayName: "Create New Project"
thumbnail: "images/gettingStarted_newProject.png"
url: "https://youtu.be/9ihYeC0YJ0M"
}
ListElement {
displayName: "Using Qt Quick 3D Components"
thumbnail: "images/gettingStarted_3dComponents.png"
url: "https://youtu.be/u3kZJjlk3CY"
}
ListElement {
displayName: "Using Custom Shaders, Materials, and Effects"
thumbnail: "images/gettingStarted_shaders.png"
url: "https://youtu.be/bMXeeQw6BYs"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -7762,7 +7762,6 @@ void TextEditorWidget::insertFromMimeData(const QMimeData *source)
const int anchor = cursor.position();
cursor.insertText(text);
const int pos = cursor.position();
cursor.endEditBlock();
cursor.setPosition(anchor);
cursor.setPosition(pos, QTextCursor::KeepAnchor);
} else {

View File

@@ -504,7 +504,7 @@ void SubmitEditorWidget::hideDescription()
setDescriptionMandatory(false);
}
void VcsBase::SubmitEditorWidget::verifyDescription()
void SubmitEditorWidget::verifyDescription()
{
auto fontColor = [](Utils::Theme::Color color) {
return QString("<font color=\"%1\">")

View File

@@ -33,6 +33,8 @@ namespace Internal {
class WebAssemblyQtVersion : public QtSupport::BaseQtVersion
{
Q_DECLARE_TR_FUNCTIONS(WebAssembly::Internal::WebAssemblyQtVersion)
public:
WebAssemblyQtVersion();