Merge remote-tracking branch 'origin/4.6'

Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp

Change-Id: I2445882a270731b866b04f28ff87d161224c539a
This commit is contained in:
Eike Ziller
2018-02-13 13:37:37 +01:00
65 changed files with 654 additions and 398 deletions

85
dist/changes-4.5.1.md vendored Normal file
View File

@@ -0,0 +1,85 @@
Qt Creator version 4.5.1 contains bug fixes.
The most important changes are listed in this document. For a complete
list of changes, see the Git log for the Qt Creator sources that
you can check out from the public Git repository. For example:
git clone git://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline v4.5.0..v4.5.1
Help
* Fixed that mouse cursor got stuck in waiting state when jumping to
anchor within open help page (QTCREATORBUG-19649)
All Projects
* Fixed predefined macro setting for custom toolchains (QTCREATORBUG-19714)
QMake Projects
* Fixed crash when importing build (QTCREATORBUG-19391)
* Fixed crash when switching file while project is parsing (QTCREATORBUG-19428)
Qbs Projects
* Fixed issue with toolchain setup (QTCREATORBUG-19467)
* Fixed reparsing after switching build configuration
Qt Quick Designer
* Fixed painting artifacts while resizing
Nim Support
* Fixed debugging (QTCREATORBUG-19414)
Debugging
* CDB
* Improved performance when stepping (QTCREATORBUG-18613)
QML Profiler
* Fixed `Analyze Current Range` (QTCREATORBUG-19456)
* Fixed attaching to running application (QTCREATORBUG-19496)
Version Control Systems
* Gerrit
* Fixed that dialog could use wrong repository (QTCREATORBUG-19562)
Platform Specific
Windows
* Fixed issue with `PATH` when running QMake project
* Fixed issue with `PATH` when debugging with GDB
* Fixed multiple registration of MSVC 2015 Build Tools
Universal Windows Platform
* Fixed that changes to deployment steps did not persist
Credits for these changes go to:
Alessandro Portale
Alexandru Croitor
André Pönitz
Christian Kandeler
Christian Stenger
David Schulz
Eike Ziller
Friedemann Kleint
Ivan Donchevskii
Jaroslaw Kobus
Leena Miettinen
Nikolai Kosjar
Orgad Shaneh
Oswald Buddenhagen
Robert Löhning
Samuel Gaist
Sergey Belyashov
Thomas Hartmann
Tim Jenssen
Tobias Hunger
Ulf Hermann

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -88,9 +88,9 @@
\li \l{Modeling}
You can use the experimental model editor to create Universal
Modeling Language (UML) style models with structured diagrams and
store them in XML format.
You can use the model editor to create Universal Modeling Language
(UML) style models with structured and behavioral diagrams that
provide different views of your system and store them in XML format.
\li \l{Editing State Charts}

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -37,21 +37,46 @@
\title Modeling
You can use the experimental model editor to create Universal Modeling
Language (UML) style models with structured diagrams. However, the editor
uses a variant of UML and only a subset of properties are provided for
specifying the appearance of model elements.
You can use the model editor to create Universal Modeling Language (UML)
style models with structured and behavioral diagrams that provide different
views of your system. However, the editor uses a variant of UML and only a
subset of properties are provided for specifying the appearance of model
elements.
You can create the following types of diagrams:
Structural diagrams represent the static aspect of the system and are
therefore stable, whereas behavioral diagrams have both static and dynamic
aspects.
You can create the following types of structural diagrams:
\list
\li Package
\li Class
\li Component
\li Use case
\li Activity
\li Package diagrams, which consist of packages and their relationships,
and visualize how the system is packaged.
\li Class diagrams, which consists of classes, dependencies,
inheritance, associations, aggregation, and composition, and
provide an object-oriented view of a system.
\li Component diagrams, which represent a set of components and their
relationships, and provide an implementation view of a system.
\li Deployment diagrams, which represent a set of software and hardware
components and their relationships, and visualize the deployment
of a system.
\endlist
You can create the following types of behavioral diagrams:
\list
\li Use case diagrams, which consists of actors, use cases, and their
relationships, and represent a particular functionality of a system.
\li Activity diagrams, which visualize the flow from one activity to
another.
\li Sequence diagrams, which consist of instances and specify where the
instances are activated and destroyed and where their lifeline ends.
\endlist
\section1 Using the Model Editor
You can create models that contain several different structural or
behavioral diagrams.
You can add elements to the diagrams and specify properties for them. You
can either use standard model elements or add your own elements with custom
icons.
@@ -66,13 +91,14 @@
\li Select tool bar buttons (3) to add elements to the element tree (4).
\li Drag elements from the element tree to the editor to add them and
all their relations to the diagram.
\li Drag and drop source files from \uicontrol Projects to the editor
to add C++ classes or components to a class or component diagram.
\li Drag and drop source files from the sidebar views to the editor
to add C++ classes or components to diagrams.
\endlist
You can group elements by surrounding them with a boundary. When you move
the boundary, all elements within it are moved together. Similary drag
a swimlane to the diagram. When you move the swimlane all elements right
the boundary, all elements within it are moved together. Similary, drag
a swimlane to the diagram. When you move the swimlane, all elements right
to the swimlane (for vertical swimlanes) or below it (for horizontal swimlanes)
will be moved together. A vertical swimlane is created when you drop the
swimlane icon on the top border of the diagram and a horizontal swimlane
@@ -82,6 +108,11 @@
You can move individual elements and modify their properties (5) by selecting
them. You can also use \e multiselection to group elements temporarily.
To align elements in the editor, select several elements and right-click to
open a context menu. Select actions in the \uicontrol {Align Objects} menu
to align elements horizontally or vertically or to adjust their width and
height.
Drag the mouse over elements to select them and apply actions such as
changing their \e stereotype or color. A stereotype is a classifier for
elements, such as \e entity, \e control, \e interface, or \e boundary. An
@@ -89,6 +120,9 @@
a custom icon is defined. You can assign several comma-separated stereotypes
to one element.
To add related elements to a diagram, select an element in the editor, and
then select \uicontrol {Add Related Elements} in the context menu.
By default, when you select an element in a diagram, it is highlighted also
in the \uicontrol Structure view. To change this behavior so that selecting
an element in the \uicontrol Structure makes it highlighted also in the
@@ -97,13 +131,11 @@
To keep the selections in the diagram and the \uicontrol Structure view
synchronized, select \uicontrol {Keep Synchronized}.
To zoom into diagrams, select \uicontrol Tools > \uicontrol {Model Editor} >
\uicontrol {Zoom In}, press \key Ctrl++, or press \key Ctrl and roll the
mouse wheel up. To zoom out of diagrams, select \uicontrol Tools >
\uicontrol {Model Editor} > \uicontrol {Zoom Out}, press \key Ctrl+-, or
press \key Ctrl and roll the mouse wheel down. To reset the diagram size to
100%, select \uicontrol Tools > \uicontrol {Model Editor} > \uicontrol
{Reset Zoom} or press \key Ctrl+0.
To zoom into diagrams, select the \uicontrol {Zoom In} toolbar button,
press \key Ctrl++, or press \key Ctrl and roll the mouse wheel up. To zoom
out of diagrams, select \uicontrol {Zoom Out}, press \key Ctrl+-, or press
\key Ctrl and roll the mouse wheel down. To reset the diagram size to 100%,
select \uicontrol {Reset Zoom} or press \key Ctrl+0.
To print diagrams, press \key Ctrl+C when no elements are selected in
the editor to copy all elements to the clipboard by using 300 dpi. Then
@@ -112,22 +144,26 @@
If you copy a selection of elements in the editor, only those elements and
their relations will be copied to the clipboard as an image.
To save diagrams as images, select \uicontrol Tools >
\uicontrol {Model Editor} > \uicontrol {Export Diagram}.
To save diagrams as images, select \uicontrol File >
\uicontrol {Export Diagram}. To save only the selected parts of a diagram,
select \uicontrol {Export Selected Elements}.
\section1 Creating Models
You can use wizards to create models and \e {scratch models}. A scratch
model can be used to quickly put a temporary diagram together. The wizard
creates the model file in a temporary folder without any input from you.
Therefore, you can assign a \l{Keyboard Shortcuts}{keyboard shortcut} to the
wizard and use it to create and open models with empty diagrams.
To create models:
\list 1
\li Select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol Modeling > \uicontrol ModelEditor and restart \QC to
enable the plugin.
\li Select \uicontrol File > \uicontrol {New File or Project} >
\uicontrol Modeling > \uicontrol Model > \uicontrol Choose to
create a model.
\uicontrol Modeling > \uicontrol Model > or
\uicontrol {Scratch Model} > \uicontrol Choose to create a model
or a scratch model.
\li Drag and drop model elements to the editor and select them to
specify properties for them:
@@ -148,8 +184,9 @@
element.
\li In the \uicontrol Role field, select a \e role to make the model
element color lighter, darker, or softer or to remove color and
draw the element outline.
element color lighter, darker, or softer. You can also remove
color and draw the element outline or flatten the element by
removing gradients.
\li Select the \uicontrol Emphasized check box to draw the model
element with a thicker line.
@@ -234,6 +271,13 @@
\image qtcreator-modeleditor-packages.png
Right-click a package to open a context menu, where you can select
\uicontrol {Create Diagram} to create a new package diagram within the
model. You can drag and drop items from the element tree to the diagram.
To update the include dependencies of the package, select
\uicontrol {Update Include Dependencies}.
\section1 Creating Class Diagrams
\image qtcreator-modeleditor-classes.png

View File

@@ -13,7 +13,7 @@ QtcProduct {
}
targetName: QtcFunctions.qtLibraryName(qbs, name)
destinationDirectory: FileInfo.joinPaths(buildDirectory, qtc.ide_library_path)
destinationDirectory: FileInfo.joinPaths(project.buildDirectory, qtc.ide_library_path)
cpp.linkerFlags: {
var flags = base;

View File

@@ -13,7 +13,7 @@ QtcProduct {
property var pluginTestDepends: []
targetName: QtcFunctions.qtLibraryName(qbs, name)
destinationDirectory: FileInfo.joinPaths(buildDirectory, qtc.ide_plugin_path)
destinationDirectory: FileInfo.joinPaths(project.buildDirectory, qtc.ide_plugin_path)
Depends { name: "ExtensionSystem" }
Depends { name: "pluginjson" }

View File

@@ -908,7 +908,10 @@ class Dumper(DumperBase):
elif self.startMode_ == AttachCore:
coreFile = args.get('coreFile', '');
self.process = self.target.LoadCore(coreFile)
if self.process.IsValid():
self.reportState('enginerunokandinferiorunrunnable')
else:
self.reportState('enginerunfailed')
else:
launchInfo = lldb.SBLaunchInfo(self.processArgs_)
launchInfo.SetWorkingDirectory(self.workingDirectory_)

View File

@@ -232,7 +232,7 @@ Section {
text: qsTr("Kerning")
Layout.fillWidth: true
backendValue: (backendValues.font_kerning === undefined) ? dummyBackendValue : backendValues.font_kerning
tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. This may " +
tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. Disabling this may " +
"improve performance when creating or changing the text, at the expense of some cosmetic features. The default value is true.")
}
@@ -241,7 +241,7 @@ Section {
Layout.fillWidth: true
backendValue: (backendValues.font_preferShaping === undefined) ? dummyBackendValue : backendValues.font_preferShaping
tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" +
"In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in" +
"In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in " +
"Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.")
}
}

