forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/12.0' into qds/dev
Change-Id: Ic6e557806a3209e2c6d983d3c3fcfad66f6e3066
This commit is contained in:
@@ -123,7 +123,10 @@ else()
|
||||
${YAML_SOURCE_DIR}/src/tag.h
|
||||
${YAML_SOURCE_DIR}/src/token.h
|
||||
)
|
||||
if (NOT QTC_STATIC_BUILD)
|
||||
if (QTC_STATIC_BUILD)
|
||||
extend_qtc_target(yaml-cpp
|
||||
PUBLIC_DEFINES YAML_CPP_STATIC_DEFINE)
|
||||
else()
|
||||
extend_qtc_target(yaml-cpp
|
||||
DEFINES yaml_cpp_EXPORTS
|
||||
PUBLIC_DEFINES YAML_CPP_DLL)
|
||||
|
||||
@@ -211,9 +211,14 @@ function(add_qtc_library name)
|
||||
)
|
||||
|
||||
if (QTC_STATIC_BUILD)
|
||||
extend_qtc_target(${name} PUBLIC_DEFINES ${EXPORT_SYMBOL})
|
||||
extend_qtc_target(${name}
|
||||
DEFINES ${EXPORT_SYMBOL}
|
||||
PUBLIC_DEFINES ${EXPORT_SYMBOL})
|
||||
else()
|
||||
extend_qtc_target(${name} DEFINES ${EXPORT_SYMBOL})
|
||||
if (_arg_OBJECT OR _arg_STATIC)
|
||||
extend_qtc_target(${name} PUBLIC_DEFINES ${EXPORT_SYMBOL})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# everything is different with SOURCES_PREFIX
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
set(IDE_VERSION "11.0.84") # The IDE version.
|
||||
set(IDE_VERSION_COMPAT "11.0.84") # The IDE Compatibility version.
|
||||
set(IDE_VERSION_DISPLAY "12.0.0-rc1") # The IDE display version.
|
||||
set(IDE_VERSION "12.0.0") # The IDE version.
|
||||
set(IDE_VERSION_COMPAT "12.0.0") # The IDE Compatibility version.
|
||||
set(IDE_VERSION_DISPLAY "12.0.0") # The IDE display version.
|
||||
set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year.
|
||||
|
||||
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
dependencies:
|
||||
../../qt/qt5.git:
|
||||
ref: "6.5"
|
||||
ref: "6.6"
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
\section2 Opening Sessions from Locator
|
||||
|
||||
You can use the filter that triggers menu commands to open
|
||||
\l{Managing Sessions}{sessions}. Enter
|
||||
\l{Manage sessions}{sessions}. Enter
|
||||
\c {t yoursess} or \c {t sess yoursess} to trigger \uicontrol File >
|
||||
\uicontrol Sessions > \e <session_name>.
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
\image qtcreator-toggle-progress-bar.webp {Toggle Progress Details button}
|
||||
|
||||
By default, \QC runs one clangd process per project. If you have created
|
||||
\l{Managing Sessions}{sessions} that have related projects, you can
|
||||
\l{Manage sessions}{sessions} that have related projects, you can
|
||||
specify that the projects in the session should be managed by a single
|
||||
clangd process.
|
||||
|
||||
|
||||
@@ -197,15 +197,13 @@
|
||||
\li -lastsession
|
||||
\li ProjectExplorer plugin: load the last session when \QC starts.
|
||||
Open the projects and files that were open when you last exited
|
||||
\QC. For more information about managing sessions, see
|
||||
\l{Managing Sessions}.
|
||||
\QC.
|
||||
|
||||
\row
|
||||
\li <session>
|
||||
\li ProjectExplorer plugin: load the given session when \QC starts.
|
||||
Open the projects and files that were open when you last exited
|
||||
\QC. For more information about managing sessions, see
|
||||
\l{Managing Sessions}.
|
||||
\QC.
|
||||
|
||||
\endtable
|
||||
|
||||
@@ -225,5 +223,5 @@
|
||||
You can also switch to a dark theme to customize the appearance of widgets,
|
||||
colors, and icons without using stylesheets.
|
||||
|
||||
\sa {Run Qt Creator from the command line}
|
||||
\sa {Run Qt Creator from the command line}, {Manage sessions}
|
||||
*/
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
|
||||
To open a project that is located in a particular directory, you can
|
||||
pass on the directory name as a command-line argument. \QC looks for
|
||||
a \l{Managing Sessions}{session} that matches the directory name and
|
||||
a \l{Manage sessions}{session} that matches the directory name and
|
||||
loads it. Or it looks for a project file in the directory and opens it.
|
||||
|
||||
For example, on Windows:
|
||||
|
||||
@@ -13,11 +13,13 @@
|
||||
\previouspage creator-project-managing-workspaces.html
|
||||
\nextpage creator-keyboard-shortcuts.html
|
||||
\else
|
||||
\previouspage creator-sharing-project-settings.html
|
||||
\nextpage creator-design-mode.html
|
||||
\previouspage creator-how-tos.html
|
||||
\endif
|
||||
|
||||
\title Managing Sessions
|
||||
\ingroup creator-how-to-use
|
||||
\ingroup studio-how-to
|
||||
|
||||
\title Manage sessions
|
||||
|
||||
When you exit \QC, it stores a snapshot of your current workspace as a
|
||||
\e session. To restore the session automatically when you start \QC,
|
||||
@@ -61,6 +63,8 @@
|
||||
|
||||
To save a session under a new name, select \uicontrol Clone.
|
||||
|
||||
\section1 Create new sessions
|
||||
|
||||
To create a new session:
|
||||
|
||||
\list 1
|
||||
@@ -76,9 +80,12 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\section1 Open sessions
|
||||
|
||||
To switch between sessions, select \uicontrol {Open}.
|
||||
|
||||
\if defined(qtcreator)
|
||||
|
||||
The \uicontrol Projects tab in the \uicontrol Welcome mode lists existing
|
||||
sessions. To open a session, select it or press
|
||||
\key Ctrl+Alt+<number>, where \e <number> is the number of the session to
|
||||
@@ -96,7 +103,7 @@
|
||||
When you start \QC from the command line, you can give the name of
|
||||
a session as an argument and \QC will start with this session.
|
||||
|
||||
For more information, see \l{Command-Line Options}.
|
||||
\sa {Command-Line Options}, {Searching with the Locator}
|
||||
\endif
|
||||
|
||||
*/
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
You can add a library into a \e subdirs project. Use wizards to create the
|
||||
project and the library and to link the library against the project.
|
||||
|
||||
\note This tutorial only applies when you select qmake as the the build
|
||||
\note This tutorial only applies when you select qmake as the build
|
||||
system for the subdirs project.
|
||||
|
||||
\section1 Creating a shared library
|
||||
|
||||
@@ -16,10 +16,6 @@
|
||||
|
||||
\image front-projects.png
|
||||
|
||||
You can share projects with other designers and developers across different
|
||||
development platforms with a common tool for design, development, and
|
||||
debugging.
|
||||
|
||||
\list
|
||||
|
||||
\li \l{Creating Projects}
|
||||
@@ -42,14 +38,8 @@
|
||||
configurations for \QC and your projects. You can modify
|
||||
the settings in the \uicontrol Projects mode.
|
||||
|
||||
\li \l{Managing Sessions}
|
||||
|
||||
Sessions store items such as open files, breakpoints, and evaluated
|
||||
expressions, which you do not typically want to share across
|
||||
platforms.
|
||||
|
||||
\endlist
|
||||
|
||||
\sa {Build Systems}
|
||||
|
||||
\sa {Manage Projects}{How To: Manage Projects}, {Manage sessions},
|
||||
{Build Systems}
|
||||
*/
|
||||
|
||||
@@ -46,6 +46,6 @@
|
||||
|
||||
\note You cannot use this view to specify subprojects for projects.
|
||||
|
||||
\sa {Add subprojects to projects}, {Managing Sessions}
|
||||
\sa {Add subprojects to projects}, {Manage sessions}
|
||||
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
\li \l{Using Custom Output Parsers}
|
||||
\li \l{Sharing Project Settings}
|
||||
\endlist
|
||||
\li \l{Managing Sessions}
|
||||
\endlist
|
||||
\li \l{Designing User Interfaces}
|
||||
\list
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
\li \l{Creating Projects}
|
||||
\li \l{Version Control Systems}
|
||||
\li \l{Configuring Projects}
|
||||
\li \l{Managing Sessions}
|
||||
\endlist
|
||||
\li \b {\l{Designing User Interfaces}}
|
||||
\list
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
\if defined(qtcreator)
|
||||
The project tree has a list of all projects open in the current
|
||||
\l{Managing Sessions}{session}. For each project, the tree visualizes
|
||||
\l{Manage sessions}{session}. For each project, the tree visualizes
|
||||
the build system structure of the project and lists all files that
|
||||
are part of the project.
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
\li \l{Qt Insight}
|
||||
\endlist
|
||||
\li \l{Managing Workspaces}
|
||||
\li \l{Managing Sessions}
|
||||
\li \l{Manage sessions}
|
||||
\li \l{Keyboard Shortcuts}
|
||||
\endlist
|
||||
\li \l{Creating Projects}
|
||||
|
||||
@@ -4,16 +4,16 @@ import qbs.FileInfo
|
||||
import qbs.Utilities
|
||||
|
||||
Module {
|
||||
property string qtcreator_display_version: '12.0.0-rc1'
|
||||
property string ide_version_major: '11'
|
||||
property string qtcreator_display_version: '12.0.0'
|
||||
property string ide_version_major: '12'
|
||||
property string ide_version_minor: '0'
|
||||
property string ide_version_release: '84'
|
||||
property string ide_version_release: '0'
|
||||
property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.'
|
||||
+ ide_version_release
|
||||
|
||||
property string ide_compat_version_major: '11'
|
||||
property string ide_compat_version_major: '12'
|
||||
property string ide_compat_version_minor: '0'
|
||||
property string ide_compat_version_release: '84'
|
||||
property string ide_compat_version_release: '0'
|
||||
property string qtcreator_compat_version: ide_compat_version_major + '.'
|
||||
+ ide_compat_version_minor + '.' + ide_compat_version_release
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
add_qtc_library(Nanotrace
|
||||
BUILD_DEFAULT OFF
|
||||
DEFINES NANOTRACE_LIBRARY
|
||||
PUBLIC_DEFINES NANOTRACE_ENABLED
|
||||
SOURCES
|
||||
nanotraceglobals.h
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
add_qtc_library(Spinner OBJECT
|
||||
# Never add dependencies to non-Qt libraries for this library
|
||||
DEPENDS Qt::Core Qt::Widgets
|
||||
PUBLIC_DEFINES SPINNER_LIBRARY
|
||||
SOURCES
|
||||
spinner.cpp spinner.h
|
||||
spinner.qrc
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
add_qtc_library(Tasking OBJECT
|
||||
# Never add dependencies to non-Qt libraries for this library
|
||||
DEPENDS Qt::Concurrent Qt::Core Qt::Network
|
||||
PUBLIC_DEFINES TASKING_LIBRARY
|
||||
SOURCES
|
||||
barrier.cpp barrier.h
|
||||
concurrentcall.h
|
||||
|
||||
@@ -3,6 +3,8 @@ add_qtc_library(Utils
|
||||
PUBLIC_DEPENDS
|
||||
Qt::Concurrent Qt::Core Qt::Network Qt::Gui Qt::Widgets
|
||||
Qt::Core5Compat
|
||||
$<$<BOOL:${QTC_STATIC_BUILD}>:Tasking>
|
||||
$<$<BOOL:${QTC_STATIC_BUILD}>:Spinner>
|
||||
SOURCES
|
||||
../3rdparty/span/span.hpp
|
||||
../3rdparty/tl_expected/include/tl/expected.hpp
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <QTemporaryFile>
|
||||
#include <QVersionNumber>
|
||||
|
||||
Q_LOGGING_CATEGORY(log, "terminal.externalprocess", QtWarningMsg)
|
||||
Q_LOGGING_CATEGORY(logTE, "terminal.externalprocess", QtWarningMsg)
|
||||
|
||||
namespace Utils {
|
||||
|
||||
@@ -155,12 +155,12 @@ expected_str<qint64> ProcessStubCreator::startStubProcess(const ProcessSetupData
|
||||
QObject::connect(process, &Process::readyReadStandardOutput, process, [process] {
|
||||
const QString output = process->readAllStandardOutput();
|
||||
if (!output.isEmpty())
|
||||
qCWarning(log).noquote() << output;
|
||||
qCWarning(logTE).noquote() << output;
|
||||
});
|
||||
QObject::connect(process, &Process::readyReadStandardError, process, [process] {
|
||||
const QString output = process->readAllStandardError();
|
||||
if (!output.isEmpty())
|
||||
qCCritical(log).noquote() << output;
|
||||
qCCritical(logTE).noquote() << output;
|
||||
});
|
||||
|
||||
QObject::connect(process, &Process::done, m_interface, &TerminalInterface::onStubExited);
|
||||
|
||||
@@ -268,6 +268,7 @@ void InfoBarDisplay::update()
|
||||
{
|
||||
for (QWidget *widget : std::as_const(m_infoWidgets)) {
|
||||
widget->disconnect(this); // We want no destroyed() signal now
|
||||
widget->hide(); // Late deletion can cause duplicate infos. Hide immediately to prevent it.
|
||||
widget->deleteLater();
|
||||
}
|
||||
m_infoWidgets.clear();
|
||||
|
||||
@@ -252,10 +252,8 @@ void ClangdFindReferences::Private::handleRenameRequest(
|
||||
{
|
||||
const Utils::FilePaths filePaths = BaseFileFind::replaceAll(newSymbolName, checkedItems,
|
||||
preserveCase);
|
||||
if (!filePaths.isEmpty()) {
|
||||
DocumentManager::notifyFilesChangedInternally(filePaths);
|
||||
if (!filePaths.isEmpty())
|
||||
SearchResultWindow::instance()->hide();
|
||||
}
|
||||
|
||||
const auto renameFilesCheckBox = qobject_cast<QCheckBox *>(search->additionalReplaceWidget());
|
||||
QTC_ASSERT(renameFilesCheckBox, return);
|
||||
|
||||
@@ -478,6 +478,7 @@ SettingsDialog::SettingsDialog(QWidget *parent)
|
||||
|
||||
m_model.setPages(m_pages, IOptionsPageProvider::allOptionsPagesProviders());
|
||||
|
||||
m_proxyModel.setSortLocaleAware(true);
|
||||
m_proxyModel.setSourceModel(&m_model);
|
||||
m_proxyModel.setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
m_categoryList->setIconSize(QSize(categoryIconSize, categoryIconSize));
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/theme/theme.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
#include <utils/infolabel.h>
|
||||
|
||||
#include <QFrame>
|
||||
#include <QLabel>
|
||||
@@ -93,8 +94,6 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
|
||||
topLayout->addWidget(m_topReplaceWidget);
|
||||
|
||||
m_messageWidget = new QFrame;
|
||||
pal.setColor(QPalette::WindowText, creatorTheme()->color(Theme::TextColorError));
|
||||
m_messageWidget->setPalette(pal);
|
||||
if (creatorTheme()->flag(Theme::DrawSearchResultWidgetFrame)) {
|
||||
m_messageWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
|
||||
m_messageWidget->setLineWidth(1);
|
||||
@@ -103,8 +102,9 @@ SearchResultWidget::SearchResultWidget(QWidget *parent) :
|
||||
auto messageLayout = new QHBoxLayout(m_messageWidget);
|
||||
messageLayout->setContentsMargins(2, 2, 2, 2);
|
||||
m_messageWidget->setLayout(messageLayout);
|
||||
m_messageLabel = new QLabel;
|
||||
m_messageLabel->setPalette(pal);
|
||||
m_messageLabel = new InfoLabel;
|
||||
m_messageLabel->setType(InfoLabel::Error);
|
||||
m_messageLabel->setFilled(true);
|
||||
messageLayout->addWidget(m_messageLabel);
|
||||
layout->addWidget(m_messageWidget);
|
||||
m_messageWidget->setVisible(false);
|
||||
|
||||
@@ -18,6 +18,7 @@ class QToolButton;
|
||||
class QCheckBox;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Utils { class InfoLabel; }
|
||||
namespace Core {
|
||||
|
||||
namespace Internal {
|
||||
@@ -123,7 +124,7 @@ private:
|
||||
QWidget *m_descriptionContainer = nullptr;
|
||||
QLabel *m_label = nullptr;
|
||||
QLabel *m_searchTerm = nullptr;
|
||||
QLabel *m_messageLabel = nullptr;
|
||||
Utils::InfoLabel *m_messageLabel = nullptr;
|
||||
QToolButton *m_cancelButton = nullptr;
|
||||
QLabel *m_matchesFoundLabel = nullptr;
|
||||
bool m_preserveCaseSupported = true;
|
||||
|
||||
@@ -294,7 +294,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD
|
||||
d->autoIncludeHeadersCheckBox.setChecked(settings.autoIncludeHeaders());
|
||||
d->autoIncludeHeadersCheckBox.setToolTip(autoIncludeToolTip);
|
||||
d->threadLimitSpinBox.setValue(settings.workerThreadLimit());
|
||||
d->threadLimitSpinBox.setSpecialValueText("Automatic");
|
||||
d->threadLimitSpinBox.setSpecialValueText(Tr::tr("Automatic"));
|
||||
d->threadLimitSpinBox.setToolTip(workerThreadsToolTip);
|
||||
d->documentUpdateThreshold.setMinimum(50);
|
||||
d->documentUpdateThreshold.setMaximum(10000);
|
||||
|
||||
@@ -300,7 +300,7 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings)
|
||||
|
||||
Column {
|
||||
Group {
|
||||
title("Headers"),
|
||||
title(Tr::tr("Headers")),
|
||||
Form {
|
||||
Tr::tr("&Suffix:"), m_headerSuffixComboBox, st, br,
|
||||
Tr::tr("S&earch paths:"), m_headerSearchPathsEdit, br,
|
||||
@@ -309,7 +309,7 @@ CppFileSettingsWidget::CppFileSettingsWidget(CppFileSettings *settings)
|
||||
}
|
||||
},
|
||||
Group {
|
||||
title("Sources"),
|
||||
title(Tr::tr("Sources")),
|
||||
Form {
|
||||
Tr::tr("S&uffix:"), m_sourceSuffixComboBox, st, br,
|
||||
Tr::tr("Se&arch paths:"), m_sourceSearchPathsEdit, br,
|
||||
|
||||
@@ -9272,7 +9272,9 @@ template<typename T> inline T aFunction() { return T(); }
|
||||
|
||||
const QByteArrayList headersMemberDecl2Def{R"(
|
||||
class C {
|
||||
// Member function comment
|
||||
/**
|
||||
* \brief Foo::aMember
|
||||
*/
|
||||
void @aMember();
|
||||
)", R"(
|
||||
class C {
|
||||
@@ -9285,7 +9287,9 @@ void C::aMember() {}
|
||||
)", R"(
|
||||
#include "file.h"
|
||||
|
||||
// Member function comment
|
||||
/**
|
||||
* \brief Foo::aMember
|
||||
*/
|
||||
void C::aMember() {}
|
||||
)"};
|
||||
QTest::newRow("member function: from decl to def") << headersMemberDecl2Def
|
||||
@@ -9296,13 +9300,17 @@ class C {
|
||||
void aMember();
|
||||
)", R"(
|
||||
class C {
|
||||
// Member function comment
|
||||
/**
|
||||
* \brief Foo::aMember
|
||||
*/
|
||||
void aMember();
|
||||
)"};
|
||||
const QByteArrayList sourcesMemberDef2Decl{R"(
|
||||
#include "file.h"
|
||||
|
||||
// Member function comment
|
||||
/**
|
||||
* \brief Foo::aMember
|
||||
*/
|
||||
void C::aMember() {@}
|
||||
)", R"(
|
||||
#include "file.h"
|
||||
|
||||
@@ -34,10 +34,13 @@
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <projectexplorer/editorconfiguration.h>
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
#include <projectexplorer/projecttree.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
|
||||
#include <texteditor/tabsettings.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/basetreeview.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
@@ -1950,25 +1953,30 @@ LookupResult lookUpDefinition(const CppQuickFixInterface &interface, const NameA
|
||||
// Try to find the class/template definition
|
||||
const Name *name = nameAst->name;
|
||||
const QList<LookupItem> results = interface.context().lookup(name, scope);
|
||||
LookupResult best = LookupResult::NotDeclared;
|
||||
for (const LookupItem &item : results) {
|
||||
if (Symbol *declaration = item.declaration()) {
|
||||
if (declaration->asClass())
|
||||
return LookupResult::Declared;
|
||||
if (declaration->asForwardClassDeclaration())
|
||||
return LookupResult::ForwardDeclared;
|
||||
if (declaration->asForwardClassDeclaration()) {
|
||||
best = LookupResult::ForwardDeclared;
|
||||
continue;
|
||||
}
|
||||
if (Template *templ = declaration->asTemplate()) {
|
||||
if (Symbol *declaration = templ->declaration()) {
|
||||
if (declaration->asClass())
|
||||
return LookupResult::Declared;
|
||||
if (declaration->asForwardClassDeclaration())
|
||||
return LookupResult::ForwardDeclared;
|
||||
if (declaration->asForwardClassDeclaration()) {
|
||||
best = LookupResult::ForwardDeclared;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return LookupResult::Declared;
|
||||
}
|
||||
}
|
||||
|
||||
return LookupResult::NotDeclared;
|
||||
return best;
|
||||
}
|
||||
|
||||
QString templateNameAsString(const TemplateNameId *templateName)
|
||||
@@ -9610,7 +9618,45 @@ private:
|
||||
comments.first(), sourceFile->document());
|
||||
const int sourceCommentEndPos = sourceTu->getTokenEndPositionInDocument(
|
||||
comments.last(), sourceFile->document());
|
||||
const QString functionDoc = sourceFile->textOf(sourceCommentStartPos, sourceCommentEndPos);
|
||||
|
||||
// Manually adjust indentation, as both our built-in indenter and ClangFormat
|
||||
// are unreliable with regards to comment continuation lines.
|
||||
auto tabSettings = [](CppRefactoringFilePtr file) {
|
||||
if (auto editor = file->editor())
|
||||
return editor->textDocument()->tabSettings();
|
||||
return ProjectExplorer::actualTabSettings(file->filePath(), nullptr);
|
||||
};
|
||||
const TabSettings &sts = tabSettings(sourceFile);
|
||||
const TabSettings &tts = tabSettings(targetFile);
|
||||
const QTextBlock insertionBlock = targetFile->document()->findBlock(insertionPos);
|
||||
const int insertionColumn = tts.columnAt(insertionBlock.text(),
|
||||
insertionPos - insertionBlock.position());
|
||||
const QTextBlock removalBlock = sourceFile->document()->findBlock(sourceCommentStartPos);
|
||||
const QTextBlock removalBlockEnd = sourceFile->document()->findBlock(sourceCommentEndPos);
|
||||
const int removalColumn = sts.columnAt(removalBlock.text(),
|
||||
sourceCommentStartPos - removalBlock.position());
|
||||
const int columnOffset = insertionColumn - removalColumn;
|
||||
QString functionDoc;
|
||||
if (columnOffset != 0) {
|
||||
for (QTextBlock block = removalBlock;
|
||||
block.isValid() && block != removalBlockEnd.next();
|
||||
block = block.next()) {
|
||||
QString text = block.text() + QChar::ParagraphSeparator;
|
||||
if (block == removalBlockEnd)
|
||||
text = text.left(sourceCommentEndPos - block.position());
|
||||
if (block == removalBlock) {
|
||||
text = text.mid(sourceCommentStartPos - block.position());
|
||||
} else {
|
||||
int lineIndentColumn = sts.indentationColumn(text) + columnOffset;
|
||||
text.replace(0,
|
||||
TabSettings::firstNonSpace(text),
|
||||
tts.indentationString(0, lineIndentColumn, 0, insertionBlock));
|
||||
}
|
||||
functionDoc += text;
|
||||
}
|
||||
} else {
|
||||
functionDoc = sourceFile->textOf(sourceCommentStartPos, sourceCommentEndPos);
|
||||
}
|
||||
|
||||
// Remove comment plus leading and trailing whitespace, including trailing newline.
|
||||
const auto removeAtSource = [&](ChangeSet &changeSet) {
|
||||
@@ -9642,10 +9688,10 @@ private:
|
||||
ChangeSet targetChangeSet;
|
||||
targetChangeSet.insert(insertionPos, functionDoc);
|
||||
targetChangeSet.insert(insertionPos, "\n");
|
||||
targetChangeSet.insert(insertionPos, QString(insertionColumn, ' '));
|
||||
if (targetFile == sourceFile)
|
||||
removeAtSource(targetChangeSet);
|
||||
targetFile->setChangeSet(targetChangeSet);
|
||||
targetFile->appendIndentRange({insertionPos, insertionPos + int(functionDoc.length())});
|
||||
const bool targetFileSuccess = targetFile->apply();
|
||||
if (targetFile == sourceFile || !targetFileSuccess)
|
||||
return;
|
||||
|
||||
@@ -1661,6 +1661,7 @@ void Client::setLogTarget(LogTarget target)
|
||||
|
||||
void Client::start()
|
||||
{
|
||||
d->m_shutdownTimer.stop();
|
||||
LanguageClientManager::addClient(this);
|
||||
d->m_clientInterface->start();
|
||||
}
|
||||
|
||||
@@ -691,13 +691,10 @@ void SymbolSupport::handleRenameResponse(Core::SearchResult *search,
|
||||
void SymbolSupport::applyRename(const Utils::SearchResultItems &checkedItems,
|
||||
Core::SearchResult *search)
|
||||
{
|
||||
QSet<Utils::FilePath> affectedNonOpenFilePaths;
|
||||
QMap<Utils::FilePath, QList<TextEdit>> editsForDocuments;
|
||||
QList<DocumentChange> changes;
|
||||
for (const Utils::SearchResultItem &item : checkedItems) {
|
||||
const auto filePath = Utils::FilePath::fromUserInput(item.path().value(0));
|
||||
if (!m_client->documentForFilePath(filePath))
|
||||
affectedNonOpenFilePaths << filePath;
|
||||
const QJsonObject jsonObject = item.userData().toJsonObject();
|
||||
if (const TextEdit edit(jsonObject); edit.isValid())
|
||||
editsForDocuments[filePath] << edit;
|
||||
@@ -715,10 +712,6 @@ void SymbolSupport::applyRename(const Utils::SearchResultItems &checkedItems,
|
||||
for (auto it = editsForDocuments.begin(), end = editsForDocuments.end(); it != end; ++it)
|
||||
applyTextEdits(m_client, it.key(), it.value());
|
||||
|
||||
if (!affectedNonOpenFilePaths.isEmpty()) {
|
||||
Core::DocumentManager::notifyFilesChangedInternally(Utils::toList(affectedNonOpenFilePaths));
|
||||
}
|
||||
|
||||
const auto extraWidget = qobject_cast<ReplaceWidget *>(search->additionalReplaceWidget());
|
||||
QTC_ASSERT(extraWidget, return);
|
||||
if (!extraWidget->shouldRenameFiles())
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
extend_qtc_plugin(McuSupport
|
||||
CONDITION WITH_TESTS AND TARGET Googletest
|
||||
DEPENDS Googletest
|
||||
DEFINES GOOGLE_TEST_IS_FOUND
|
||||
SOURCES
|
||||
unittest.h unittest.cpp
|
||||
packagemock.h
|
||||
|
||||
@@ -821,7 +821,11 @@ void Project::createTargetFromMap(const Store &map, int index)
|
||||
}
|
||||
|
||||
Kit *k = KitManager::kit(id);
|
||||
if (!k && !ICore::isQtDesignStudio()) {
|
||||
if (!k) {
|
||||
// QDS does not want replacement kits.
|
||||
if (ICore::isQtDesignStudio())
|
||||
return;
|
||||
|
||||
Id deviceTypeId = Id::fromSetting(targetMap.value(Target::deviceTypeKey()));
|
||||
if (!deviceTypeId.isValid())
|
||||
deviceTypeId = Constants::DESKTOP_DEVICE_TYPE;
|
||||
|
||||
@@ -32,8 +32,6 @@ add_feature_info("Model tracing" ${ENABLE_MODEL_TRACING} "")
|
||||
add_qtc_library(QmlDesignerUtils STATIC
|
||||
DEPENDS
|
||||
Qt::Gui Utils Qt::QmlPrivate Core
|
||||
DEFINES QMLDESIGNERUTILS_LIBRARY
|
||||
PUBLIC_DEFINES $<$<BOOL:${QTC_STATIC_BUILD}>:QMLDESIGNER_STATIC_LIBRARY>
|
||||
|
||||
PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR}/utils
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/utils
|
||||
@@ -83,8 +81,6 @@ add_qtc_library(QmlDesignerCore STATIC
|
||||
TextEditor
|
||||
Sqlite
|
||||
DEFINES
|
||||
QMLDESIGNERCORE_LIBRARY
|
||||
QMLDESIGNERUTILS_LIBRARY
|
||||
$<$<BOOL:${USE_PROJECTSTORAGE}>:QDS_USE_PROJECTSTORAGE>
|
||||
INCLUDES
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
@@ -490,7 +486,6 @@ add_qtc_plugin(QmlDesigner
|
||||
IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\"
|
||||
SHARE_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../../../share/qtcreator/qmldesigner"
|
||||
$<$<BOOL:${USE_PROJECTSTORAGE}>:QDS_USE_PROJECTSTORAGE>
|
||||
QMLDESIGNER_LIBRARY QMLDESIGNERCORE_LIBRARY QMLDESIGNERUTILS_LIBRARY
|
||||
INCLUDES
|
||||
${CMAKE_CURRENT_LIST_DIR}/components
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/assetslibrary
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#if defined(STUDIOWELCOME_LIBRARY)
|
||||
# define STUDIOWELCOME_EXPORT Q_DECL_EXPORT
|
||||
#elif defined(STUDIOWELCOME_STATIC_LIBRARY)
|
||||
# define STUDIOWELCOME_EXPORT
|
||||
#else
|
||||
# define STUDIOWELCOME_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
@@ -15,5 +15,6 @@ constexpr char CLEARSELECTION[] = "Terminal.ClearSelection";
|
||||
constexpr char MOVECURSORWORDLEFT[] = "Terminal.MoveCursorWordLeft";
|
||||
constexpr char MOVECURSORWORDRIGHT[] = "Terminal.MoveCursorWordRight";
|
||||
constexpr char CLEAR_TERMINAL[] = "Terminal.ClearTerminal";
|
||||
constexpr char TOGGLE_KEYBOARD_LOCK[] = "Terminal.ToggleKeyboardLock";
|
||||
|
||||
} // namespace Terminal::Constants
|
||||
|
||||
@@ -125,6 +125,8 @@ TerminalPane::TerminalPane(QObject *parent)
|
||||
|
||||
updateLockButton();
|
||||
|
||||
connect(&toggleKeyboardLock, &QAction::triggered, m_lockKeyboardButton, &QToolButton::toggle);
|
||||
|
||||
connect(m_lockKeyboardButton, &QToolButton::toggled, this, [this, updateLockButton] {
|
||||
settings().lockKeyboard.setValue(m_lockKeyboardButton->isChecked());
|
||||
updateLockButton();
|
||||
@@ -292,6 +294,8 @@ void TerminalPane::initActions()
|
||||
closeTerminal.setIcon(CLOSE_TERMINAL_ICON.icon());
|
||||
closeTerminal.setToolTip(Tr::tr("Close the current Terminal."));
|
||||
|
||||
toggleKeyboardLock.setText(Tr::tr("Toggle Keyboard Lock"));
|
||||
|
||||
using namespace Constants;
|
||||
|
||||
Command *cmd = ActionManager::registerAction(&newTerminal, NEWTERMINAL, m_selfContext);
|
||||
@@ -310,6 +314,10 @@ void TerminalPane::initActions()
|
||||
QKeySequence(HostOsInfo::isMacHost() ? QLatin1String("Ctrl+Shift+]")
|
||||
: QLatin1String("Ctrl+PgDown"))});
|
||||
|
||||
ActionManager::registerAction(&toggleKeyboardLock,
|
||||
TOGGLE_KEYBOARD_LOCK,
|
||||
m_selfContext);
|
||||
|
||||
connect(&newTerminal, &QAction::triggered, this, [this] { openTerminal({}); });
|
||||
connect(&closeTerminal, &QAction::triggered, this, [this] {
|
||||
removeTab(m_tabWidget.currentIndex());
|
||||
|
||||
@@ -66,6 +66,7 @@ private:
|
||||
QAction nextTerminal;
|
||||
QAction prevTerminal;
|
||||
QAction closeTerminal;
|
||||
QAction toggleKeyboardLock;
|
||||
|
||||
QMenu m_shellMenu;
|
||||
|
||||
|
||||
@@ -293,6 +293,10 @@ void TerminalWidget::setupActions()
|
||||
this,
|
||||
&TerminalWidget::moveCursorWordRight);
|
||||
|
||||
// Ctrl+Q, the default "Quit" shortcut, is a useful key combination in a shell.
|
||||
// It can be used in combination with Ctrl+S to pause a program, and resume it with Ctrl+Q.
|
||||
// So we unlock the EXIT command only for macOS where the default is Cmd+Q to quit.
|
||||
if (HostOsInfo::isMacHost())
|
||||
unlockGlobalAction(Core::Constants::EXIT);
|
||||
unlockGlobalAction(Core::Constants::OPTIONS);
|
||||
unlockGlobalAction("Preferences.Terminal.General");
|
||||
@@ -571,6 +575,12 @@ bool TerminalWidget::event(QEvent *event)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (settings().lockKeyboard()
|
||||
&& QKeySequence(keyEvent->keyCombination())
|
||||
== ActionManager::command(Constants::TOGGLE_KEYBOARD_LOCK)->keySequence()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (settings().lockKeyboard()) {
|
||||
event->accept();
|
||||
return true;
|
||||
|
||||
@@ -388,7 +388,6 @@ void BaseFileFind::doReplace(const QString &text, const SearchResultItems &items
|
||||
if (!files.isEmpty()) {
|
||||
FadingIndicator::showText(ICore::dialogParent(),
|
||||
Tr::tr("%n occurrences replaced.", nullptr, items.size()), FadingIndicator::SmallText);
|
||||
DocumentManager::notifyFilesChangedInternally(files);
|
||||
SearchResultWindow::instance()->hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,9 +355,9 @@ bool RefactoringFile::apply()
|
||||
QString error;
|
||||
// suppress "file has changed" warnings if the file is open in a read-only editor
|
||||
Core::FileChangeBlocker block(m_filePath);
|
||||
if (!m_textFileFormat.writeFile(m_filePath,
|
||||
doc->toPlainText(),
|
||||
&error)) {
|
||||
if (m_textFileFormat.writeFile(m_filePath, doc->toPlainText(), &error)) {
|
||||
Core::DocumentManager::notifyFilesChangedInternally({m_filePath});
|
||||
} else {
|
||||
qWarning() << "Could not apply changes to" << m_filePath
|
||||
<< ". Error: " << error;
|
||||
result = false;
|
||||
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
, m_editor(parent)
|
||||
{
|
||||
connect(m_editor, &QPlainTextEdit::cursorPositionChanged, this, &LineColumnButton::update);
|
||||
connect(this, &QToolButton::pressed, ActionManager::instance(), [this] {
|
||||
connect(this, &QToolButton::clicked, ActionManager::instance(), [this] {
|
||||
emit m_editor->activateEditor(EditorManager::IgnoreNavigationHistory);
|
||||
QMetaObject::invokeMethod(ActionManager::instance(), [] {
|
||||
if (Command *cmd = ActionManager::command(Core::Constants::GOTO)) {
|
||||
|
||||
@@ -50,8 +50,8 @@ void tst_Reformatter::test_data()
|
||||
// makes a change inline, for example whitespace removal. We omit
|
||||
// those files in this test.
|
||||
QSet<QString> excludedFiles;
|
||||
excludedFiles << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.qml";
|
||||
excludedFiles << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.formatted.qml";
|
||||
excludedFiles << QString::fromLatin1(TESTSRCDIR) + "/typeAnnotations.qml";
|
||||
excludedFiles << QString::fromLatin1(TESTSRCDIR) + "/typeAnnotations.formatted.qml";
|
||||
|
||||
QDirIterator it(TESTSRCDIR, QStringList() << QLatin1String("*.qml") << QLatin1String("*.js"), QDir::Files);
|
||||
while (it.hasNext()) {
|
||||
@@ -103,8 +103,8 @@ void tst_Reformatter::reformatter_data()
|
||||
QTest::addColumn<QString>("formattedFilePath");
|
||||
|
||||
QTest::newRow("typeAnnotations")
|
||||
<< QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.qml"
|
||||
<< QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.formatted.qml";
|
||||
<< QString::fromLatin1(TESTSRCDIR) + "/typeAnnotations.qml"
|
||||
<< QString::fromLatin1(TESTSRCDIR) +"/typeAnnotations.formatted.qml";
|
||||
}
|
||||
|
||||
void tst_Reformatter::reformatter()
|
||||
|
||||
Reference in New Issue
Block a user