Merge remote-tracking branch 'origin/8.0'

Conflicts:
	share/qtcreator/translations/qtcreator_ja.ts

Change-Id: I436b8f60971f11a5fb7962a57600ad075135f397
This commit is contained in:
Eike Ziller
2022-07-08 10:21:30 +02:00
43 changed files with 314 additions and 241 deletions

View File

@@ -1,6 +1,6 @@
set(IDE_VERSION "7.84.0") # The IDE version.
set(IDE_VERSION_COMPAT "7.84.0") # The IDE Compatibility version.
set(IDE_VERSION_DISPLAY "8.0.0-rc1") # The IDE display version.
set(IDE_VERSION "8.0.0") # The IDE version.
set(IDE_VERSION_COMPAT "8.0.0") # The IDE Compatibility version.
set(IDE_VERSION_DISPLAY "8.0.0") # The IDE display version.
set(IDE_COPYRIGHT_YEAR "2022") # The IDE current copyright year.
set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation.

View File

@@ -0,0 +1,71 @@
cmake_minimum_required(VERSION 3.5)
project(TextFinder VERSION 0.1 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools)
set(TS_FILES TextFinder_de_DE.ts)
set(PROJECT_SOURCES
main.cpp
textfinder.cpp
textfinder.h
textfinder.ui
${TS_FILES}
textfinder.qrc
)
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(TextFinder
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
# Define target properties for Android with Qt 6 as:
# set_property(TARGET TextFinder APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
else()
if(ANDROID)
add_library(TextFinder SHARED
${PROJECT_SOURCES}
)
# Define properties for Android with Qt 5 after find_package() calls as:
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
else()
add_executable(TextFinder
${PROJECT_SOURCES}
)
endif()
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
endif()
target_link_libraries(TextFinder PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
set_target_properties(TextFinder PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
)
install(TARGETS TextFinder
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(TextFinder)
endif()

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
<context>
<name>TextFinder</name>
<message>
<location filename="textfinder.ui" line="14"/>
<source>TextFinder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="textfinder.ui" line="22"/>
<source>Keyword</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="textfinder.ui" line="32"/>
<source>Find</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
@@ -47,15 +47,25 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#include "textfinder.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(textfinder);
QApplication a(argc, argv);
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "TextFinder_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
TextFinder w;
w.show();
return a.exec();

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
@@ -47,18 +47,18 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#include "textfinder.h"
//! [1]
#include "./ui_textfinder.h"
#include <QFile>
#include <QTextStream>
//! [1]
#include <QMessageBox>
//! [3]
TextFinder::TextFinder(QWidget *parent)
: QWidget(parent), ui(new Ui::TextFinder)
: QWidget(parent)
, ui(new Ui::TextFinder)
{
ui->setupUi(this);
loadTextFile();

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator
@@ -47,24 +47,21 @@
** $QT_END_LICENSE$
**
****************************************************************************/
#pragma once
#include "ui_textfinder.h"
#ifndef TEXTFINDER_H
#define TEXTFINDER_H
#include <QWidget>
namespace Ui
{
class TextFinder;
}
QT_BEGIN_NAMESPACE
namespace Ui { class TextFinder; }
QT_END_NAMESPACE
class TextFinder : public QWidget
{
Q_OBJECT
public:
TextFinder(QWidget *parent = 0);
TextFinder(QWidget *parent = nullptr);
~TextFinder();
//! [0]
@@ -76,3 +73,4 @@ private:
void loadTextFile();
//! [0]
};
#endif // TEXTFINDER_H

View File

@@ -1,13 +0,0 @@
TARGET = TextFinder
TEMPLATE = app
QT += widgets
SOURCES += main.cpp\
textfinder.cpp
HEADERS += textfinder.h
FORMS += textfinder.ui
RESOURCES += textfinder.qrc

View File

@@ -1,5 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>input.txt</file>
</qresource>
</RCC>
<RCC>
<qresource prefix="/">
<file>input.txt</file>
</qresource>
</RCC>

View File

@@ -6,33 +6,30 @@
<rect>
<x>0</x>
<y>0</y>
<width>378</width>
<height>158</height>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>Find Text</string>
<string>TextFinder</string>
</property>
<layout class="QVBoxLayout">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="searchLabel">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&amp;Keyword:</string>
</property>
<property name="buddy">
<cstring>lineEdit</cstring>
<string>Keyword</string>
</property>
</widget>
</item>
<item row="0" column="2">
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item>
<widget class="QPushButton" name="findButton">
<property name="text">
<string>&amp;Find</string>
<string>Find</string>
</property>
</widget>
</item>
@@ -41,38 +38,8 @@
<item>
<widget class="QTextEdit" name="textEdit"/>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>lineEdit</sender>
<signal>returnPressed()</signal>
<receiver>findButton</receiver>
<slot>animateClick()</slot>
<hints>
<hint type="sourcelabel">
<x>261</x>
<y>17</y>
</hint>
<hint type="destinationlabel">
<x>320</x>
<y>17</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2022 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -68,9 +68,8 @@
\image qtcreator-new-project-build-system-qt-gui.png "Define Build System dialog"
\li In the \uicontrol {Build system} field, select the build system to
use for building and running the project: \l qmake,
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
\li In the \uicontrol {Build system} field, select \l {Setting Up CMake}
{CMake} as the build system to use for building the project.
\li Select \uicontrol Next or \uicontrol Continue to open the
\uicontrol{Class Information} dialog.
@@ -117,8 +116,7 @@
\note The project opens in the \uicontrol Edit mode, and these instructions are
hidden. To return to these instructions, open the \uicontrol Help mode.
If you selected qmake as the build system, the TextFinder project now
contains the following files:
The TextFinder project now contains the following files:
\list
@@ -126,14 +124,13 @@
\li textfinder.h
\li textfinder.cpp
\li textfinder.ui
\li textfinder.pro
\li CMakeLists.txt
\endlist
\image qtcreator-textfinder-contents.png "TextFinder project contents"
The .h and .cpp files come with the necessary boiler plate code.
The .pro file is complete.
If you selected CMake as the build system, \QC created a CMakeLists.txt
project file for you.
@@ -312,7 +309,7 @@
\li In the \uicontrol{Name} field, enter \b{textfinder}.
\li In the \uicontrol{Path} field, enter \c{C:\Qt\examples\TextFinder},
\li In the \uicontrol{Path} field, enter the path to the project,
and select \uicontrol Next or \uicontrol Continue.
The \uicontrol{Project Management} dialog opens.
@@ -320,10 +317,16 @@
\image qtcreator-add-resource-wizard3.png "Project Management dialog"
\li In the \uicontrol{Add to project} field, select \b{TextFinder.pro}
\li In the \uicontrol{Add to project} field, select \b{TextFinder}
and select \uicontrol{Finish} or \uicontrol Done to open the file
in the code editor.
\li In the \uicontrol Copy to Clipboard dialog, select \uicontrol Yes to
copy the path to the resource file to the clipboard for adding it
to the CMakeLists.txt file.
\image qtcreator-add-resource-wizard4.png "Copy to Clipboard dialog"
\li Select \uicontrol Add > \uicontrol {Add Prefix}.
\li In the \uicontrol{Prefix} field, replace the default prefix with a slash
@@ -336,10 +339,20 @@
\endlist
\section1 Compiling and Running Your Program
\section1 Adding Resources to Project File
For the text file to appear when you run the application, you must specify
the resource file as a source file in the \e CMakeLists.txt file that the
wizard created for you:
\quotefromfile TextFinder/CMakeLists.txt
\skipto set(PROJECT_SOURCES
\printuntil )
\section1 Compiling and Running Your Application
Now that you have all the necessary files, select the
\inlineimage icons/run_small.png
button to compile and run your program.
button to compile and run your Application.
*/

View File

@@ -6,15 +6,15 @@ import qbs.Utilities
Module {
Depends { name: "cpp"; required: false }
property string qtcreator_display_version: '8.0.0-rc1'
property string ide_version_major: '7'
property string ide_version_minor: '84'
property string qtcreator_display_version: '8.0.0'
property string ide_version_major: '8'
property string ide_version_minor: '0'
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: '7'
property string ide_compat_version_minor: '84'
property string ide_compat_version_major: '8'
property string ide_compat_version_minor: '0'
property string ide_compat_version_release: '0'
property string qtcreator_compat_version: ide_compat_version_major + '.'
+ ide_compat_version_minor + '.' + ide_compat_version_release

View File

@@ -1,6 +1,6 @@
QTCREATOR_VERSION = 7.84.0
QTCREATOR_COMPAT_VERSION = 7.84.0
QTCREATOR_DISPLAY_VERSION = 8.0.0-rc1
QTCREATOR_VERSION = 8.0.0
QTCREATOR_COMPAT_VERSION = 8.0.0
QTCREATOR_DISPLAY_VERSION = 8.0.0
QTCREATOR_COPYRIGHT_YEAR = 2022
IDE_DISPLAY_NAME = Qt Creator

View File

@@ -791,6 +791,7 @@ class Dumper(DumperBase):
def lookupNativeType(self, name):
#DumperBase.warn('LOOKUP TYPE NAME: %s' % name)
typeobj = self.typeCache.get(name)
if typeobj is not None:
#DumperBase.warn('CACHED: %s' % name)
@@ -846,6 +847,15 @@ class Dumper(DumperBase):
if typeobj is not None:
return typeobj
# For QMetaType based typenames we have to re-format the type name.
# Converts "T<A,B<C,D>>"" to "T<A, B<C, D> >" since FindFirstType
# expects it that way.
name = name.replace(',', ', ').replace('>>', '> >')
typeobj = self.target.FindFirstType(name)
if typeobj.IsValid():
self.typeCache[name] = typeobj
return typeobj
return lldb.SBType()
def setupInferior(self, args):

View File

@@ -55,6 +55,8 @@ SecondColumnLayout {
property color originalColor
property bool isVector3D: false
property alias spacer: spacer
function isNotInGradientMode() {
return ceMode.currentValue === "Solid"
}
@@ -1310,17 +1312,7 @@ SecondColumnLayout {
}
}
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
ControlLabel {
text: "Hex"
horizontalAlignment: Text.AlignLeft
width: StudioTheme.Values.controlLabelWidth
+ StudioTheme.Values.controlGap
+ StudioTheme.Values.linkControlWidth
}
ExpandingSpacer {}
ExpandingSpacer { id: spacer}
StudioControls.Menu {
id: contextMenu

View File

@@ -47,6 +47,9 @@ Row {
// Current item
property string absoluteFilePath: ""
property alias comboBox: comboBox
property alias spacer: spacer
FileResourcesModel {
id: fileModel
modelNodeBackendProperty: modelNodeBackend
@@ -501,7 +504,9 @@ Row {
}
}
Spacer { implicitWidth: StudioTheme.Values.twoControlColumnGap }
Spacer { id: spacer
implicitWidth: StudioTheme.Values.twoControlColumnGap
}
IconIndicator {
icon: StudioTheme.Constants.addFile

View File

@@ -8168,10 +8168,6 @@ SSH 認証が必要とされるリポジトリで使用されます(SSH の SSH_
<source>Whether the grid wraps key navigation.</source>
<translation></translation>
</message>
<message>
<source>Whether the grid wraps key navigation.</source>
<translation></translation>
</message>
<message>
<source>Orientation</source>
<translation></translation>
@@ -9020,22 +9016,6 @@ preferShaping プロパティを false に設定すると、このような機
<source>Add Annotation</source>
<translation></translation>
</message>
<message>
<source>Exports this item as an alias property of the root item.</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Component</source>
<translation></translation>
</message>
<message>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<source>Custom ID</source>
<translation>Custom ID</translation>
</message>
<message>
<source>Visibility</source>
<translation></translation>
@@ -9106,10 +9086,6 @@ preferShaping プロパティを false に設定すると、このような機
<source>Exports this item as an alias property of the root item.</source>
<translation type="vanished"></translation>
</message>
<message>
<source>Exports this item as an alias property of the root item.</source>
<translation type="vanished"></translation>
</message>
</context>
<context>
<name>TextInputSection</name>
@@ -15854,10 +15830,6 @@ to version control (%2)
<source>Evaluating Type Hierarchy</source>
<translation></translation>
</message>
<message>
<source>Derived</source>
<translation></translation>
</message>
<message>
<source>Evaluating type hierarchy...</source>
<translation>...</translation>
@@ -20466,10 +20438,6 @@ Do you want to retry?</source>
<source>Cannot evaluate %1 in current stack frame.</source>
<translation>%1 </translation>
</message>
<message>
<source>QML Debugger disconnected.</source>
<translation>QML </translation>
</message>
<message>
<source>Context:</source>
<translation>:</translation>
@@ -27683,10 +27651,6 @@ to project &quot;%2&quot;.</source>
<source>Import Build</source>
<translation></translation>
</message>
<message>
<source>%1 - temporary</source>
<translation>%1 - </translation>
</message>
<message>
<source>Imported Kit</source>
<translation></translation>
@@ -30646,22 +30610,6 @@ Preselects a desktop Qt for building the application if available.</source>
<source>Could not add %1 to project.</source>
<translation> %1 </translation>
</message>
<message>
<source>All Files (%1)</source>
<translation> (%1)</translation>
</message>
<message>
<source>Add Assets</source>
<translation></translation>
</message>
<message>
<source>Failed to Add Files</source>
<translation></translation>
</message>
<message>
<source>Could not add %1 to project.</source>
<translation> %1 </translation>
</message>
<message>
<source>Resources</source>
<comment>Title of library resources view</comment>
@@ -30821,14 +30769,6 @@ Locked items cannot be modified or selected.</source>
<source>%1 is an invalid ID.</source>
<translation>%1 id </translation>
</message>
<message>
<source>Invalid ID</source>
<translation> ID</translation>
</message>
<message>
<source>%1 is an invalid ID.</source>
<translation>%1 id </translation>
</message>
<message>
<source>%1 already exists.</source>
<translation>%1 </translation>
@@ -31192,10 +31132,6 @@ Ids must begin with a lowercase letter.</source>
<source>&amp;Go into Component</source>
<translation>(&amp;G)</translation>
</message>
<message>
<source>&amp;Go into Component</source>
<translation type="vanished">(&amp;G)</translation>
</message>
<message>
<source>Export as &amp;Image...</source>
<translation>(&amp;I)...</translation>
@@ -31910,10 +31846,6 @@ Do you want to save the data first?</source>
<source>Kit has no device.</source>
<translation></translation>
</message>
<message>
<source>Qt version is too old.</source>
<translation>Qt </translation>
</message>
<message>
<source>Qt version has no qmlscene command.</source>
<translation>Qt qmlscene </translation>

View File

@@ -48,17 +48,15 @@ class JsonRpcMessage;
class LANGUAGESERVERPROTOCOL_EXPORT MessageId : public Utils::variant<int, QString>
{
public:
MessageId() = default;
MessageId() : variant(QString()) {}
explicit MessageId(int id) : variant(id) {}
explicit MessageId(const QString &id) : variant(id) {}
explicit MessageId(const QJsonValue &value)
{
if (value.isDouble())
*this = MessageId(value.toInt());
else if (value.isString())
*this = MessageId(value.toString());
emplace<int>(value.toInt());
else
m_valid = false;
emplace<QString>(value.toString());
}
operator QJsonValue() const
@@ -70,7 +68,14 @@ public:
return QJsonValue();
}
bool isValid() const { return m_valid; }
bool isValid() const
{
if (Utils::holds_alternative<int>(*this))
return true;
const QString *id = Utils::get_if<QString>(this);
QTC_ASSERT(id, return false);
return !id->isEmpty();
}
QString toString() const
{
@@ -89,9 +94,6 @@ public:
return QT_PREPEND_NAMESPACE(qHash(Utils::get<QString>(id)));
return QT_PREPEND_NAMESPACE(qHash(0));
}
private:
bool m_valid = true;
};
template <typename Error>

View File

@@ -135,7 +135,7 @@ public:
std::set<FilePath> openedFiles;
VirtualFunctionAssistProcessor *virtualFuncAssistProcessor = nullptr;
QMetaObject::Connection focusChangedConnection;
bool finished = false;
bool done = false;
};
ClangdFollowSymbol::ClangdFollowSymbol(ClangdClient *client, const QTextCursor &cursor,
@@ -146,14 +146,14 @@ ClangdFollowSymbol::ClangdFollowSymbol(ClangdClient *client, const QTextCursor &
openInSplit))
{
// Abort if the user does something else with the document in the meantime.
connect(document, &TextDocument::contentsChanged, this, &ClangdFollowSymbol::done,
connect(document, &TextDocument::contentsChanged, this, &ClangdFollowSymbol::emitDone,
Qt::QueuedConnection);
if (editorWidget) {
connect(editorWidget, &CppEditorWidget::cursorPositionChanged,
this, &ClangdFollowSymbol::done, Qt::QueuedConnection);
this, &ClangdFollowSymbol::emitDone, Qt::QueuedConnection);
}
d->focusChangedConnection = connect(qApp, &QApplication::focusChanged,
this, &ClangdFollowSymbol::done, Qt::QueuedConnection);
this, &ClangdFollowSymbol::emitDone, Qt::QueuedConnection);
// Step 1: Follow the symbol via "Go to Definition". At the same time, request the
// AST node corresponding to the cursor position, so we can find out whether
@@ -163,7 +163,7 @@ ClangdFollowSymbol::ClangdFollowSymbol(ClangdClient *client, const QTextCursor &
if (!self)
return;
if (!link.hasValidTarget()) {
emit self->done();
self->emitDone();
return;
}
self->d->defLink = link;
@@ -205,6 +205,15 @@ void ClangdFollowSymbol::clear()
d->pendingGotoDefRequests.clear();
}
void ClangdFollowSymbol::emitDone()
{
if (d->done)
return;
d->done = true;
emit done();
}
bool ClangdFollowSymbol::Private::defLinkIsAmbiguous() const
{
// Even if the call is to a virtual function, it might not be ambiguous:
@@ -238,18 +247,18 @@ void ClangdFollowSymbol::Private::handleDocumentInfoResults()
// If something went wrong, we just follow the original link.
if (symbolsToDisplay.isEmpty()) {
callback(defLink);
emit q->done();
q->emitDone();
return;
}
if (symbolsToDisplay.size() == 1) {
callback(symbolsToDisplay.first().second);
emit q->done();
q->emitDone();
return;
}
QTC_ASSERT(virtualFuncAssistProcessor && virtualFuncAssistProcessor->running(),
emit q->done(); return);
q->emitDone(); return);
virtualFuncAssistProcessor->finalize();
}
@@ -301,7 +310,7 @@ void ClangdFollowSymbol::VirtualFunctionAssistProcessor::resetData(bool resetFol
return;
m_followSymbol->d->virtualFuncAssistProcessor = nullptr;
if (resetFollowSymbolData)
emit m_followSymbol->done();
m_followSymbol->emitDone();
m_followSymbol = nullptr;
}
@@ -374,7 +383,7 @@ void ClangdFollowSymbol::Private::handleGotoDefinitionResult()
// No dis-ambiguation necessary. Call back with the link and finish.
if (!defLinkIsAmbiguous()) {
callback(defLink);
emit q->done();
q->emitDone();
return;
}
@@ -408,7 +417,7 @@ void ClangdFollowSymbol::Private::handleGotoImplementationResult(
// We didn't find any further candidates, so jump to the original definition link.
if (allLinks.size() == 1 && pendingGotoImplRequests.isEmpty()) {
callback(allLinks.first());
emit q->done();
q->emitDone();
return;
}

View File

@@ -55,6 +55,7 @@ signals:
void done();
private:
void emitDone();
class VirtualFunctionAssistProcessor;
class VirtualFunctionAssistProvider;

View File

@@ -68,6 +68,7 @@ public:
const LinkHandler callback;
optional<ClangdAstNode> ast;
optional<DocumentSymbolsResult> docSymbols;
bool done = false;
};
ClangdSwitchDeclDef::ClangdSwitchDeclDef(ClangdClient *client, TextDocument *doc,
@@ -75,14 +76,14 @@ ClangdSwitchDeclDef::ClangdSwitchDeclDef(ClangdClient *client, TextDocument *doc
: QObject(client), d(new Private(this, client, doc, cursor, editorWidget, callback))
{
// Abort if the user does something else with the document in the meantime.
connect(doc, &TextDocument::contentsChanged, this, &ClangdSwitchDeclDef::done,
connect(doc, &TextDocument::contentsChanged, this, &ClangdSwitchDeclDef::emitDone,
Qt::QueuedConnection);
if (editorWidget) {
connect(editorWidget, &CppEditorWidget::cursorPositionChanged,
this, &ClangdSwitchDeclDef::done, Qt::QueuedConnection);
this, &ClangdSwitchDeclDef::emitDone, Qt::QueuedConnection);
}
connect(qApp, &QApplication::focusChanged,
this, &ClangdSwitchDeclDef::done, Qt::QueuedConnection);
this, &ClangdSwitchDeclDef::emitDone, Qt::QueuedConnection);
connect(client->documentSymbolCache(), &DocumentSymbolCache::gotSymbols, this,
[this](const DocumentUri &uri, const DocumentSymbolsResult &symbols) {
@@ -101,11 +102,11 @@ ClangdSwitchDeclDef::ClangdSwitchDeclDef(ClangdClient *client, TextDocument *doc
if (!self)
return;
if (!d->document) {
emit done();
emitDone();
return;
}
if (!ast.isValid()) {
emit done();
emitDone();
return;
}
d->ast = ast;
@@ -122,6 +123,15 @@ ClangdSwitchDeclDef::~ClangdSwitchDeclDef()
delete d;
}
void ClangdSwitchDeclDef::emitDone()
{
if (d->done)
return;
d->done = true;
emit done();
}
optional<ClangdAstNode> ClangdSwitchDeclDef::Private::getFunctionNode() const
{
QTC_ASSERT(ast, return {});
@@ -160,7 +170,7 @@ QTextCursor ClangdSwitchDeclDef::Private::cursorForFunctionName(const ClangdAstN
void ClangdSwitchDeclDef::Private::handleDeclDefSwitchReplies()
{
if (!document) {
emit q->done();
q->emitDone();
return;
}
@@ -171,7 +181,7 @@ void ClangdSwitchDeclDef::Private::handleDeclDefSwitchReplies()
ast->print(0);
const Utils::optional<ClangdAstNode> functionNode = getFunctionNode();
if (!functionNode) {
emit q->done();
q->emitDone();
return;
}
@@ -182,7 +192,7 @@ void ClangdSwitchDeclDef::Private::handleDeclDefSwitchReplies()
client->followSymbol(document.data(), funcNameCursor, editorWidget, callback,
true, false);
}
emit q->done();
q->emitDone();
}
} // namespace ClangCodeModel::Internal

View File

@@ -52,6 +52,7 @@ signals:
void done();
private:
void emitDone();
class Private;
Private * const d;
};

View File

@@ -88,6 +88,7 @@ void SemanticTokenSupport::reloadSemanticTokensImpl(TextDocument *textDocument,
filePath,
documentVersion = m_client->documentVersion(filePath)](
const SemanticTokensFullRequest::Response &response) {
m_runningRequests.remove(filePath);
if (const auto error = response.error()) {
qCDebug(LOGLSPHIGHLIGHT)
<< "received error" << error->code() << error->message() << "for" << filePath;
@@ -120,6 +121,10 @@ void SemanticTokenSupport::reloadSemanticTokensImpl(TextDocument *textDocument,
request.setResponseCallback(responseCallback);
qCDebug(LOGLSPHIGHLIGHT) << "Requesting all tokens for" << filePath << "with version"
<< m_client->documentVersion(filePath);
MessageId &id = m_runningRequests[filePath];
if (id.isValid())
m_client->cancelRequest(id);
id = request.id();
m_client->sendMessage(request);
}
}
@@ -151,6 +156,7 @@ void SemanticTokenSupport::updateSemanticTokensImpl(TextDocument *textDocument,
request.setResponseCallback(
[this, filePath, documentVersion, remainingRerequests](
const SemanticTokensFullDeltaRequest::Response &response) {
m_runningRequests.remove(filePath);
if (const auto error = response.error()) {
qCDebug(LOGLSPHIGHLIGHT) << "received error" << error->code()
<< error->message() << "for" << filePath;
@@ -168,6 +174,10 @@ void SemanticTokenSupport::updateSemanticTokensImpl(TextDocument *textDocument,
});
qCDebug(LOGLSPHIGHLIGHT)
<< "Requesting delta for" << filePath << "with version" << documentVersion;
MessageId &id = m_runningRequests[filePath];
if (id.isValid())
m_client->cancelRequest(id);
id = request.id();
m_client->sendMessage(request);
return;
}

View File

@@ -120,6 +120,7 @@ private:
QStringList m_tokenTypeStrings;
QStringList m_tokenModifierStrings;
QSet<TextEditor::TextDocument *> m_docReloadQueue;
QHash<Utils::FilePath, LanguageServerProtocol::MessageId> m_runningRequests;
};
} // namespace LanguageClient

View File

@@ -35,6 +35,10 @@
#include <nodeabstractproperty.h>
#include <variantproperty.h>
#include <signalhandlerproperty.h>
#include <qmldesignerplugin.h>
#include <viewmanager.h>
#include <utils/qtcassert.h>
#include <QTableView>
@@ -268,6 +272,25 @@ BackendModel *ConnectionView::backendModel() const
return m_backendModel;
}
ConnectionView *ConnectionView::instance()
{
static ConnectionView *s_instance = nullptr;
if (s_instance)
return s_instance;
const auto views = QmlDesignerPlugin::instance()->viewManager().views();
for (auto *view : views) {
ConnectionView *myView = qobject_cast<ConnectionView*>(view);
if (myView)
s_instance = myView;
}
QTC_ASSERT(s_instance, return nullptr);
return s_instance;
}
} // namesapce Internal
} // namespace QmlDesigner

View File

@@ -83,13 +83,14 @@ public:
QTableView *dynamicPropertiesTableView() const;
QTableView *backendView() const;
protected:
DynamicPropertiesModel *dynamicPropertiesModel() const;
ConnectionViewWidget *connectionViewWidget() const;
ConnectionModel *connectionModel() const;
BindingModel *bindingModel() const;
DynamicPropertiesModel *dynamicPropertiesModel() const;
BackendModel *backendModel() const;
static ConnectionView *instance();
private: //variables
QPointer<ConnectionViewWidget> m_connectionViewWidget;

View File

@@ -63,22 +63,6 @@ QString idOrTypeNameForNode(const QmlDesigner::ModelNode &modelNode)
return idLabel;
}
QmlDesigner::PropertyName unusedProperty(const QmlDesigner::ModelNode &modelNode)
{
QmlDesigner::PropertyName propertyName = "property";
int i = 0;
if (modelNode.metaInfo().isValid()) {
while (true) {
const QmlDesigner::PropertyName currentPropertyName = propertyName + QString::number(i).toLatin1();
if (!modelNode.hasProperty(currentPropertyName) && !modelNode.metaInfo().hasProperty(currentPropertyName))
return currentPropertyName;
i++;
}
}
return propertyName;
}
QVariant convertVariantForTypeName(const QVariant &variant, const QmlDesigner::TypeName &typeName)
{
QVariant returnValue = variant;
@@ -120,6 +104,22 @@ namespace QmlDesigner {
namespace Internal {
QmlDesigner::PropertyName DynamicPropertiesModel::unusedProperty(const QmlDesigner::ModelNode &modelNode)
{
QmlDesigner::PropertyName propertyName = "property";
int i = 0;
if (modelNode.metaInfo().isValid()) {
while (true) {
const QmlDesigner::PropertyName currentPropertyName = propertyName + QString::number(i).toLatin1();
if (!modelNode.hasProperty(currentPropertyName) && !modelNode.metaInfo().hasProperty(currentPropertyName))
return currentPropertyName;
i++;
}
}
return propertyName;
}
DynamicPropertiesModel::DynamicPropertiesModel(ConnectionView *parent)
: QStandardItemModel(parent)
, m_connectionView(parent)

View File

@@ -69,6 +69,8 @@ public:
BindingProperty replaceVariantWithBinding(const PropertyName &name, bool copyValue = false);
void resetProperty(const PropertyName &name);
QmlDesigner::PropertyName unusedProperty(const QmlDesigner::ModelNode &modelNode);
protected:
void addProperty(const QVariant &propertyValue,
const QString &propertyType,

View File

@@ -23,8 +23,6 @@
**
****************************************************************************/
#pragma once
#include <QColorDialog>
#include <utils/qtcassert.h>

View File

@@ -187,4 +187,3 @@ private:
QML_DECLARE_TYPE(PropertyEditorValue)
QML_DECLARE_TYPE(PropertyEditorNodeWrapper)
QML_DECLARE_TYPE(QQmlPropertyMap)

View File

@@ -105,6 +105,7 @@ public:
void disableStandardViews();
void enableStandardViews();
QList<AbstractView *> views() const;
private: // functions
Q_DISABLE_COPY(ViewManager)
@@ -122,7 +123,6 @@ private: // functions
void switchStateEditorViewToBaseState();
void switchStateEditorViewToSavedState();
QList<AbstractView *> views() const;
QList<AbstractView *> standardViews() const;
private: // variables

View File

@@ -255,6 +255,8 @@ void DesignModeWidget::setup()
// First get all navigation views
QList<Core::INavigationWidgetFactory *> factories = Core::INavigationWidgetFactory::allNavigationFactories();
QList<Core::Command*> viewCommands;
for (Core::INavigationWidgetFactory *factory : factories) {
Core::NavigationView navigationView;
navigationView.widget = nullptr;
@@ -304,7 +306,7 @@ void DesignModeWidget::setup()
actionToggle.withSuffix(uniqueId + "Widget"),
designContext);
command->setAttribute(Core::Command::CA_Hide);
mviews->addAction(command);
viewCommands.append(command);
}
}
@@ -327,7 +329,7 @@ void DesignModeWidget::setup()
actionToggle.withSuffix(widgetInfo.uniqueId + "Widget"),
designContext);
command->setAttribute(Core::Command::CA_Hide);
mviews->addAction(command);
viewCommands.append(command);
}
// Finally the output pane
@@ -347,12 +349,19 @@ void DesignModeWidget::setup()
actionToggle.withSuffix("OutputPaneWidget"),
designContext);
command->setAttribute(Core::Command::CA_Hide);
mviews->addAction(command);
viewCommands.append(command);
connect(outputPanePlaceholder, &Core::OutputPanePlaceHolder::visibilityChangeRequested,
m_outputPaneDockWidget, &ADS::DockWidget::toggleView);
}
std::sort(viewCommands.begin(), viewCommands.end(), [](Core::Command *first, Core::Command *second){
return first->description() < second->description();
});
for (Core::Command *command : viewCommands)
mviews->addAction(command);
// Create toolbars
auto toolBar = new QToolBar();

View File

@@ -107,7 +107,7 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent, Id id) : MakeStep(parent
cleanInstallRootAspect->setSettingsKey(CleanInstallRootAspectId);
cleanInstallRootAspect->setLabel(tr("Clean install root first:"),
BoolAspect::LabelPlacement::InExtraLabel);
cleanInstallRootAspect->setValue(false);
cleanInstallRootAspect->setValue(true);
const auto commandLineAspect = addAspect<StringAspect>();
commandLineAspect->setId(FullCommandLineAspectId);

View File

@@ -403,7 +403,7 @@ protected:
if (Symbol *s = klass->find(accept0)) {
if (Function *meth = s->type()->asFunctionType()) {
if (! meth->isPureVirtual()) {
for (const ClassOrNamespace *u : b->usings()) {
for (ClassOrNamespace *u : b->usings()) {
if (interfaces.contains(u)) {
// qDebug() << oo(klass->name()) << "implements" << oo(u->symbols().first()->name());
} else {