View File

@@ -103,20 +103,6 @@ void ConnectionClient::setProcessAliveTimerInterval(int processTimerInterval)
m_processAliveTimer.setInterval(processTimerInterval);
}
QProcessEnvironment ConnectionClient::processEnvironment() const
{
auto processEnvironment = QProcessEnvironment::systemEnvironment();
if (temporaryDirectory().isValid()) {
const QString temporaryDirectoryPath = temporaryDirectory().path();
processEnvironment.insert(QStringLiteral("TMPDIR"), temporaryDirectoryPath);
processEnvironment.insert(QStringLiteral("TMP"), temporaryDirectoryPath);
processEnvironment.insert(QStringLiteral("TEMP"), temporaryDirectoryPath);
}
return processEnvironment;
}
const QTemporaryDir &ConnectionClient::temporaryDirectory() const
{
return m_processCreator.temporaryDirectory();

View File

@@ -31,7 +31,6 @@
#include <QLocalServer>
#include <QLocalSocket>
#include <QProcessEnvironment>
#include <QScopedPointer>
#include <QTemporaryDir>
@@ -124,8 +123,6 @@ private:
void ensureMessageIsWritten();
QProcessEnvironment processEnvironment() const;
protected:
ProcessCreator m_processCreator;

View File

@@ -87,6 +87,8 @@ const Icon NEWFILE({
{QLatin1String(":/utils/images/filenew.png"), Theme::PanelTextColorMid}}, Icon::Tint);
const Icon OPENFILE({
{QLatin1String(":/utils/images/fileopen.png"), Theme::PanelTextColorMid}}, Icon::Tint);
const Icon OPENFILE_TOOLBAR({
{QLatin1String(":/utils/images/fileopen.png"), Theme::IconsBaseColor}});
const Icon SAVEFILE({
{QLatin1String(":/utils/images/filesave.png"), Theme::PanelTextColorMid}}, Icon::Tint);
const Icon SAVEFILE_TOOLBAR({

View File

@@ -58,6 +58,7 @@ QTCREATOR_UTILS_EXPORT extern const Icon SNAPSHOT_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon NEWFILE;
QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE;
QTCREATOR_UTILS_EXPORT extern const Icon OPENFILE_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon SAVEFILE;
QTCREATOR_UTILS_EXPORT extern const Icon SAVEFILE_TOOLBAR;
QTCREATOR_UTILS_EXPORT extern const Icon UNDO;

View File

@@ -181,6 +181,8 @@ QTCREATOR_UTILS_EXPORT QString imageName(quint32 processId)
if (QueryFullProcessImageName(handle, 0, path, &pathLen))
result = QString::fromUtf16(reinterpret_cast<const ushort*>(path));
CloseHandle(handle);
#else
Q_UNUSED(processId);
#endif
return result;
}

View File

@@ -29,6 +29,7 @@
#include <utils/pathchooser.h>
#include <utils/elidinglabel.h>
#include <utils/qtcassert.h>
#include <QDialogButtonBox>
#include <QLabel>
@@ -73,6 +74,7 @@ KitInformation::ItemList AndroidGdbServerKitInformation::toUserOutput(const Kit
KitConfigWidget *AndroidGdbServerKitInformation::createConfigWidget(Kit *kit) const
{
QTC_ASSERT(kit, return nullptr);
return new AndroidGdbServerKitInformationWidget(kit, this);
}
@@ -94,11 +96,13 @@ bool AndroidGdbServerKitInformation::isAndroidKit(const Kit *kit)
FileName AndroidGdbServerKitInformation::gdbServer(const Kit *kit)
{
QTC_ASSERT(kit, return FileName());
return FileName::fromString(kit->value(AndroidGdbServerKitInformation::id()).toString());
}
void AndroidGdbServerKitInformation::setGdbSever(Kit *kit, const FileName &gdbServerCommand)
{
QTC_ASSERT(kit, return);
kit->setValue(AndroidGdbServerKitInformation::id(), gdbServerCommand.toString());
}

View File

@@ -132,7 +132,7 @@ AndroidPackageInstallationStepWidget::AndroidPackageInstallationStepWidget(Andro
QString AndroidPackageInstallationStepWidget::summaryText() const
{
return tr("<b>Make install</b>");
return "<b>" + tr("Make install") + "</b>";
}
QString AndroidPackageInstallationStepWidget::displayName() const

View File

@@ -237,8 +237,8 @@ void TestSettingsWidget::onAddFilterClicked()
{
TestFilterDialog dialog;
dialog.setWindowTitle(tr("Add Filter"));
dialog.setDetailsText(tr("<p>Specify a filter expression to be added to the list of filters."
"<br/>Wildcards are not supported.</p>"));
dialog.setDetailsText("<p>" + tr("Specify a filter expression to be added to the list of filters."
"<br/>Wildcards are not supported.") + "</p>");
if (dialog.exec() == QDialog::Accepted) {
const QString &filter = dialog.filterPath();
if (!filter.isEmpty())
@@ -254,8 +254,8 @@ void TestSettingsWidget::onEditFilterClicked()
TestFilterDialog dialog;
dialog.setWindowTitle(tr("Edit Filter"));
dialog.setDetailsText(tr("<p>Specify a filter expression that will replace \"%1\"."
"<br/>Wildcards are not supported.</p>").arg(oldFilter));
dialog.setDetailsText("<p>" + tr("Specify a filter expression that will replace \"%1\"."
"<br/>Wildcards are not supported.").arg(oldFilter) + "</p>");
dialog.setDefaultFilterPath(oldFilter);
if (dialog.exec() == QDialog::Accepted) {
const QString &edited = dialog.filterPath();

View File

@@ -196,7 +196,7 @@ void ClangHoverHandler::processToolTipInfo(const CppTools::ToolTipInfo &info)
}
if (!info.sizeInBytes.isEmpty())
text.append(tr("\n\n%1 bytes").arg(info.sizeInBytes));
text.append("\n\n" + tr("%1 bytes").arg(info.sizeInBytes));
setToolTip(text);
m_reportPriority(priority());

View File

@@ -86,7 +86,7 @@ Core::Id CMakeKitInformation::id()
CMakeTool *CMakeKitInformation::cmakeTool(const Kit *k)
{
if (!k)
return 0;
return nullptr;
const QVariant id = k->value(TOOL_ID);
return CMakeToolManager::findById(Core::Id::fromSetting(id));
@@ -142,11 +142,13 @@ KitInformation::ItemList CMakeKitInformation::toUserOutput(const Kit *k) const
KitConfigWidget *CMakeKitInformation::createConfigWidget(Kit *k) const
{
QTC_ASSERT(k, return nullptr);
return new Internal::CMakeKitConfigWidget(k, this);
}
void CMakeKitInformation::addToMacroExpander(Kit *k, Utils::MacroExpander *expander) const
{
QTC_ASSERT(k, return);
expander->registerFileVariables("CMake:Executable", tr("Path to the cmake executable"),
[k]() -> QString {
CMakeTool *tool = CMakeKitInformation::cmakeTool(k);
@@ -304,6 +306,8 @@ QStringList CMakeGeneratorKitInformation::generatorArguments(const Kit *k)
QVariant CMakeGeneratorKitInformation::defaultValue(const Kit *k) const
{
QTC_ASSERT(k, return QVariant());
CMakeTool *tool = CMakeKitInformation::cmakeTool(k);
if (!tool)
return QVariant();
@@ -426,6 +430,8 @@ void CMakeGeneratorKitInformation::fix(Kit *k)
void CMakeGeneratorKitInformation::upgrade(Kit *k)
{
QTC_ASSERT(k, return);
const QVariant value = k->value(GENERATOR_ID);
if (value.type() != QVariant::Map) {
GeneratorInfo info;
@@ -545,6 +551,8 @@ QVariant CMakeConfigurationKitInformation::defaultValue(const Kit *k) const
QList<Task> CMakeConfigurationKitInformation::validate(const Kit *k) const
{
QTC_ASSERT(k, return QList<Task>());
const QtSupport::BaseQtVersion *const version = QtSupport::QtKitInformation::qtVersion(k);
const ToolChain *const tcC = ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::C_LANGUAGE_ID);
const ToolChain *const tcCxx = ToolChainKitInformation::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
@@ -659,7 +667,7 @@ KitInformation::ItemList CMakeConfigurationKitInformation::toUserOutput(const Ki
KitConfigWidget *CMakeConfigurationKitInformation::createConfigWidget(Kit *k) const
{
if (!k)
return 0;
return nullptr;
return new Internal::CMakeConfigurationKitConfigWidget(k, this);
}

View File

@@ -146,9 +146,6 @@ bool CMakeRunConfiguration::fromMap(const QVariantMap &map)
extraAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(ct.workingDirectory);
}
setDisplayName(defaultDisplayName());
setDefaultDisplayName(defaultDisplayName());
return true;
}

View File

@@ -52,6 +52,10 @@ const char LAST_CATEGORY_KEY[] = "Core/NewDialog/LastCategory";
const char LAST_PLATFORM_KEY[] = "Core/NewDialog/LastPlatform";
const char ALLOW_ALL_TEMPLATES[] = "Core/NewDialog/AllowAllTemplates";
const char SHOW_PLATOFORM_FILTER[] = "Core/NewDialog/ShowPlatformFilter";
const char BLACKLISTED_CATEGORIES_KEY[] = "Core/NewDialog/BlacklistedCategories";
using namespace Core;
using namespace Core::Internal;
class WizardFactoryContainer
{
@@ -73,7 +77,11 @@ class PlatformFilterProxyModel : public QSortFilterProxyModel
{
// Q_OBJECT
public:
PlatformFilterProxyModel(QObject *parent = nullptr): QSortFilterProxyModel(parent) {}
PlatformFilterProxyModel(QObject *parent = nullptr): QSortFilterProxyModel(parent)
{
m_blacklistedCategories =
Id::fromStringList(ICore::settings()->value(BLACKLISTED_CATEGORIES_KEY).toStringList());
}
void setPlatform(Core::Id platform)
{
@@ -103,13 +111,18 @@ public:
QModelIndex sourceIndex = sourceModel()->index(sourceRow, 0, sourceParent);
Core::IWizardFactory *wizard =
factoryOfItem(qobject_cast<QStandardItemModel*>(sourceModel())->itemFromIndex(sourceIndex));
if (wizard)
if (wizard) {
if (m_blacklistedCategories.contains(Core::Id::fromString(wizard->category())))
return false;
return wizard->isAvailable(m_platform);
}
return true;
}
private:
Core::Id m_platform;
QSet<Id> m_blacklistedCategories;
};
#define ROW_HEIGHT 24

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CppTools::ClangBaseChecks</class>
<widget class="QWidget" name="CppTools::ClangBaseChecks">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>665</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>For appropriate options, consult the GCC or Clang manual pages or the &lt;a href=&quot;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html&quot;&gt;GCC online documentation&lt;/a&gt;.</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="CppTools::WrappableLineEdit" name="diagnosticOptionsTextEdit"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>CppTools::WrappableLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">cpptools/wrappablelineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -25,6 +25,7 @@
#include "clangdiagnosticconfigswidget.h"
#include "ui_clangdiagnosticconfigswidget.h"
#include "ui_clangbasechecks.h"
#include "ui_clazychecks.h"
#include "ui_tidychecks.h"
@@ -47,7 +48,7 @@ ClangDiagnosticConfigsWidget::ClangDiagnosticConfigsWidget(
, m_diagnosticConfigsModel(diagnosticConfigsModel)
{
m_ui->setupUi(this);
setupPluginsWidgets();
setupTabs();
connectConfigChooserCurrentIndex();
connect(m_ui->copyButton, &QPushButton::clicked,
@@ -99,7 +100,7 @@ void ClangDiagnosticConfigsWidget::onCopyButtonClicked()
emit customConfigsChanged(customConfigs());
syncConfigChooserToModel(customConfig.id());
m_ui->diagnosticOptionsTextEdit->setFocus();
m_clangBaseChecks->diagnosticOptionsTextEdit->setFocus();
}
}
@@ -123,6 +124,28 @@ void ClangDiagnosticConfigsWidget::onClangTidyItemChanged(QListWidgetItem *item)
updateConfig(config);
}
void ClangDiagnosticConfigsWidget::onClazyRadioButtonChanged(bool checked)
{
if (!checked)
return;
QString checks;
if (m_clazyChecks->clazyRadioDisabled->isChecked())
checks = QString();
else if (m_clazyChecks->clazyRadioLevel0->isChecked())
checks = "level0";
else if (m_clazyChecks->clazyRadioLevel1->isChecked())
checks = "level1";
else if (m_clazyChecks->clazyRadioLevel2->isChecked())
checks = "level2";
else if (m_clazyChecks->clazyRadioLevel3->isChecked())
checks = "level3";
ClangDiagnosticConfig config = currentConfig();
config.setClazyChecks(checks);
updateConfig(config);
}
static bool isAcceptedWarningOption(const QString &option)
{
return option == "-w"
@@ -162,7 +185,8 @@ static QStringList normalizeDiagnosticInputOptions(const QString &options)
void ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited()
{
// Clean up input
const QString diagnosticOptions = m_ui->diagnosticOptionsTextEdit->document()->toPlainText();
const QString diagnosticOptions = m_clangBaseChecks->diagnosticOptionsTextEdit->document()
->toPlainText();
const QStringList normalizedOptions = normalizeDiagnosticInputOptions(diagnosticOptions);
// Validate
@@ -231,7 +255,7 @@ void ClangDiagnosticConfigsWidget::syncOtherWidgetsToComboBox()
? m_notAcceptedOptions.value(config.id())
: config.clangOptions().join(QLatin1Char(' '));
setDiagnosticOptions(options);
m_ui->diagnosticOptionsTextEdit->setReadOnly(config.isReadOnly());
m_clangBaseChecks->diagnosticOptionsTextEdit->setReadOnly(config.isReadOnly());
syncClangTidyWidgets(config);
syncClazyWidgets(config);
@@ -265,31 +289,23 @@ void ClangDiagnosticConfigsWidget::syncClangTidyWidgets(const ClangDiagnosticCon
void ClangDiagnosticConfigsWidget::syncClazyWidgets(const ClangDiagnosticConfig &config)
{
const QString clazyChecks = config.clazyChecks();
QRadioButton *button = m_clazyChecks->clazyRadioDisabled;
if (clazyChecks.isEmpty())
m_clazyChecks->clazyLevel->setCurrentIndex(0);
else
m_clazyChecks->clazyLevel->setCurrentText(clazyChecks);
button = m_clazyChecks->clazyRadioDisabled;
else if (clazyChecks == "level0")
button = m_clazyChecks->clazyRadioLevel0;
else if (clazyChecks == "level1")
button = m_clazyChecks->clazyRadioLevel1;
else if (clazyChecks == "level2")
button = m_clazyChecks->clazyRadioLevel2;
else if (clazyChecks == "level3")
button = m_clazyChecks->clazyRadioLevel3;
button->setChecked(true);
m_clazyChecksWidget->setEnabled(!config.isReadOnly());
}
void ClangDiagnosticConfigsWidget::setClazyLevelDescription(int index)
{
// Levels descriptions are taken from https://github.com/KDE/clazy
static const QString levelDescriptions[] {
QString(),
tr("Very stable checks, 99.99% safe, no false-positives."),
tr("Similar to level 0, but sometimes (rarely) there might be\n"
"some false-positives."),
tr("Sometimes has false-positives (20-30%)."),
tr("Not always correct, possibly very noisy, might require\n"
"a knowledgeable developer to review, might have a very big\n"
"rate of false-positives, might have bugs.")
};
QTC_ASSERT(m_clazyChecks, return);
m_clazyChecks->levelDescription->setText(levelDescriptions[static_cast<unsigned>(index)]);
}
void ClangDiagnosticConfigsWidget::updateConfig(const ClangDiagnosticConfig &config)
{
m_diagnosticConfigsModel.appendOrUpdate(config);
@@ -308,10 +324,10 @@ const ClangDiagnosticConfig &ClangDiagnosticConfigsWidget::currentConfig() const
void ClangDiagnosticConfigsWidget::setDiagnosticOptions(const QString &options)
{
if (options != m_ui->diagnosticOptionsTextEdit->document()->toPlainText()) {
if (options != m_clangBaseChecks->diagnosticOptionsTextEdit->document()->toPlainText()) {
disconnectDiagnosticOptionsChanged();
m_ui->diagnosticOptionsTextEdit->document()->setPlainText(options);
m_clangBaseChecks->diagnosticOptionsTextEdit->document()->setPlainText(options);
const QString errorMessage
= validateDiagnosticOptions(normalizeDiagnosticInputOptions(options));
updateValidityWidgets(errorMessage);
@@ -351,6 +367,14 @@ void ClangDiagnosticConfigsWidget::disconnectClangTidyItemChanged()
this, &ClangDiagnosticConfigsWidget::onClangTidyItemChanged);
}
void ClangDiagnosticConfigsWidget::connectClazyRadioButtonClicked(QRadioButton *button)
{
connect(button,
&QRadioButton::clicked,
this,
&ClangDiagnosticConfigsWidget::onClazyRadioButtonChanged);
}
void ClangDiagnosticConfigsWidget::connectConfigChooserCurrentIndex()
{
connect(m_ui->configChooserComboBox,
@@ -369,14 +393,18 @@ void ClangDiagnosticConfigsWidget::disconnectConfigChooserCurrentIndex()
void ClangDiagnosticConfigsWidget::connectDiagnosticOptionsChanged()
{
connect(m_ui->diagnosticOptionsTextEdit->document(), &QTextDocument::contentsChanged,
this, &ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited);
connect(m_clangBaseChecks->diagnosticOptionsTextEdit->document(),
&QTextDocument::contentsChanged,
this,
&ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited);
}
void ClangDiagnosticConfigsWidget::disconnectDiagnosticOptionsChanged()
{
disconnect(m_ui->diagnosticOptionsTextEdit->document(), &QTextDocument::contentsChanged,
this, &ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited);
disconnect(m_clangBaseChecks->diagnosticOptionsTextEdit->document(),
&QTextDocument::contentsChanged,
this,
&ClangDiagnosticConfigsWidget::onDiagnosticOptionsEdited);
}
Core::Id ClangDiagnosticConfigsWidget::currentConfigId() const
@@ -401,31 +429,31 @@ void ClangDiagnosticConfigsWidget::refresh(
syncWidgetsToModel(configToSelect);
}
void ClangDiagnosticConfigsWidget::setupPluginsWidgets()
void ClangDiagnosticConfigsWidget::setupTabs()
{
m_clangBaseChecks.reset(new CppTools::Ui::ClangBaseChecks);
m_clangBaseChecksWidget = new QWidget();
m_clangBaseChecks->setupUi(m_clangBaseChecksWidget);
m_clazyChecks.reset(new CppTools::Ui::ClazyChecks);
m_clazyChecksWidget = new QWidget();
m_clazyChecks->setupUi(m_clazyChecksWidget);
connect(m_clazyChecks->clazyLevel,
static_cast<void (QComboBox::*)(int index)>(&QComboBox::currentIndexChanged),
[this](int index) {
setClazyLevelDescription(index);
ClangDiagnosticConfig config = currentConfig();
if (index == 0)
config.setClazyChecks(QString());
else
config.setClazyChecks(m_clazyChecks->clazyLevel->itemText(index));
updateConfig(config);
});
connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioDisabled);
connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioLevel0);
connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioLevel1);
connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioLevel2);
connectClazyRadioButtonClicked(m_clazyChecks->clazyRadioLevel3);
m_tidyChecks.reset(new CppTools::Ui::TidyChecks);
m_tidyChecksWidget = new QWidget();
m_tidyChecks->setupUi(m_tidyChecksWidget);
connectClangTidyItemChanged();
m_ui->pluginChecksTabs->addTab(m_tidyChecksWidget, tr("Clang-Tidy"));
m_ui->pluginChecksTabs->addTab(m_clazyChecksWidget, tr("Clazy"));
m_ui->pluginChecksTabs->setCurrentIndex(0);
m_ui->tabWidget->addTab(m_clangBaseChecksWidget, tr("Clang"));
m_ui->tabWidget->addTab(m_tidyChecksWidget, tr("Clang-Tidy"));
m_ui->tabWidget->addTab(m_clazyChecksWidget, tr("Clazy"));
m_ui->tabWidget->setCurrentIndex(0);
}
} // CppTools namespace

View File

@@ -35,12 +35,16 @@
#include <memory>
QT_FORWARD_DECLARE_CLASS(QListWidgetItem)
QT_BEGIN_NAMESPACE
class QListWidgetItem;
class QRadioButton;
QT_END_NAMESPACE
namespace CppTools {
namespace Ui {
class ClangDiagnosticConfigsWidget;
class ClangBaseChecks;
class ClazyChecks;
class TidyChecks;
}
@@ -67,12 +71,13 @@ signals:
void customConfigsChanged(const CppTools::ClangDiagnosticConfigs &customConfigs);
private:
void setupPluginsWidgets();
void setupTabs();
void onCurrentConfigChanged(int);
void onCopyButtonClicked();
void onRemoveButtonClicked();
void onClangTidyItemChanged(QListWidgetItem *item);
void onClazyRadioButtonChanged(bool checked);
void onDiagnosticOptionsEdited();
@@ -82,7 +87,6 @@ private:
void syncClangTidyWidgets(const ClangDiagnosticConfig &config);
void syncClazyWidgets(const ClangDiagnosticConfig &config);
void setClazyLevelDescription(int index);
void updateConfig(const CppTools::ClangDiagnosticConfig &config);
bool isConfigChooserEmpty() const;
@@ -94,6 +98,8 @@ private:
void connectClangTidyItemChanged();
void disconnectClangTidyItemChanged();
void connectClazyRadioButtonClicked(QRadioButton *button);
void connectConfigChooserCurrentIndex();
void disconnectConfigChooserCurrentIndex();
void connectDiagnosticOptionsChanged();
@@ -104,6 +110,9 @@ private:
ClangDiagnosticConfigsModel m_diagnosticConfigsModel;
QHash<Core::Id, QString> m_notAcceptedOptions;
std::unique_ptr<CppTools::Ui::ClangBaseChecks> m_clangBaseChecks;
QWidget *m_clangBaseChecksWidget = nullptr;
std::unique_ptr<CppTools::Ui::ClazyChecks> m_clazyChecks;
QWidget *m_clazyChecksWidget = nullptr;

View File

@@ -13,16 +13,9 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Configuration to use:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="configChooserComboBox">
<property name="sizePolicy">
@@ -49,6 +42,8 @@
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
@@ -81,35 +76,16 @@
</layout>
</item>
<item>
<widget class="CppTools::WrappableLineEdit" name="diagnosticOptionsTextEdit"/>
<widget class="QTabWidget" name="tabWidget"/>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>For appropriate options, consult the GCC or Clang manual pages or the &lt;a href=&quot;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html&quot;&gt;GCC online documentation&lt;/a&gt;.</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QTabWidget" name="pluginChecksTabs"/>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>CppTools::WrappableLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">cpptools/wrappablelineedit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>configChooserComboBox</tabstop>
<tabstop>copyButton</tabstop>
<tabstop>removeButton</tabstop>
<tabstop>diagnosticOptionsTextEdit</tabstop>
</tabstops>
<resources/>
<connections/>

View File

@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>503</width>
<height>73</height>
<width>609</width>
<height>220</height>
</rect>
</property>
<property name="sizePolicy">
@@ -19,92 +19,73 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="clazyLevel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Disable</string>
<string>Each level adds checks to the previous level. For more information, see &lt;a href=&quot;https://github.com/KDE/clazy&quot;&gt;clazy's homepage&lt;/a&gt;.</string>
</property>
</item>
<item>
<property name="text">
<string>level0</string>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</item>
<item>
<property name="text">
<string>level1</string>
</property>
</item>
<item>
<property name="text">
<string>level2</string>
</property>
</item>
<item>
<property name="text">
<string>level3</string>
</property>
</item>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>10</number>
</property>
<item>
<widget class="QLabel" name="levelDescription">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<widget class="QRadioButton" name="clazyRadioDisabled">
<property name="text">
<string>Disabled</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="clazyRadioLevel0">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Level 0: No false positives</string>
</property>
</widget>
</item>
</layout>
<item>
<widget class="QRadioButton" name="clazyRadioLevel1">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Level 1: Very few false positives</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QRadioButton" name="clazyRadioLevel2">
<property name="toolTip">
<string/>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<property name="text">
<string>Level 2: More false positives</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="clazyRadioLevel3">
<property name="toolTip">
<string>Not always correct, possibly very noisy, might require a knowledgeable developer to review, might have a very big rate of false-positives, might have bugs.</string>
</property>
<property name="text">
<string>Level 3: Experimental checks</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
<width>20</width>
<height>34</height>
</size>
</property>
</spacer>

View File

@@ -106,7 +106,7 @@
</sizepolicy>
</property>
<property name="title">
<string>Clang Code Model Warnings</string>
<string>Clang Diagnostics</string>
</property>
<property name="checkable">
<bool>false</bool>
@@ -114,19 +114,6 @@
<layout class="QVBoxLayout" name="verticalLayout_3"/>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>151</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>

View File

@@ -191,6 +191,7 @@ FORMS += \
cppcodemodelsettingspage.ui \
cppcodestylesettingspage.ui \
cppfilesettingspage.ui \
clangbasechecks.ui \
clazychecks.ui \
tidychecks.ui

View File

@@ -43,6 +43,7 @@ Project {
"builtinindexingsupport.h",
"builtincursorinfo.cpp",
"builtincursorinfo.h",
"clangbasechecks.ui",
"clangdiagnosticconfig.cpp",
"clangdiagnosticconfig.h",
"clangdiagnosticconfigsmodel.cpp",

View File

@@ -77,6 +77,8 @@ QVariant DebuggerKitInformation::defaultValue(const Kit *k) const
void DebuggerKitInformation::setup(Kit *k)
{
QTC_ASSERT(k, return);
// This can be anything (Id, binary path, "auto")
// With 3.0 we have:
// <value type="QString" key="Debugger.Information">{75ecf347-f221-44c3-b613-ea1d29929cd4}</value>
@@ -158,6 +160,8 @@ void DebuggerKitInformation::setup(Kit *k)
// This handles the upgrade path from 2.8 to 3.0
void DebuggerKitInformation::fix(Kit *k)
{
QTC_ASSERT(k, return);
// This can be Id, binary path, but not "auto" anymore.
const QVariant rawId = k->value(DebuggerKitInformation::id());
@@ -238,7 +242,7 @@ DebuggerKitInformation::ConfigurationErrors DebuggerKitInformation::configuratio
const DebuggerItem *DebuggerKitInformation::debugger(const Kit *kit)
{
QTC_ASSERT(kit, return 0);
QTC_ASSERT(kit, return nullptr);
const QVariant id = kit->value(DebuggerKitInformation::id());
return DebuggerItemManager::findById(id);
}
@@ -299,6 +303,7 @@ KitConfigWidget *DebuggerKitInformation::createConfigWidget(Kit *k) const
void DebuggerKitInformation::addToMacroExpander(Kit *kit, MacroExpander *expander) const
{
QTC_ASSERT(kit, return);
expander->registerVariable("Debugger:Name", tr("Name of Debugger"),
[kit]() -> QString {
const DebuggerItem *item = debugger(kit);
@@ -353,6 +358,7 @@ void DebuggerKitInformation::setDebugger(Kit *k, const QVariant &id)
{
// Only register reasonably complete debuggers.
QTC_ASSERT(DebuggerItemManager::findById(id), return);
QTC_ASSERT(k, return);
k->setValue(DebuggerKitInformation::id(), id);
}

View File

@@ -1331,6 +1331,7 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
// be handled in the result handler.
// -- or --
// *stopped arriving earlier than ^done response to an -exec-step
notifyInferiorRunOk();
notifyInferiorSpontaneousStop();
} else if (state() == InferiorStopOk) {
// That's expected.

View File

@@ -157,6 +157,15 @@ void LldbEngine::debugLastCommand()
runCommand(m_lastDebuggableCommand);
}
void LldbEngine::handleAttachedToCore()
{
QTC_ASSERT(state() == InferiorUnrunnable, qDebug() << state();return);
showMessage("Attached to core.");
reloadFullStack();
reloadModules();
updateLocals();
}
void LldbEngine::shutdownInferior()
{
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
@@ -851,9 +860,11 @@ void LldbEngine::handleStateNotification(const GdbMi &reportedState)
} else if (newState == "enginerunandinferiorstopok") {
notifyEngineRunAndInferiorStopOk();
continueInferior();
} else if (newState == "enginerunokandinferiorunrunnable")
} else if (newState == "enginerunokandinferiorunrunnable") {
notifyEngineRunOkAndInferiorUnrunnable();
else if (newState == "inferiorshutdownfinished")
if (runParameters().startMode == AttachCore)
handleAttachedToCore();
} else if (newState == "inferiorshutdownfinished")
notifyInferiorShutdownFinished();
else if (newState == "engineshutdownfinished")
notifyEngineShutdownFinished();

View File

@@ -136,6 +136,7 @@ private:
void runCommand(const DebuggerCommand &cmd) override;
void debugLastCommand() override;
void handleAttachedToCore();
private:
DebuggerCommand m_lastDebuggableCommand;

View File

@@ -481,12 +481,16 @@ void QmlCppEngine::slaveEngineStateChanged
break;
}
case InferiorRunOk: {
if (state() == EngineRunRequested)
if (state() == EngineRunRequested) {
notifyEngineRunAndInferiorRunOk();
else if (state() == InferiorRunRequested)
} else if (state() == InferiorRunRequested) {
notifyInferiorRunOk();
else
} else if (state() == InferiorStopOk) {
notifyInferiorRunRequested();
notifyInferiorRunOk();
} else {
QTC_ASSERT(false, qDebug() << state());
}
if (m_qmlEngine->state() == InferiorStopOk) {
// track qml engine again

View File

@@ -77,9 +77,9 @@
<item>
<widget class="QCheckBox" name="draftCheckBox">
<property name="toolTip">
<string>Checked - Mark change as private
Unchecked - Unmark change as private
Semi-checked - Do not change current state</string>
<string>Checked - Mark change as private.
Unchecked - Remove mark.
Partially checked - Do not change current state.</string>
</property>
<property name="text">
<string>&amp;Draft/private</string>

View File

@@ -34,6 +34,7 @@
#include <QBuffer>
#include <QContextMenuEvent>
#include <QCoreApplication>
#include <QTimer>
#include <QVBoxLayout>
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
#include <QWebEngineContextMenuData>
@@ -89,7 +90,20 @@ WebEngineHelpViewer::WebEngineHelpViewer(QWidget *parent) :
setPalette(p);
connect(m_widget, &QWebEngineView::urlChanged, this, &WebEngineHelpViewer::sourceChanged);
connect(m_widget, &QWebEngineView::loadStarted, this, &WebEngineHelpViewer::slotLoadStarted);
connect(m_widget, &QWebEngineView::loadStarted, this, [this] {
slotLoadStarted();
// Work around QTBUG-65223: if only anchor changed, we never get a loadFinished signal
// If a link is clicked in a page, it can happen that the new URL has not yet been set,
// so we need to delay a bit...
QTimer::singleShot(/*magic timeout=*/150, this, [this] {
QUrl urlWithoutFragment = source();
urlWithoutFragment.setFragment(QString());
qDebug() << urlWithoutFragment << m_previousUrlWithoutFragment;
if (urlWithoutFragment == m_previousUrlWithoutFragment)
slotLoadFinished();
m_previousUrlWithoutFragment = urlWithoutFragment;
});
});
connect(m_widget, &QWebEngineView::loadFinished, this, &WebEngineHelpViewer::slotLoadFinished);
connect(m_widget, &QWebEngineView::titleChanged, this, &WebEngineHelpViewer::titleChanged);
connect(m_widget->page(), &QWebEnginePage::linkHovered, this, &WebEngineHelpViewer::setToolTip);

View File

@@ -97,6 +97,7 @@ public:
private:
WebView *m_widget;
QUrl m_previousUrlWithoutFragment;
};
} // namespace Internal

View File

@@ -15,7 +15,6 @@
\"Category\" : \"Modeling\",
\"Description\" : \"Graphical modeling with structured diagrams.\",
\"Url\" : \"http://www.qt.io\",
\"Experimental\" : true,
$$dependencyList,
\"Mimetypes\" : [

View File

@@ -187,7 +187,7 @@ void ActionHandler::createActions()
d->synchronizeBrowserAction = registerCommand(
Constants::ACTION_SYNC_BROWSER, nullptr, Core::Context(),
tr("Synchronize Browser and Diagram") + "<br><i><small>"
+ tr("Press && Hold for options") + "</small></i>", QKeySequence(),
+ tr("Press && Hold for Options") + "</small></i>", QKeySequence(),
Utils::Icons::LINK.icon())->action();
d->synchronizeBrowserAction->setCheckable(true);

View File

@@ -47,10 +47,10 @@ BuildStepList::BuildStepList(QObject *parent, Core::Id id)
: ProjectConfiguration(parent, id)
{
if (id == Constants::BUILDSTEPS_BUILD) {
//: Display name of the clean build step list. Used as part of the labels in the project window.
//: Display name of the build build step list. Used as part of the labels in the project window.
setDefaultDisplayName(tr("Build"));
} else if (id == Constants::BUILDSTEPS_CLEAN) {
//: Display name of the build build step list. Used as part of the labels in the project window.
//: Display name of the clean build step list. Used as part of the labels in the project window.
setDefaultDisplayName(tr("Clean"));
}
}
@@ -130,7 +130,7 @@ bool BuildStepList::fromMap(const QVariantMap &map)
}
}
}
QTC_CHECK(handled);
QTC_ASSERT(handled, qDebug() << "No factory for build step" << stepId.toString() << "found.");
}
return true;
}

View File

@@ -649,13 +649,21 @@ void CustomToolChainConfigWidget::applyImpl()
tc->setCompilerCommand(m_compilerCommand->fileName());
tc->setMakeCommand(m_makeCommand->fileName());
tc->setTargetAbi(m_abiWidget->currentAbi());
tc->setPredefinedMacros(Macro::toMacros(m_predefinedDetails->text().toUtf8()));
Macros macros = Utils::transform<QVector>(
m_predefinedDetails->text().split('\n', QString::SkipEmptyParts),
[](const QString &m) {
return Macro::fromKeyValue(m);
});
tc->setPredefinedMacros(macros);
tc->setHeaderPaths(m_headerDetails->entries());
tc->setCxx11Flags(m_cxx11Flags->text().split(QLatin1Char(',')));
tc->setMkspecs(m_mkspecs->text());
tc->setDisplayName(displayName); // reset display name
tc->setOutputParserId(Core::Id::fromSetting(m_errorParserComboBox->currentData()));
tc->setCustomParserSettings(m_customParserSettings);
setFromToolchain(); // Refresh with actual data from the toolchain. This shows what e.g. the
// macro parser did with the input.
}
void CustomToolChainConfigWidget::setFromToolchain()
@@ -666,7 +674,10 @@ void CustomToolChainConfigWidget::setFromToolchain()
m_compilerCommand->setFileName(tc->compilerCommand());
m_makeCommand->setFileName(FileName::fromString(tc->makeCommand(Environment())));
m_abiWidget->setAbis(QList<Abi>(), tc->targetAbi());
m_predefinedMacros->setPlainText(QString::fromUtf8(Macro::toByteArray(tc->rawPredefinedMacros())));
const QStringList macroLines = Utils::transform<QList>(tc->rawPredefinedMacros(), [](const Macro &m) {
return QString::fromUtf8(m.toKeyValue(QByteArray()));
});
m_predefinedMacros->setPlainText(macroLines.join('\n'));
m_headerPaths->setPlainText(tc->headerPathsList().join('\n'));
m_cxx11Flags->setText(tc->cxx11Flags().join(QLatin1Char(',')));
m_mkspecs->setText(tc->mkspecs());

View File

@@ -78,6 +78,10 @@ const int SORT_ROLE = Qt::UserRole + 2;
const char PROJECTSDIRECTORYROOT_ID[] = "A.Projects";
const char C_FOLDERNAVIGATIONWIDGET[] = "ProjectExplorer.FolderNavigationWidget";
const char kSettingsBase[] = "FolderNavigationWidget.";
const char kHiddenFilesKey[] = ".HiddenFilesFilter";
const char kSyncKey[] = ".SyncWithEditor";
namespace ProjectExplorer {
namespace Internal {
@@ -732,18 +736,18 @@ void FolderNavigationWidgetFactory::saveSettings(QSettings *settings, int positi
{
auto fnw = qobject_cast<FolderNavigationWidget *>(widget);
QTC_ASSERT(fnw, return);
const QString baseKey = QLatin1String("FolderNavigationWidget.") + QString::number(position);
settings->setValue(baseKey + QLatin1String(".HiddenFilesFilter"), fnw->hiddenFilesFilter());
settings->setValue(baseKey + QLatin1String(".SyncWithEditor"), fnw->autoSynchronization());
const QString base = kSettingsBase + QString::number(position);
settings->setValue(base + kHiddenFilesKey, fnw->hiddenFilesFilter());
settings->setValue(base + kSyncKey, fnw->autoSynchronization());
}
void FolderNavigationWidgetFactory::restoreSettings(QSettings *settings, int position, QWidget *widget)
{
auto fnw = qobject_cast<FolderNavigationWidget *>(widget);
QTC_ASSERT(fnw, return);
const QString baseKey = QLatin1String("FolderNavigationWidget.") + QString::number(position);
fnw->setHiddenFilesFilter(settings->value(baseKey + QLatin1String(".HiddenFilesFilter"), false).toBool());
fnw->setAutoSynchronization(settings->value(baseKey + QLatin1String(".SyncWithEditor"), true).toBool());
const QString base = kSettingsBase + QString::number(position);
fnw->setHiddenFilesFilter(settings->value(base + kHiddenFilesKey, false).toBool());
fnw->setAutoSynchronization(settings->value(base + kSyncKey, true).toBool());
}
void FolderNavigationWidgetFactory::insertRootDirectory(const RootDirectory &directory)

View File

@@ -83,7 +83,7 @@ void warnAboutUnsupportedKeys(const QVariantMap &map, const QString &name, const
QString typeAndName = name;
if (!type.isEmpty() && !name.isEmpty())
typeAndName = QString("%1(\"%2\")").arg(type, name);
typeAndName = QString("%1 (\"%2\")").arg(type, name);
qWarning().noquote() << QString("Field %1 has unsupported keys: %2").arg(typeAndName, map.keys().join(", "));
}
@@ -362,7 +362,7 @@ bool LabelField::parseData(const QVariant &data, QString *errorMessage)
{
if (data.type() != QVariant::Map) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"Label(\"%1\") data is not an object.")
"Label (\"%1\") data is not an object.")
.arg(name());
return false;
}
@@ -374,7 +374,7 @@ bool LabelField::parseData(const QVariant &data, QString *errorMessage)
if (m_text.isEmpty()) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"Label(\"%1\") has no trText.")
"Label (\"%1\") has no trText.")
.arg(name());
return false;
}
@@ -403,7 +403,7 @@ bool SpacerField::parseData(const QVariant &data, QString *errorMessage)
if (data.type() != QVariant::Map) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"Spacer(\"%1\") data is not an object.")
"Spacer (\"%1\") data is not an object.")
.arg(name());
return false;
}
@@ -415,7 +415,7 @@ bool SpacerField::parseData(const QVariant &data, QString *errorMessage)
if (!ok) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"Spacer(\"%1\") property \"factor\" is no integer value.")
"Spacer (\"%1\") property \"factor\" is no integer value.")
.arg(name());
return false;
}
@@ -448,7 +448,7 @@ bool LineEditField::parseData(const QVariant &data, QString *errorMessage)
if (data.type() != QVariant::Map) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"LineEdit(\"%1\") data is not an object.")
"LineEdit (\"%1\") data is not an object.")
.arg(name());
return false;
}
@@ -466,7 +466,7 @@ bool LineEditField::parseData(const QVariant &data, QString *errorMessage)
m_validatorRegExp = QRegularExpression(pattern);
if (!m_validatorRegExp.isValid()) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"LineEdit(\"%1\") has an invalid regular expression \"%1\" in \"validator\".")
"LineEdit (\"%1\") has an invalid regular expression \"%2\" in \"validator\".")
.arg(name(), pattern);
m_validatorRegExp = QRegularExpression();
return false;
@@ -563,7 +563,7 @@ bool TextEditField::parseData(const QVariant &data, QString *errorMessage)
if (data.type() != QVariant::Map) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"TextEdit(\"%1\") data is not an object.")
"TextEdit (\"%1\") data is not an object.")
.arg(name());
return false;
}
@@ -731,7 +731,7 @@ bool CheckBoxField::parseData(const QVariant &data, QString *errorMessage)
if (data.type() != QVariant::Map) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"CheckBox(\"%1\") data is not an object.")
"CheckBox (\"%1\") data is not an object.")
.arg(name());
return false;
}
@@ -742,7 +742,7 @@ bool CheckBoxField::parseData(const QVariant &data, QString *errorMessage)
m_uncheckedValue = consumeValue(tmp, "uncheckedValue", false).toString();
if (m_checkedValue == m_uncheckedValue) {
*errorMessage= QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"CheckBox(\"%1\") values for checked and unchecked state are identical.")
"CheckBox (\"%1\") values for checked and unchecked state are identical.")
.arg(name());
return false;
}
@@ -840,7 +840,7 @@ bool ListField::parseData(const QVariant &data, QString *errorMessage)
{
if (data.type() != QVariant::Map) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"%1(\"%2\") data is not an object.")
"%1 (\"%2\") data is not an object.")
.arg(type(), name());
return false;
}
@@ -851,14 +851,14 @@ bool ListField::parseData(const QVariant &data, QString *errorMessage)
m_index = consumeValue(tmp, "index", 0).toInt(&ok);
if (!ok) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"%1(\"%2\") \"index\" is not an integer value.")
"%1 (\"%2\") \"index\" is not an integer value.")
.arg(type(), name());
return false;
}
m_disabledIndex = consumeValue(tmp, "disabledIndex", -1).toInt(&ok);
if (!ok) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"%1(\"%2\") \"disabledIndex\" is not an integer value.")
"%1 (\"%2\") \"disabledIndex\" is not an integer value.")
.arg(type(), name());
return false;
}
@@ -866,13 +866,13 @@ bool ListField::parseData(const QVariant &data, QString *errorMessage)
const QVariant value = consumeValue(tmp, "items");
if (value.isNull()) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"%1(\"%2\") \"items\" missing.")
"%1 (\"%2\") \"items\" missing.")
.arg(type(), name());
return false;
}
if (value.type() != QVariant::List) {
*errorMessage = QCoreApplication::translate("ProjectExplorer::JsonFieldPage",
"%1(\"%2\") \"items\" is not a JSON list.")
"%1 (\"%2\") \"items\" is not a JSON list.")
.arg(type(), name());
return false;
}
@@ -935,7 +935,7 @@ void ListField::initializeData(MacroExpander *expander)
qWarning().noquote() << QString("Icon file \"%1\" not found.").arg(QDir::toNativeSeparators(iconPath));
}
} else {
qWarning().noquote() << QString("%1(\"%2\") has no parentWidget JsonFieldPage to get the icon path.").arg(type(), name());
qWarning().noquote() << QString("%1 (\"%2\") has no parentWidget JsonFieldPage to get the icon path.").arg(type(), name());
}
}
expandedValuesItems.append(expandedValuesItem);

View File

@@ -93,6 +93,8 @@ QList<Task> SysRootKitInformation::validate(const Kit *k) const
KitConfigWidget *SysRootKitInformation::createConfigWidget(Kit *k) const
{
QTC_ASSERT(k, return nullptr);
return new Internal::SysRootInformationConfigWidget(k, this);
}
@@ -103,6 +105,8 @@ KitInformation::ItemList SysRootKitInformation::toUserOutput(const Kit *k) const
void SysRootKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const
{
QTC_ASSERT(kit, return);
expander->registerFileVariables("SysRoot", tr("Sys Root"), [kit]() -> QString {
return SysRootKitInformation::sysRoot(kit).toString();
});
@@ -202,6 +206,8 @@ QList<Task> ToolChainKitInformation::validate(const Kit *k) const
void ToolChainKitInformation::upgrade(Kit *k)
{
QTC_ASSERT(k, return);
const Core::Id oldIdV1 = KITINFORMATION_ID_V1;
const Core::Id oldIdV2 = KITINFORMATION_ID_V2;
@@ -285,6 +291,8 @@ static Core::Id findLanguage(const QString &ls)
void ToolChainKitInformation::setup(Kit *k)
{
QTC_ASSERT(ToolChainManager::isLoaded(), return);
QTC_ASSERT(k, return);
const QVariantMap value = k->value(ToolChainKitInformation::id()).toMap();
for (auto i = value.constBegin(); i != value.constEnd(); ++i) {
@@ -312,6 +320,7 @@ void ToolChainKitInformation::setup(Kit *k)
KitConfigWidget *ToolChainKitInformation::createConfigWidget(Kit *k) const
{
QTC_ASSERT(k, return nullptr);
return new Internal::ToolChainInformationConfigWidget(k, this);
}
@@ -336,6 +345,8 @@ void ToolChainKitInformation::addToEnvironment(const Kit *k, Utils::Environment
void ToolChainKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const
{
QTC_ASSERT(kit, return);
// Compatibility with Qt Creator < 4.2:
expander->registerVariable("Compiler:Name", tr("Compiler"),
[kit]() -> QString {
@@ -365,9 +376,7 @@ void ToolChainKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander
IOutputParser *ToolChainKitInformation::createOutputParser(const Kit *k) const
{
ToolChain *tc = toolChain(k, Constants::CXX_LANGUAGE_ID);
if (tc)
return tc->outputParser();
return 0;
return tc ? tc->outputParser() : nullptr;
}
QSet<Core::Id> ToolChainKitInformation::availableFeatures(const Kit *k) const
@@ -385,9 +394,9 @@ Core::Id ToolChainKitInformation::id()
ToolChain *ToolChainKitInformation::toolChain(const Kit *k, Core::Id language)
{
QTC_ASSERT(ToolChainManager::isLoaded(), return 0);
QTC_ASSERT(ToolChainManager::isLoaded(), return nullptr);
if (!k)
return 0;
return nullptr;
QVariantMap value = k->value(ToolChainKitInformation::id()).toMap();
const QByteArray id = value.value(language.toString(), QByteArray()).toByteArray();
return ToolChainManager::findToolChain(id);
@@ -395,6 +404,8 @@ ToolChain *ToolChainKitInformation::toolChain(const Kit *k, Core::Id language)
QList<ToolChain *> ToolChainKitInformation::toolChains(const Kit *k)
{
QTC_ASSERT(k, return QList<ToolChain *>());
const QVariantMap value = k->value(ToolChainKitInformation::id()).toMap();
const QList<ToolChain *> tcList
= Utils::transform(ToolChainManager::allLanguages().toList(),
@@ -407,6 +418,7 @@ QList<ToolChain *> ToolChainKitInformation::toolChains(const Kit *k)
void ToolChainKitInformation::setToolChain(Kit *k, ToolChain *tc)
{
QTC_ASSERT(tc, return);
QTC_ASSERT(k, return);
QVariantMap result = k->value(ToolChainKitInformation::id()).toMap();
result.insert(tc->language().toString(), tc->id());
@@ -426,6 +438,7 @@ void ToolChainKitInformation::setToolChain(Kit *k, ToolChain *tc)
void ToolChainKitInformation::setAllToolChainsToMatch(Kit *k, ToolChain *tc)
{
QTC_ASSERT(tc, return);
QTC_ASSERT(k, return);
const QList<ToolChain *> allTcList = ToolChainManager::toolChains();
QTC_ASSERT(allTcList.contains(tc), return);
@@ -464,6 +477,7 @@ void ToolChainKitInformation::setAllToolChainsToMatch(Kit *k, ToolChain *tc)
void ToolChainKitInformation::clearToolChain(Kit *k, Core::Id language)
{
QTC_ASSERT(language.isValid(), return);
QTC_ASSERT(k, return);
QVariantMap result = k->value(ToolChainKitInformation::id()).toMap();
result.insert(language.toString(), QByteArray());
@@ -557,11 +571,13 @@ QList<Task> DeviceTypeKitInformation::validate(const Kit *k) const
KitConfigWidget *DeviceTypeKitInformation::createConfigWidget(Kit *k) const
{
QTC_ASSERT(k, return nullptr);
return new Internal::DeviceTypeInformationConfigWidget(k, this);
}
KitInformation::ItemList DeviceTypeKitInformation::toUserOutput(const Kit *k) const
{
QTC_ASSERT(k, return {});
Core::Id type = deviceTypeId(k);
QString typeDisplayName = tr("Unknown device type");
if (type.isValid()) {
@@ -588,6 +604,7 @@ const Core::Id DeviceTypeKitInformation::deviceTypeId(const Kit *k)
void DeviceTypeKitInformation::setDeviceTypeId(Kit *k, Core::Id type)
{
QTC_ASSERT(k, return);
k->setValue(DeviceTypeKitInformation::id(), type.toSetting());
}
@@ -676,6 +693,7 @@ void DeviceKitInformation::setup(Kit *k)
KitConfigWidget *DeviceKitInformation::createConfigWidget(Kit *k) const
{
QTC_ASSERT(k, return nullptr);
return new Internal::DeviceInformationConfigWidget(k, this);
}
@@ -693,6 +711,7 @@ KitInformation::ItemList DeviceKitInformation::toUserOutput(const Kit *k) const
void DeviceKitInformation::addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const
{
QTC_ASSERT(kit, return);
expander->registerVariable("Device:HostAddress", tr("Host address"),
[kit]() -> QString {
const IDevice::ConstPtr device = DeviceKitInformation::device(kit);
@@ -743,6 +762,7 @@ void DeviceKitInformation::setDevice(Kit *k, IDevice::ConstPtr dev)
void DeviceKitInformation::setDeviceId(Kit *k, Core::Id id)
{
QTC_ASSERT(k, return);
k->setValue(DeviceKitInformation::id(), id.toSetting());
}
@@ -802,6 +822,8 @@ QVariant EnvironmentKitInformation::defaultValue(const Kit *k) const
QList<Task> EnvironmentKitInformation::validate(const Kit *k) const
{
QList<Task> result;
QTC_ASSERT(k, return result);
const QVariant variant = k->value(EnvironmentKitInformation::id());
if (!variant.isNull() && !variant.canConvert(QVariant::List)) {
result.append(Task(Task::Error, tr("The environment setting value is invalid."),
@@ -812,6 +834,8 @@ QList<Task> EnvironmentKitInformation::validate(const Kit *k) const
void EnvironmentKitInformation::fix(Kit *k)
{
QTC_ASSERT(k, return);
const QVariant variant = k->value(EnvironmentKitInformation::id());
if (!variant.isNull() && !variant.canConvert(QVariant::List)) {
qWarning("Kit \"%s\" has a wrong environment value set.", qPrintable(k->displayName()));
@@ -821,28 +845,22 @@ void EnvironmentKitInformation::fix(Kit *k)
void EnvironmentKitInformation::addToEnvironment(const Kit *k, Utils::Environment &env) const
{
const QVariant envValue = k->value(EnvironmentKitInformation::id());
if (envValue.isValid()) {
const QStringList values = Utils::transform(envValue.toStringList(), [k](const QString &v) {
return k->macroExpander()->expand(v);
});
const QStringList values
= Utils::transform(Utils::EnvironmentItem::toStringList(environmentChanges(k)),
[k](const QString &v) { return k->macroExpander()->expand(v); });
env.modify(Utils::EnvironmentItem::fromStringList(values));
}
}
KitConfigWidget *EnvironmentKitInformation::createConfigWidget(Kit *k) const
{
QTC_ASSERT(k, return nullptr);
return new Internal::KitEnvironmentConfigWidget(k, this);
}
KitInformation::ItemList EnvironmentKitInformation::toUserOutput(const Kit *k) const
{
ItemList retVal;
QVariant envValue = k->value(EnvironmentKitInformation::id());
if (envValue.isValid())
retVal << qMakePair(QLatin1Literal("Environment"), envValue.toStringList().join(QLatin1Literal("<br>")));
return retVal;
return { qMakePair(tr("Environment"),
Utils::EnvironmentItem::toStringList(environmentChanges(k)).join("<br>")) };
}
Core::Id EnvironmentKitInformation::id()

View File

@@ -124,7 +124,8 @@ private:
// --------------------------------------------------------------------
QbsBuildStep::QbsBuildStep(ProjectExplorer::BuildStepList *bsl) :
ProjectExplorer::BuildStep(bsl, Constants::QBS_BUILDSTEP_ID)
ProjectExplorer::BuildStep(bsl, Constants::QBS_BUILDSTEP_ID),
m_enableQmlDebugging(QtSupport::BaseQtVersion::isQmlDebuggingSupported(target()->kit()))
{
setDisplayName(tr("Qbs Build"));
setQbsConfiguration(QVariantMap());
@@ -204,6 +205,8 @@ QVariantMap QbsBuildStep::qbsConfiguration(VariableHandling variableHandling) co
{
QVariantMap config = m_qbsConfiguration;
config.insert(Constants::QBS_FORCE_PROBES_KEY, m_forceProbes);
if (m_enableQmlDebugging)
config.insert(Constants::QBS_CONFIG_QUICK_DEBUG_KEY, true);
if (variableHandling == ExpandVariables) {
const Utils::MacroExpander *expander = Utils::globalMacroExpander();
for (auto it = config.begin(), end = config.end(); it != end; ++it) {
@@ -280,6 +283,7 @@ int QbsBuildStep::maxJobs() const
}
static QString forceProbesKey() { return QLatin1String("Qbs.forceProbesKey"); }
static QString enableQmlDebuggingKey() { return QLatin1String("Qbs.enableQmlDebuggingKey"); }
bool QbsBuildStep::fromMap(const QVariantMap &map)
{
@@ -297,6 +301,7 @@ bool QbsBuildStep::fromMap(const QVariantMap &map)
m_qbsBuildOptions.setRemoveExistingInstallation(map.value(QBS_CLEAN_INSTALL_ROOT)
.toBool());
m_forceProbes = map.value(forceProbesKey()).toBool();
m_enableQmlDebugging = map.value(enableQmlDebuggingKey()).toBool();
return true;
}
@@ -313,6 +318,7 @@ QVariantMap QbsBuildStep::toMap() const
map.insert(QBS_CLEAN_INSTALL_ROOT,
m_qbsBuildOptions.removeExistingInstallation());
map.insert(forceProbesKey(), m_forceProbes);
map.insert(enableQmlDebuggingKey(), m_enableQmlDebugging);
return map;
}
@@ -412,13 +418,6 @@ QString QbsBuildStep::buildVariant() const
return qbsConfiguration(PreserveVariables).value(Constants::QBS_CONFIG_VARIANT_KEY).toString();
}
bool QbsBuildStep::isQmlDebuggingEnabled() const
{
QVariantMap data = qbsConfiguration(PreserveVariables);
return data.value(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY, false).toBool()
|| data.value(Constants::QBS_CONFIG_QUICK_DEBUG_KEY, false).toBool();
}
void QbsBuildStep::setBuildVariant(const QString &variant)
{
if (m_qbsConfiguration.value(Constants::QBS_CONFIG_VARIANT_KEY).toString() == variant)
@@ -564,7 +563,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
QString *errorMessage) {
return validateProperties(edit, errorMessage);
});
m_ui->qmlDebuggingWarningText->setPixmap(Utils::Icons::WARNING.pixmap());
m_ui->qmlDebuggingWarningIcon->setPixmap(Utils::Icons::WARNING.pixmap());
connect(m_ui->buildVariantComboBox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
@@ -635,7 +634,7 @@ void QbsBuildStepConfigWidget::updateState()
}
if (m_step->isQmlDebuggingEnabled())
command += " Qt.declarative.qmlDebugging:true Qt.quick.qmlDebugging:true";
command.append(Constants::QBS_CONFIG_QUICK_DEBUG_KEY).append(":true");
m_ui->commandLineTextEdit->setPlainText(command);
QString summary = tr("<b>Qbs:</b> %1").arg(command);
@@ -667,7 +666,7 @@ void QbsBuildStepConfigWidget::updatePropertyEdit(const QVariantMap &data)
// remove data that is edited with special UIs:
editable.remove(Constants::QBS_CONFIG_PROFILE_KEY);
editable.remove(Constants::QBS_CONFIG_VARIANT_KEY);
editable.remove(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY);
editable.remove(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY); // For existing .user files
editable.remove(Constants::QBS_CONFIG_QUICK_DEBUG_KEY);
editable.remove(Constants::QBS_FORCE_PROBES_KEY);
editable.remove(Constants::QBS_INSTALL_ROOT_KEY);
@@ -788,17 +787,8 @@ void QbsBuildStepConfigWidget::applyCachedProperties()
void QbsBuildStepConfigWidget::linkQmlDebuggingLibraryChecked(bool checked)
{
QVariantMap data = m_step->qbsConfiguration(QbsBuildStep::PreserveVariables);
if (checked) {
data.insert(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY, checked);
data.insert(Constants::QBS_CONFIG_QUICK_DEBUG_KEY, checked);
} else {
data.remove(Constants::QBS_CONFIG_DECLARATIVE_DEBUG_KEY);
data.remove(Constants::QBS_CONFIG_QUICK_DEBUG_KEY);
}
m_ignoreChange = true;
m_step->setQbsConfiguration(data);
m_step->setQmlDebuggingEnabled(checked);
m_ignoreChange = false;
}

View File

@@ -44,6 +44,10 @@ class QbsBuildStep : public ProjectExplorer::BuildStep
{
Q_OBJECT
// used in DebuggerRunConfigurationAspect
Q_PROPERTY(bool linkQmlDebuggingLibrary READ isQmlDebuggingEnabled
WRITE setQmlDebuggingEnabled NOTIFY qbsConfigurationChanged)
public:
enum VariableHandling
{
@@ -78,7 +82,11 @@ public:
void setForceProbes(bool force) { m_forceProbes = force; emit qbsConfigurationChanged(); }
bool forceProbes() const { return m_forceProbes; }
bool isQmlDebuggingEnabled() const;
void setQmlDebuggingEnabled(bool debug) {
m_enableQmlDebugging = debug;
emit qbsConfigurationChanged();
}
bool isQmlDebuggingEnabled() const { return m_enableQmlDebugging; }
signals:
void qbsConfigurationChanged();
@@ -116,6 +124,7 @@ private:
QVariantMap m_qbsConfiguration;
qbs::BuildOptions m_qbsBuildOptions;
bool m_forceProbes = false;
bool m_enableQmlDebugging;
// Temporary data:
QStringList m_changedFiles;

View File

@@ -30,6 +30,8 @@
#include <projectexplorer/kitconfigwidget.h>
#include <projectexplorer/kitmanager.h>
#include <utils/qtcassert.h>
#include <qbs.h>
#include <QLabel>
@@ -89,11 +91,13 @@ QString QbsKitInformation::representation(const Kit *kit)
QVariantMap QbsKitInformation::properties(const Kit *kit)
{
QTC_ASSERT(kit, return QVariantMap());
return kit->value(id()).toMap();
}
void QbsKitInformation::setProperties(Kit *kit, const QVariantMap &properties)
{
QTC_ASSERT(kit, return);
kit->setValue(id(), properties);
}

View File

@@ -50,6 +50,8 @@ ProjectExplorer::FileType fileType(const qbs::ArtifactData &artifact)
return ProjectExplorer::FileType::Form;
if (artifact.fileTags().contains("scxml"))
return ProjectExplorer::FileType::StateChart;
if (artifact.fileTags().contains("qt.qml.qml"))
return ProjectExplorer::FileType::QML;
return ProjectExplorer::FileType::Unknown;
}
@@ -101,13 +103,13 @@ QbsProjectManager::Internal::QbsGroupNode
}
void setupQbsProductData(QbsProjectManager::Internal::QbsProductNode *node,
const qbs::ProductData &prd, const qbs::Project &project)
const qbs::ProductData &prd)
{
using namespace QbsProjectManager::Internal;
node->setEnabled(prd.isEnabled());
node->setDisplayName(QbsProject::productDisplayName(project, prd));
node->setDisplayName(prd.fullDisplayName());
node->setAbsoluteFilePathAndLine(Utils::FileName::fromString(prd.location().filePath()).parentDir(), -1);
const QString &productPath = QFileInfo(prd.location().filePath()).absolutePath();
@@ -135,12 +137,11 @@ void setupQbsProductData(QbsProjectManager::Internal::QbsProductNode *node,
setupArtifacts(genFiles, prd.generatedArtifacts());
}
QbsProjectManager::Internal::QbsProductNode *
buildProductNodeTree(const qbs::Project &project, const qbs::ProductData &prd)
QbsProjectManager::Internal::QbsProductNode *buildProductNodeTree(const qbs::ProductData &prd)
{
auto result = new QbsProjectManager::Internal::QbsProductNode(prd);
setupQbsProductData(result, prd, project);
setupQbsProductData(result, prd);
return result;
}
@@ -160,7 +161,7 @@ void setupProjectNode(QbsProjectManager::Internal::QbsProjectNode *node, const q
}
foreach (const qbs::ProductData &prd, prjData.products())
node->addNode(buildProductNodeTree(qbsProject, prd));
node->addNode(buildProductNodeTree(prd));
if (!prjData.name().isEmpty())
node->setDisplayName(prjData.name());

View File

@@ -640,18 +640,9 @@ void QbsProject::generateErrors(const qbs::ErrorInfo &e)
}
QString QbsProject::productDisplayName(const qbs::Project &project,
const qbs::ProductData &product)
{
QString displayName = product.name();
if (product.profile() != project.profile())
displayName.append(QLatin1String(" [")).append(product.profile()).append(QLatin1Char(']'));
return displayName;
}
QString QbsProject::uniqueProductName(const qbs::ProductData &product)
{
return product.name() + QLatin1Char('.') + product.profile();
return product.name() + QLatin1Char('.') + product.multiplexConfigurationId();
}
void QbsProject::configureAsExampleProject(const QSet<Id> &platforms)
@@ -1113,7 +1104,7 @@ void QbsProject::updateApplicationTargets()
foreach (const qbs::ProductData &productData, m_projectData.allProducts()) {
if (!productData.isEnabled() || !productData.isRunnable())
continue;
const QString displayName = productDisplayName(m_qbsProject, productData);
const QString displayName = productData.fullDisplayName();
if (productData.targetArtifacts().isEmpty()) { // No build yet.
applications.list << BuildTargetInfo(displayName,
FileName(),

View File

@@ -101,8 +101,6 @@ public:
bool needsSpecialDeployment() const override;
void generateErrors(const qbs::ErrorInfo &e);
static QString productDisplayName(const qbs::Project &project,
const qbs::ProductData &product);
static QString uniqueProductName(const qbs::ProductData &product);
void configureAsExampleProject(const QSet<Core::Id> &platforms) final;

View File

@@ -67,8 +67,8 @@ const char QBS_VARIANT_RELEASE[] = "release";
const char QBS_CONFIG_VARIANT_KEY[] = "qbs.defaultBuildVariant";
const char QBS_CONFIG_PROFILE_KEY[] = "qbs.profile";
const char QBS_INSTALL_ROOT_KEY[] = "qbs.installRoot";
const char QBS_CONFIG_DECLARATIVE_DEBUG_KEY[] = "Qt.declarative.qmlDebugging";
const char QBS_CONFIG_QUICK_DEBUG_KEY[] = "Qt.quick.qmlDebugging";
const char QBS_CONFIG_DECLARATIVE_DEBUG_KEY[] = "modules.Qt.declarative.qmlDebugging";
const char QBS_CONFIG_QUICK_DEBUG_KEY[] = "modules.Qt.quick.qmlDebugging";
const char QBS_FORCE_PROBES_KEY[] = "qbspm.forceProbes";
// Icons:

View File

@@ -408,7 +408,7 @@ QbsRunConfigurationFactory::availableCreators(Target *parent, CreationMode mode)
}
return Utils::transform(products, [this, project](const qbs::ProductData &product) {
const QString displayName = QbsProject::productDisplayName(project->qbsProject(), product);
const QString displayName = product.fullDisplayName();
const QString targetName = QbsProject::uniqueProductName(product) + rcNameSeparator() + displayName;
return convert(displayName, targetName);
});

View File

@@ -35,6 +35,7 @@
#include <qtsupport/qtkitinformation.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
using namespace ProjectExplorer;
using namespace Utils;
@@ -144,6 +145,7 @@ FileName QmakeKitInformation::effectiveMkspec(const Kit *k)
void QmakeKitInformation::setMkspec(Kit *k, const FileName &fn)
{
QTC_ASSERT(k, return);
k->setValue(QmakeKitInformation::id(), fn == defaultMkspec(k) ? QString() : fn.toString());
}

View File

@@ -49,16 +49,19 @@ struct AddResourceHandler
public:
AddResourceHandler( const QString &_category,
const QString &_filter,
AddResourceOperation _operation)
AddResourceOperation _operation,
int _priority = 0)
: category(_category)
,filter(_filter)
,operation(_operation)
,piority(_priority)
{
}
QString category;
QString filter;
AddResourceOperation operation;
int piority;
};
class DesignerActionToolBar : public Utils::StyledBar

View File

@@ -37,6 +37,7 @@
#include <rewritingexception.h>
#include <qmldesignerplugin.h>
#include <utils/algorithm.h>
#include <utils/flowlayout.h>
#include <utils/fileutils.h>
#include <utils/stylehelper.h>
@@ -395,14 +396,26 @@ void ItemLibraryWidget::addResources()
QTC_ASSERT(document, return);
QList<AddResourceHandler> handlers = QmlDesignerPlugin::instance()->viewManager().designerActionManager().addResourceHandler();
QMultiMap<QString, QString> map;
for (const AddResourceHandler &handler : handlers) {
map.insert(handler.category, handler.filter);
}
QMap<QString, int> priorities;
for (const AddResourceHandler &handler : handlers) {
priorities.insert(handler.category, handler.piority);
}
QStringList sortedKeys = map.uniqueKeys();
Utils::sort(sortedKeys, [&priorities](const QString &first,
const QString &second){
return priorities.value(first) < priorities.value(second);
});
QStringList filters;
for (const QString &key : map.uniqueKeys()) {
for (const QString &key : sortedKeys) {
QString str = key + " (";
str.append(map.values(key).join(" "));
str.append(")");

View File

@@ -93,6 +93,7 @@ void QtKitInformation::fix(ProjectExplorer::Kit *k)
ProjectExplorer::KitConfigWidget *QtKitInformation::createConfigWidget(ProjectExplorer::Kit *k) const
{
QTC_ASSERT(k, return nullptr);
return new Internal::QtKitConfigWidget(k, this);
}
@@ -120,15 +121,16 @@ ProjectExplorer::IOutputParser *QtKitInformation::createOutputParser(const Proje
{
if (qtVersion(k))
return new QtParser;
return 0;
return nullptr;
}
void QtKitInformation::addToMacroExpander(Kit *kit, MacroExpander *expander) const
{
QTC_ASSERT(kit, return);
expander->registerSubProvider(
[kit]() -> MacroExpander * {
BaseQtVersion *version = qtVersion(kit);
return version ? version->macroExpander() : 0;
return version ? version->macroExpander() : nullptr;
});
expander->registerVariable("Qt:Name", tr("Name of Qt Version"),
@@ -171,6 +173,7 @@ int QtKitInformation::qtVersionId(const ProjectExplorer::Kit *k)
void QtKitInformation::setQtVersionId(ProjectExplorer::Kit *k, const int id)
{
QTC_ASSERT(k, return);
k->setValue(QtKitInformation::id(), id);
}

View File

@@ -212,7 +212,7 @@ IAssistProposal *KeywordsCompletionAssistProcessor::perform(const AssistInterfac
} else {
QList<AssistProposalItemInterface *> items = m_snippetCollector.collect();
items.append(generateProposalList(m_keywords.variables(), m_variableIcon));
items.append(generateProposalList(m_keywords.variables(), m_variableIcon));
items.append(generateProposalList(m_keywords.functions(), m_functionIcon));
return new GenericProposal(startPosition, items);
}
}

View File

@@ -364,7 +364,7 @@ CallgrindTool::CallgrindTool()
// load external log file
action = m_loadExternalLogFile = new QAction(this);
action->setIcon(Utils::Icons::OPENFILE.icon());
action->setIcon(Utils::Icons::OPENFILE_TOOLBAR.icon());
action->setToolTip(tr("Load External Log File"));
connect(action, &QAction::triggered, this, &CallgrindTool::loadExternalLogFile);

View File

@@ -67,6 +67,7 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/helpmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/id.h>
#include <coreplugin/modemanager.h>
@@ -482,6 +483,8 @@ public:
bool attach() const;
QString path() const;
void keyPressEvent(QKeyEvent *e);
private:
void updateEnabled();
void saveOptions();
@@ -596,7 +599,7 @@ MemcheckTool::MemcheckTool()
// Load external XML log file
auto action = new QAction(this);
action->setIcon(Icons::OPENFILE.icon());
action->setIcon(Icons::OPENFILE_TOOLBAR.icon());
action->setToolTip(tr("Load External XML Log File"));
connect(action, &QAction::triggered, this, &MemcheckTool::loadExternalXmlLogFile);
m_loadExternalLogFile = action;
@@ -1379,6 +1382,15 @@ QString HeobDialog::path() const
return m_pathChooser->path();
}
void HeobDialog::keyPressEvent(QKeyEvent *e)
{
if (e->key() != Qt::Key_F1)
return QDialog::keyPressEvent(e);
reject();
Core::HelpManager::handleHelpRequest("qthelp://org.qt-project.qtcreator/doc/creator-heob.html");
}
void HeobDialog::updateEnabled()
{
bool enableHeob = m_handleExceptionCombo->currentIndex() < 2;

View File

@@ -12,7 +12,7 @@
** http://tools.ietf.org/html/rfc4627
***************************************************************************
-->
<language name="JSON" section="Markup" version="2" kateversion="2.4" extensions="*.json;.kateproject;.arcconfig" mimetype="application/json" author="Sebastian Pipping (sebastian@pipping.org)" license="GPL">
<language name="JSON" section="Markup" version="3" kateversion="2.4" extensions="*.json;.kateproject;.arcconfig;*.gltf" mimetype="application/json" author="Sebastian Pipping (sebastian@pipping.org)" license="GPL">
<highlighting>
<list name="Constants">
<item>null</item>

View File

@@ -6,7 +6,7 @@
<!ENTITY name "(?![0-9])[\w_:][\w.:_-]*">
<!ENTITY entref "&amp;(#[0-9]+|#[xX][0-9A-Fa-f]+|&name;);">
]>
<language name="XML" version="6" kateversion="3.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml;*.xbel" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml;image/svg+xml;application/x-designer;application/x-xbel;application/xml;application/scxml+xml" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
<language name="XML" version="7" kateversion="3.4" section="Markup" extensions="*.docbook;*.xml;*.rc;*.daml;*.rdf;*.rss;*.xspf;*.xsd;*.svg;*.ui;*.kcfg;*.qrc;*.wsdl;*.scxml;*.xbel;*.dae" mimetype="text/xml;text/book;text/daml;text/rdf;application/rss+xml;application/xspf+xml;image/svg+xml;application/x-designer;application/x-xbel;application/xml;application/scxml+xml" casesensitive="1" author="Wilbert Berendsen (wilbert@kde.nl)" license="LGPL">
<highlighting>
<contexts>

View File

@@ -1,18 +1,12 @@
import qbs
import qbs.Utilities
CppApplication {
QtcTool {
name: "valgrind-fake"
consoleApplication: true
destinationDirectory: qtc.ide_bin_path
install: false
Depends { name: "Qt"; submodules: ["network", "xml"]; }
Depends { name: "qtc" }
cpp.cxxLanguageVersion: "c++11"
Properties {
condition: Utilities.versionCompare(Qt.core.version, "5.7") < 0
cpp.minimumMacosVersion: project.minimumMacosVersion
}
files: [
"main.cpp",

View File

@@ -1266,7 +1266,7 @@ void tst_TestCore::testBasicStates()
Exception::setShouldAssert(true);
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item"));
@@ -1372,7 +1372,7 @@ void tst_TestCore::testBasicStatesQtQuick20()
Exception::setShouldAssert(true);
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item"));
@@ -2530,7 +2530,7 @@ void tst_TestCore::testRewriterId()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item"));
@@ -2574,7 +2574,7 @@ void tst_TestCore::testRewriterNodeReparentingTransaction1()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item", 2, 0));
@@ -2619,7 +2619,7 @@ void tst_TestCore::testRewriterNodeReparentingTransaction2()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item", 2, 0));
@@ -2685,7 +2685,7 @@ void tst_TestCore::testRewriterNodeReparentingTransaction3()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item", 2, 0));
@@ -2735,7 +2735,7 @@ void tst_TestCore::testRewriterNodeReparentingTransaction4()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item",2,0));
@@ -2786,7 +2786,7 @@ void tst_TestCore::testRewriterAddNodeTransaction()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item", 2, 0));
@@ -2833,7 +2833,7 @@ void tst_TestCore::testRewriterComponentId()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item", 2, 0));
@@ -2864,7 +2864,7 @@ void tst_TestCore::testRewriterTransactionRewriter()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item", 2, 0));
@@ -2936,7 +2936,7 @@ void tst_TestCore::testRewriterPropertyDeclarations()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item"));
@@ -2998,7 +2998,7 @@ void tst_TestCore::testRewriterPropertyAliases()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item"));
@@ -3981,7 +3981,7 @@ char qmlString[] = "import QtQuick 2.1\n"
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item"));
@@ -4237,7 +4237,7 @@ void tst_TestCore::testMetaInfoQtQuick1Vs2()
"}\n";
QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString);
textEdit.setPlainText(QLatin1String(qmlString));
NotIndentingTextEditModifier textModifier(&textEdit);
QScopedPointer<Model> model(Model::create("QtQuick.Item"));