Merge remote-tracking branch 'origin/4.10'

Change-Id: Iaf27911e4e9fb762c1a24c84c458462bafe95728
This commit is contained in:
Tim Jenssen
2019-07-12 15:53:56 +02:00
126 changed files with 9456 additions and 6532 deletions

View File

@@ -20,6 +20,7 @@ imagedirs = ../images \
../../src/plugins/qmldesigner/components/formeditor \
../../src/plugins/qmldesigner/components/navigator \
../../src/plugins/qmldesigner/components/timelineeditor/images \
../../src/plugins/qmldesigner/qmlpreviewplugin/images \
../../src/plugins/scxmleditor/common/images \
../../src/plugins/texteditor/images \
../../src/plugins/valgrind/images

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -103,12 +103,12 @@
\image qtcreator-clang-tools.png "Clang-Tidy and Clazy view"
Select the link in the \uicontrol Location column to move to the location
where the issue appears in the code editor.
Double-click an issue to move to the location where the issue appears in
the code editor.
In the \uicontrol {Fixit Status} column, select issues that you want to
apply refactoring actions to, and then select \uicontrol {Apply Fixits}.
The status of the issues is updated in the \uicontrol {Fixit Status} column.
If a fixit exists for an issue, you can select the check box next to the
issue to schedule it for fixing. You can see the status of the issue by
hovering the mouse pointer over the icon next to the check box.
\section1 Configuring Clang Tools

View File

@@ -371,8 +371,12 @@
To search within the \uicontrol{Application Output} and \uicontrol{Compile Output}
panes, press \key {Ctrl+F} when the pane is active. Enter search criteria in
the \uicontrol Find field and click the left and right arrows to search down and
up in the pane. In these panes, you can also use the zoom buttons to increase and
decrease the text size of the output.
up in the pane.
To increase or decrease the output text size, select \inlineimage plus.png
(\uicontrol {Zoom In}) or \inlineimage minus.png
(\uicontrol {Zoom Out}), or press \key Ctrl++ or \key Ctrl+-. Zooming is
not supported in all output panes.
To filter the output, enter a string in the \uicontrol Filter field.
Filtering is not supported in all output panes.

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -33,7 +33,7 @@
\contentspage index.html
\previouspage creator-scxml.html
\page creator-building-running.html
\nextpage creator-building-targets.html
\nextpage creator-live-preview.html
\title Building and Running
@@ -46,6 +46,14 @@
running your project.
\list
\li \l {Previewing}
You can use the QML live preview to preview a QML file or an
entire Qt Quick application on the desktop, as well as on
Android and embedded Linux devices. The changes you make to
the UI are instantly visible to you in the preview.
\li \l{Building for Multiple Platforms}
\e {Build configurations} contain everything you need to compile

View File

@@ -256,6 +256,8 @@
For more information about creating Qt Quick projects, see
\l {Creating Qt Quick Projects}.
\include creator-python-project.qdocinc python project wizards
\section1 Adding Files to Projects
You can use wizards also to add individual files to your projects.
@@ -408,8 +410,6 @@
The above functions are also available in the context menu in the
\uicontrol Projects view.
\include creator-python-project.qdocinc python project wizards
\section2 Creating OpenGL Fragment and Vertex Shaders
Qt provides support for integration with OpenGL implementations on all

View File

@@ -269,9 +269,12 @@
To add a variable value to the environment, enter the variable name and
value, separated by the equals sign. For example, the following line
prepends \c /opt/bin to the existing PATH:
prepends the \c /opt/bin folder to the existing PATH:
\c {PATH=/opt/bin:${PATH}}
\list
\li On Windows: \c {PATH=C:\opt\bin;${PATH}}
\li On Linux: \c {PATH=/opt/bin:${PATH}}
\endlist
To add or remove several variables, place them on separate lines. The order
is important. If you remove a value on a line, you cannot refer to it on the

View File

@@ -42,22 +42,28 @@
use \c {.pyqtc} files, but we recommend that you choose \c{.pyproject} files
for new projects.
The Window wizard adds the following imports to the \c {main.py}
file to provide access to the QApplication and QMainWindow classes
in the Qt Widgets module:
The \uicontrol {Qt for Python - Window} wizard enables you to create a
Python source file for a new class that you can add to a Python project.
Specify the class name, base class, and and source file for the class.
\image qtcreator-python-wizard-app-window.png
The Window wizard adds the imports to the source file to provide
access to the QApplication and the base class you selected in the Qt
Widgets module:
\badcode
import sys
from PySide2.QtWidgets import QApplication, QMainWindow
from PySide2.QtWidgets import QApplication, QWidget
\endcode
The Window wizard also adds a \c MainWindow class that inherits from
QMainWindow:
The Window wizard also adds a main class with the specified name that
inherits from the specified base class:
\badcode
class MainWindow(QMainWindow):
class MyWidget(QWidget):
def __init__(self):
QMainWindow.__init__(self)
QWidget.__init__(self)
\endcode
Next, the Window wizard adds a main function, where it creates a
@@ -68,13 +74,12 @@
\badcode
if __name__ == "__main__":
app = QApplication([])
...
\endcode
Next, the Window wizard instantiates the \c MainWindow class and shows it:
\badcode
window = MainWindow()
window = MyWidget()
window.show()
...
\endcode
@@ -86,7 +91,7 @@
sys.exit(app.exec_())
\endcode
The Empty wizard adds similar code to the \c {main.py} file, but it does
The Empty wizard adds similar code to the source file, but it does
not add any classes, so you need to add and instantiate them yourself.
For examples of creating Qt for Python applications, see

View File

@@ -156,6 +156,11 @@
\endlist
\li \l{Building and Running}
\list
\li \l{Previewing}
\list
\li \l{Previewing on Desktop}
\li \l{Previewing on Devices}
\endlist
\li \l{Building for Multiple Platforms}
\li \l{Running on Multiple Platforms}
\li \l{Deploying to Devices}

View File

@@ -94,6 +94,7 @@
\row
\li \b {\l{Building and Running}}
\list
\li \l{Previewing}
\li \l{Building for Multiple Platforms}
\li \l{Running on Multiple Platforms}
\li \l{Deploying to Devices}

View File

@@ -34,7 +34,7 @@
\contentspage index.html
\previouspage creator-visual-editor.html
\page quick-projects.html
\nextpage creator-quick-ui-forms.html
\nextpage creator-using-qt-quick-designer.html
\title Creating Qt Quick Projects

View File

@@ -36,7 +36,7 @@
\previouspage creator-modes.html
\nextpage {Tutorials}
\else
\previouspage creator-quick-ui-forms.html
\previouspage quick-projects.html
\nextpage quick-components.html
\endif

View File

@@ -0,0 +1,70 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Design Studio documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
\contentspage {Qt Creator}
\previouspage creator-live-preview.html
\page creator-live-preview-desktop.html
\nextpage creator-live-preview-devices.html
\title Previewing on Desktop
To preview the currently active QML file on the desktop:
\list
\li Select \uicontrol Build > \uicontrol {QML Preview}.
\li Select the \inlineimage live_preview.png
(\uicontrol {Show Live Preview}) button.
\li Press \key {Alt+P}.
\endlist
\if defined(qtcreator)
\image qtcreator-live-preview.png
\else
\image studio-live-preview.png
\endif
To preview any QML file that belongs to the project, right-click the project
name in the \uicontrol Project tab in the \uicontrol Navigator, and select
\uicontrol {Preview file}.
To preview the whole UI, select \uicontrol {Show Live Preview}
when viewing the main QML UI file of the project.
To view the UI in different sizes, select the zooming level on the toolbar.
The frames-per-second (FPS) refresh rate of animations is displayed in the
\uicontrol FPS field.
\if defined(qtdesignstudio)
\section1 Selecting the Preview Tool
By default, the \c qmlscene utility is used for previewing. To use some
other tool, specify it in the \uicontrol {QML viewer} field in the run
settings of the project in the Projects mode.
\image studio-run-settings.png "Run settings"
\endif
*/

View File

@@ -0,0 +1,104 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Design Studio documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
\contentspage {Qt Creator}
\previouspage creator-live-preview-desktop.html
\page creator-live-preview-devices.html
\if defined(qtdesignstudio)
\nextpage studio-advanced.html
\else
\nextpage creator-building-targets.html
\endif
\title Previewing on Devices
\omit
To preview UIs on Android devices, you need to enable USB debugging on them
and connect them to your system with a USB cable.
\endomit
To preview UIs on embedded devices, you need to connect the devices to your
system with a USB cable, or a wired or wireless connection, depending on
the device, and configure connections to them. The necessary kits have been
predefined and you only need to enable them for your current project.
\e {Deploy configurations} handle the packaging and copying of the
necessary files to a location in a device where you want to run the
executable at.
To preview a UI on a device:
\list 1
\li In \uicontrol Projects > \uicontrol {Build & Run}, enable the kit
predefined for the device type (1).
\li Select the kit for the device in the kit selector (2).
\if defined(qtcreator)
\image qtcreator-live-preview-kit.png
\else
\image studio-kit-selector.png "Kit selector"
\endif
\li Select \uicontrol Build > \uicontrol {QML Preview} or
press \key {Alt+P}.
\endlist
\omit
\section2 Previewing on Android Devices
The USB debugging feature on Android devices enables creating connections
to the devices from \QDS and running the live preview utility on them.
Debugging is enabled in different ways on different Android devices.
Look for \uicontrol {USB Debugging} under \uicontrol {Developer Options}.
On some devices \uicontrol {Developer Options} is hidden and becomes visible
when you tap the \uicontrol {Build number} field in \uicontrol Settings >
\uicontrol About several times.
After you have enabled debugging, connect the Android device to the system
with a USB cable.
The first time you preview a UI on devices, the preview utility
is copied to them. This might take some time. Thereafter, previewing will
get faster, because only the UI files need to be copied to the
device.
\endomit
\section2 Previewing on Embedded Devices
You can preview UIs on embedded devices that are supported by
\l{Qt for Device Creation}. For a list of supported devices, see
\l{https://doc.qt.io/QtForDeviceCreation/qtee-supported-platforms.html#reference-target-devices}
{Reference Target Devices}.
You must configure the device as instructed in the
\l{https://doc.qt.io/QtForDeviceCreation/b2qt-installation-guides.html}
{Installation Guides}.
\note At the time of this writing, \macos is not supported as a development
host for Qt for Device Creation. This means that you cannot preview UIs on
devices if you are using \QDS on \macos. For more information about
supported development hosts, see
\l {https://doc.qt.io/QtForDeviceCreation/qtdc-supported-platforms.html}
{Supported Development Hosts}.
*/

View File

@@ -0,0 +1,66 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Design Studio documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
\contentspage {Qt Creator}
\if defined(qtdesignstudio)
\previouspage creator-quick-ui-forms.html
\else
\previouspage creator-building-running.html
\endif
\page creator-live-preview.html
\nextpage creator-live-preview-desktop.html
\title Previewing
You can use the QML live preview to preview a QML file or the entire
UI on the desktop, as well as on Android and embedded Linux
devices. The changes you make to the UI are instantly visible
to you in the preview.
\if defined(qtcreator)
\image qtcreator-live-preview.png
\else
\image studio-live-preview.png
\endif
\list
\li \l{Previewing on Desktop}
You can preview individual QML files or the whole UI in the
Design mode.
\li \l{Previewing on Devices}
\if defined(qtcreator)
You can preview Qt Quick applications on devices that you have
connected to the development PC. For more information, see
\l {Connecting Devices}.
\else
When you install \QDS, everything you need for previewing on
devices is set up automatically. You only need to connect your
devices to your system.
\endif
\endlist
*/

View File

@@ -50,6 +50,16 @@
then select \uicontrol Reset to remove the property values before trying
again.
To modify the common properties of multiple items simultaneously, select
them in the \uicontrol Navigator or on the canvas:
\list
\li On Windows, press and hold \key Ctrl and \key Shift, and then click
the items to select them.
\li On \macos, press \key Shift to select a range of items or \key Cmd
to select multiple single items.
\endlist
To return an item to its implicit position after moving it, select the
\inlineimage qtcreator-reset-position-icon.png
(\uicontrol {Reset Position}) button on the toolbar. To return it to its

View File

@@ -35,7 +35,7 @@
\page creator-quick-ui-forms.html
\if defined(qtdesignstudio)
\previouspage qmldesigner-pathview-editor.html
\nextpage studio-live-preview.html
\nextpage creator-live-preview.html
\else
\previouspage qtquick-iso-icon-browser.html
\nextpage quick-export-to-qml.html

View File

@@ -263,7 +263,10 @@
\li Show the changes in a branch.
\row
\li \uicontrol Reset
\li Hard reset the active branch to the selected branch.
\li Reset the active branch to the selected branch. You
can choose between a \uicontrol Hard, \uicontrol Mixed,
and \uicontrol Soft reset. For more information, see
\l{Resetting Local Repository}.
\row
\li \uicontrol Merge
\li Join the development histories in two branches together.

View File

@@ -3,8 +3,15 @@ import qbs.FileInfo
Module {
Depends { name: "qtc" }
Depends { name: "cpp" }
property bool priority: 1 // TODO: Remove declaration after 1.11 is out.
Properties {
condition: qbs.toolchain.contains("gcc") && !qbs.toolchain.contains("clang")
&& Utilities.versionCompare(cpp.compilerVersion, "9") >= 0
cpp.cxxFlags: ["-Wno-deprecated-copy", "-Wno-init-list-lifetime"]
}
priority: 1
property bool enableUnitTests: false
property bool enableProjectFileUpdates: true

View File

@@ -77,7 +77,8 @@ source_include_patterns = [
r"^src/plugins/help/images/.*$",
r"^src/plugins/projectexplorer/images/.*$",
r"^src/plugins/qmldesigner/components/componentcore/images/.*$",
r"^src/plugins/qmldesigner/qmldesignerextension/timelineeditor/images/.*$",
r"^src/plugins/qmldesigner/components/timelineeditor/images/.*$",
r"^src/plugins/qmldesigner/qmlpreviewplugin/images/.*$",
r"^src/plugins/texteditor/images/.*$"
# also some single files
r"^src/plugins/qmldesigner/components/formeditor/.*\.png$",

View File

@@ -150,9 +150,9 @@ def main():
process = subprocess.Popen([arguments.tidypath, '-checks=*', '-list-checks'], stdout=subprocess.PIPE)
lines = process.stdout.read().splitlines()
lines.pop(0) # 'Enabled checks:'
major_checks = ['android-', 'boost-', 'bugprone-', 'cert-', 'clang-analyzer-',
major_checks = ['abseil-', 'android-', 'boost-', 'bugprone-', 'cert-', 'clang-analyzer-',
'cppcoreguidelines-', 'fuchsia-', 'google-', 'hicpp-', 'llvm-', 'misc-', 'modernize-',
'mpi-', 'objc-', 'performance-', 'readability-']
'mpi-', 'objc-', 'performance-', 'portability-', 'readability-', 'zircon-']
current_major = 0
major_groups = {}
for line in lines:

View File

@@ -453,6 +453,14 @@ class Dumper(DumperBase):
self.put('],partial="%d"' % (len(self.partialVariable) > 0))
self.put(',timings=%s' % self.timings)
if self.forceQtNamespace:
self.qtNamespaceToReport = self.qtNamespace()
if self.qtNamespaceToReport:
self.output += ',qtnamespace="%s"' % self.qtNamespaceToReport
self.qtNamespaceToReport = None
self.reportResult(self.output, args)
def report(self, stuff):

View File

@@ -49,6 +49,9 @@ Item {
StudioControls.RealSpinBox {
id: spinBox
onDragStarted: hideCursor();
onDragEnded: restoreCursor();
property bool hasSlider: spinBox.sliderIndicatorVisible
width: wrapper.width

View File

@@ -40,13 +40,21 @@ T.SpinBox {
property int decimals: 0
property real minStepSize: 1
property real maxStepSize: 10
property real minStepSize: {
var tmpMinStepSize = Number((mySpinBox.realStepSize * 0.1).toFixed(mySpinBox.decimals))
return (tmpMinStepSize) ? tmpMinStepSize : mySpinBox.realStepSize
}
property real maxStepSize: {
var tmpMaxStepSize = Number((mySpinBox.realStepSize * 10.0).toFixed(mySpinBox.decimals))
return (tmpMaxStepSize < mySpinBox.realTo) ? tmpMaxStepSize : mySpinBox.realStepSize
}
property bool edit: spinBoxInput.activeFocus
property bool hover: false // This property is used to indicate the global hover state
property bool drag: false
property real realDragRange: realTo - realFrom
property alias actionIndicatorVisible: actionIndicator.visible
property real __actionIndicatorWidth: StudioTheme.Values.squareComponentWidth
property real __actionIndicatorHeight: StudioTheme.Values.height
@@ -246,11 +254,10 @@ T.SpinBox {
onRealValueChanged: {
spinBoxInput.text = mySpinBox.textFromValue(mySpinBox.realValue, mySpinBox.locale)
mySpinBox.value = 0 // Without setting value back to 0, it can occur that one of
mySpinBox.value = 0 // Without setting value back to 0, it can happen that one of
// the indicator will be disabled due to range logic.
}
onRealValueModified: myTimer.restart()
onFocusChanged: mySpinBox.setValueFromInput()
onDisplayTextChanged: spinBoxInput.text = mySpinBox.displayText
onActiveFocusChanged: {
@@ -269,7 +276,7 @@ T.SpinBox {
// Store current step size
var currStepSize = mySpinBox.realStepSize
// Set stepSize according to used modifier key
// Set realStepSize according to used modifier key
if (event.modifiers & Qt.ControlModifier)
mySpinBox.realStepSize = mySpinBox.minStepSize
@@ -281,7 +288,7 @@ T.SpinBox {
else
mySpinBox.realDecrease()
// Reset step size
// Reset realStepSize
mySpinBox.realStepSize = currStepSize
}

View File

@@ -76,28 +76,56 @@ TextInput {
acceptedDevices: PointerDevice.Mouse
enabled: true
property real initialValue: 0
property real initialValue: myControl.realValue
property real multiplier: 1.0
onActiveChanged: {
if (dragHandler.active) {
dragHandler.initialValue = myControl.realValue
mouseArea.cursorShape = Qt.ClosedHandCursor
mouseArea.cursorShape = Qt.ClosedHandCursor // TODO
myControl.drag = true
myControl.dragStarted()
// Force focus on the non visible component to receive key events
dragModifierWorkaround.forceActiveFocus()
} else {
mouseArea.cursorShape = Qt.PointingHandCursor
mouseArea.cursorShape = Qt.PointingHandCursor // TODO
myControl.drag = false
myControl.dragEnded()
// Avoid active focus on the component after dragging
dragModifierWorkaround.focus = false
textInput.focus = false
myControl.focus = false
}
}
onTranslationChanged: {
onTranslationChanged: calcValue()
onMultiplierChanged: calcValue()
function calcValue() {
var tmp = myControl.realDragRange / StudioTheme.Values.dragLength
var currValue = myControl.realValue
myControl.setRealValue(dragHandler.initialValue + (translation.x * myControl.realStepSize))
myControl.setRealValue(dragHandler.initialValue + (tmp * dragHandler.translation.x * dragHandler.multiplier))
if (currValue !== myControl.realValue)
myControl.realValueModified()
}
}
Item {
id: dragModifierWorkaround
Keys.onPressed: {
event.accepted = true
if (event.modifiers & Qt.ControlModifier)
dragHandler.multiplier = 0.1
if (event.modifiers & Qt.ShiftModifier)
dragHandler.multiplier = 10.0
}
Keys.onReleased: {
event.accepted = true
dragHandler.multiplier = 1.0
}
}
TapHandler {
id: tapHandler
acceptedDevices: PointerDevice.Mouse
@@ -110,6 +138,9 @@ TextInput {
MouseArea {
id: mouseArea
property real stepSize: myControl.realStepSize
anchors.fill: parent
enabled: true
hoverEnabled: true
@@ -123,12 +154,22 @@ TextInput {
if (!myControl.__wheelEnabled)
return
// Set stepSize according to used modifier key
if (wheel.modifiers & Qt.ControlModifier)
mouseArea.stepSize = myControl.minStepSize
if (wheel.modifiers & Qt.ShiftModifier)
mouseArea.stepSize = myControl.maxStepSize
var currValue = myControl.realValue
myControl.valueFromText(textInput.text, myControl.locale)
myControl.setRealValue(myControl.realValue + (wheel.angleDelta.y / 120.0 * myControl.realStepSize))
myControl.setRealValue(myControl.realValue + (wheel.angleDelta.y / 120.0 * mouseArea.stepSize))
if (currValue !== myControl.realValue)
myControl.realValueModified()
// Reset stepSize
mouseArea.stepSize = myControl.realStepSize
}
}
@@ -166,7 +207,7 @@ TextInput {
},
State {
name: "edit"
when: textInput.edit
when: textInput.edit && !myControl.drag
PropertyChanges {
target: textInputArea
color: StudioTheme.Values.themeFocusEdit

View File

@@ -49,6 +49,7 @@ QtObject {
property real sliderControlSize: 12
property real sliderControlSizeMulti: values.sliderControlSize * values.scaleFactor
property int dragLength: 400 // px
property real spinControlIconSize: 8
property real spinControlIconSizeMulti: values.spinControlIconSize * values.scaleFactor

File diff suppressed because it is too large Load Diff

View File

@@ -123,9 +123,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.26.0"
#define SQLITE_VERSION_NUMBER 3026000
#define SQLITE_SOURCE_ID "2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9"
#define SQLITE_VERSION "3.28.0"
#define SQLITE_VERSION_NUMBER 3028000
#define SQLITE_SOURCE_ID "2019-04-16 19:49:53 884b4b7e502b4e991677b53971277adfaf0a04a284f8e483e2553d0f83156b50"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -189,6 +189,9 @@ SQLITE_API int sqlite3_libversion_number(void);
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
SQLITE_API int sqlite3_compileoption_used(const char *zOptName);
SQLITE_API const char *sqlite3_compileoption_get(int N);
#else
# define sqlite3_compileoption_used(X) 0
# define sqlite3_compileoption_get(X) ((void*)0)
#endif
/*
@@ -823,6 +826,15 @@ struct sqlite3_io_methods {
** file space based on this hint in order to help writes to the database
** file run faster.
**
** <li>[[SQLITE_FCNTL_SIZE_LIMIT]]
** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that
** implements [sqlite3_deserialize()] to set an upper bound on the size
** of the in-memory database. The argument is a pointer to a [sqlite3_int64].
** If the integer pointed to is negative, then it is filled in with the
** current limit. Otherwise the limit is set to the larger of the value
** of the integer pointed to and the current database size. The integer
** pointed to is set to the new limit.
**
** <li>[[SQLITE_FCNTL_CHUNK_SIZE]]
** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
** extends and truncates the database file in chunks of a size specified
@@ -1131,6 +1143,7 @@ struct sqlite3_io_methods {
#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
#define SQLITE_FCNTL_LOCK_TIMEOUT 34
#define SQLITE_FCNTL_DATA_VERSION 35
#define SQLITE_FCNTL_SIZE_LIMIT 36
/* deprecated names */
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
@@ -1972,6 +1985,17 @@ struct sqlite3_mem_methods {
** negative value for this option restores the default behaviour.
** This option is only available if SQLite is compiled with the
** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option.
**
** [[SQLITE_CONFIG_MEMDB_MAXSIZE]]
** <dt>SQLITE_CONFIG_MEMDB_MAXSIZE
** <dd>The SQLITE_CONFIG_MEMDB_MAXSIZE option accepts a single parameter
** [sqlite3_int64] parameter which is the default maximum size for an in-memory
** database created using [sqlite3_deserialize()]. This default maximum
** size can be adjusted up or down for individual databases using the
** [SQLITE_FCNTL_SIZE_LIMIT] [sqlite3_file_control|file-control]. If this
** configuration setting is never used, then the default maximum is determined
** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option. If that
** compile-time option is not set, then the default maximum is 1073741824.
** </dl>
*/
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -2002,6 +2026,7 @@ struct sqlite3_mem_methods {
#define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */
#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
#define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */
/*
** CAPI3REF: Database Connection Configuration Options
@@ -2064,8 +2089,8 @@ struct sqlite3_mem_methods {
**
** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
** <dd> ^This option is used to enable or disable the two-argument
** version of the [fts3_tokenizer()] function which is part of the
** <dd> ^This option is used to enable or disable the
** [fts3_tokenizer()] function which is part of the
** [FTS3] full-text search engine extension.
** There should be two additional arguments.
** The first argument is an integer which is 0 to disable fts3_tokenizer() or
@@ -2177,6 +2202,17 @@ struct sqlite3_mem_methods {
** <li> Direct writes to [shadow tables].
** </ul>
** </dd>
**
** [[SQLITE_DBCONFIG_WRITABLE_SCHEMA]] <dt>SQLITE_DBCONFIG_WRITABLE_SCHEMA</dt>
** <dd>The SQLITE_DBCONFIG_WRITABLE_SCHEMA option activates or deactivates the
** "writable_schema" flag. This has the same effect and is logically equivalent
** to setting [PRAGMA writable_schema=ON] or [PRAGMA writable_schema=OFF].
** The first argument to this setting is an integer which is 0 to disable
** the writable_schema, positive to enable writable_schema, or negative to
** leave the setting unchanged. The second parameter is a pointer to an
** integer into which is written 0 or 1 to indicate whether the writable_schema
** is enabled or disabled following this call.
** </dd>
** </dl>
*/
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
@@ -2190,7 +2226,8 @@ struct sqlite3_mem_methods {
#define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */
#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */
#define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */
#define SQLITE_DBCONFIG_MAX 1010 /* Largest DBCONFIG */
#define SQLITE_DBCONFIG_WRITABLE_SCHEMA 1011 /* int int* */
#define SQLITE_DBCONFIG_MAX 1011 /* Largest DBCONFIG */
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
@@ -2347,7 +2384,7 @@ SQLITE_API int sqlite3_changes(sqlite3*);
** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
** are not counted.
**
** This the [sqlite3_total_changes(D)] interface only reports the number
** The [sqlite3_total_changes(D)] interface only reports the number
** of rows that changed due to SQL statement run against database
** connection D. Any changes by other database connections are ignored.
** To detect changes against a database file from other database
@@ -2991,9 +3028,9 @@ SQLITE_API int sqlite3_set_authorizer(
** time is in units of nanoseconds, however the current implementation
** is only capable of millisecond resolution so the six least significant
** digits in the time are meaningless. Future versions of SQLite
** might provide greater resolution on the profiler callback. The
** sqlite3_profile() function is considered experimental and is
** subject to change in future versions of SQLite.
** might provide greater resolution on the profiler callback. Invoking
** either [sqlite3_trace()] or [sqlite3_trace_v2()] will cancel the
** profile callback.
*/
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*,
void(*xTrace)(void*,const char*), void*);
@@ -3407,6 +3444,8 @@ SQLITE_API int sqlite3_open_v2(
** is not a database file pathname pointer that SQLite passed into the xOpen
** VFS method, then the behavior of this routine is undefined and probably
** undesirable.
**
** See the [URI filename] documentation for additional information.
*/
SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
@@ -3629,18 +3668,23 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
** deplete the limited store of lookaside memory. Future versions of
** SQLite may act on this hint differently.
**
** [[SQLITE_PREPARE_NORMALIZE]] ^(<dt>SQLITE_PREPARE_NORMALIZE</dt>
** <dd>The SQLITE_PREPARE_NORMALIZE flag indicates that a normalized
** representation of the SQL statement should be calculated and then
** associated with the prepared statement, which can be obtained via
** the [sqlite3_normalized_sql()] interface.)^ The semantics used to
** normalize a SQL statement are unspecified and subject to change.
** At a minimum, literal values will be replaced with suitable
** placeholders.
** [[SQLITE_PREPARE_NORMALIZE]] <dt>SQLITE_PREPARE_NORMALIZE</dt>
** <dd>The SQLITE_PREPARE_NORMALIZE flag is a no-op. This flag used
** to be required for any prepared statement that wanted to use the
** [sqlite3_normalized_sql()] interface. However, the
** [sqlite3_normalized_sql()] interface is now available to all
** prepared statements, regardless of whether or not they use this
** flag.
**
** [[SQLITE_PREPARE_NO_VTAB]] <dt>SQLITE_PREPARE_NO_VTAB</dt>
** <dd>The SQLITE_PREPARE_NO_VTAB flag causes the SQL compiler
** to return an error (error code SQLITE_ERROR) if the statement uses
** any virtual tables.
** </dl>
*/
#define SQLITE_PREPARE_PERSISTENT 0x01
#define SQLITE_PREPARE_NORMALIZE 0x02
#define SQLITE_PREPARE_NO_VTAB 0x04
/*
** CAPI3REF: Compiling An SQL Statement
@@ -3865,6 +3909,18 @@ SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt);
*/
SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
/*
** CAPI3REF: Query The EXPLAIN Setting For A Prepared Statement
** METHOD: sqlite3_stmt
**
** ^The sqlite3_stmt_isexplain(S) interface returns 1 if the
** prepared statement S is an EXPLAIN statement, or 2 if the
** statement S is an EXPLAIN QUERY PLAN.
** ^The sqlite3_stmt_isexplain(S) interface returns 0 if S is
** an ordinary statement or a NULL pointer.
*/
SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt);
/*
** CAPI3REF: Determine If A Prepared Statement Has Been Reset
** METHOD: sqlite3_stmt
@@ -4004,7 +4060,9 @@ typedef struct sqlite3_context sqlite3_context;
** ^The fifth argument to the BLOB and string binding interfaces
** is a destructor used to dispose of the BLOB or
** string after SQLite has finished with it. ^The destructor is called
** to dispose of the BLOB or string even if the call to bind API fails.
** to dispose of the BLOB or string even if the call to the bind API fails,
** except the destructor is not called if the third parameter is a NULL
** pointer or the fourth parameter is negative.
** ^If the fifth argument is
** the special value [SQLITE_STATIC], then SQLite assumes that the
** information is in static, unmanaged space and does not need to be freed.
@@ -4921,6 +4979,8 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
** <tr><td><b>sqlite3_value_nochange&nbsp;&nbsp;</b>
** <td>&rarr;&nbsp;&nbsp;<td>True if the column is unchanged in an UPDATE
** against a virtual table.
** <tr><td><b>sqlite3_value_frombind&nbsp;&nbsp;</b>
** <td>&rarr;&nbsp;&nbsp;<td>True if value originated from a [bound parameter]
** </table></blockquote>
**
** <b>Details:</b>
@@ -4982,6 +5042,11 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
** than within an [xUpdate] method call for an UPDATE statement, then
** the return value is arbitrary and meaningless.
**
** ^The sqlite3_value_frombind(X) interface returns non-zero if the
** value X originated from one of the [sqlite3_bind_int|sqlite3_bind()]
** interfaces. ^If X comes from an SQL literal value, or a table column,
** and expression, then sqlite3_value_frombind(X) returns zero.
**
** Please pay particular attention to the fact that the pointer returned
** from [sqlite3_value_blob()], [sqlite3_value_text()], or
** [sqlite3_value_text16()] can be invalidated by a subsequent call to
@@ -5027,6 +5092,7 @@ SQLITE_API int sqlite3_value_bytes16(sqlite3_value*);
SQLITE_API int sqlite3_value_type(sqlite3_value*);
SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
SQLITE_API int sqlite3_value_nochange(sqlite3_value*);
SQLITE_API int sqlite3_value_frombind(sqlite3_value*);
/*
** CAPI3REF: Finding The Subtype Of SQL Values
@@ -5762,7 +5828,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*);
** associated with database N of connection D. ^The main database file
** has the name "main". If there is no attached database N on the database
** connection D, or if database N is a temporary or in-memory database, then
** a NULL pointer is returned.
** this function will return either a NULL pointer or an empty string.
**
** ^The filename returned by this function is the output of the
** xFullPathname method of the [VFS]. ^In other words, the filename
@@ -9996,7 +10062,7 @@ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter);
** sqlite3changeset_next() is called on the iterator or until the
** conflict-handler function returns. If pnCol is not NULL, then *pnCol is
** set to the number of columns in the table affected by the change. If
** pbIncorrect is not NULL, then *pbIndirect is set to true (1) if the change
** pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change
** is an indirect change, or false (0) otherwise. See the documentation for
** [sqlite3session_indirect()] for a description of direct and indirect
** changes. Finally, if pOp is not NULL, then *pOp is set to one of
@@ -10863,7 +10929,7 @@ SQLITE_API int sqlite3rebaser_configure(
** in size. This function allocates and populates a buffer with a copy
** of the changeset rebased rebased according to the configuration of the
** rebaser object passed as the first argument. If successful, (*ppOut)
** is set to point to the new buffer containing the rebased changset and
** is set to point to the new buffer containing the rebased changeset and
** (*pnOut) to its size in bytes and SQLITE_OK returned. It is the
** responsibility of the caller to eventually free the new buffer using
** sqlite3_free(). Otherwise, if an error occurs, (*ppOut) and (*pnOut)
@@ -11230,12 +11296,8 @@ struct Fts5PhraseIter {
**
** Usually, output parameter *piPhrase is set to the phrase number, *piCol
** to the column in which it occurs and *piOff the token offset of the
** first token of the phrase. The exception is if the table was created
** with the offsets=0 option specified. In this case *piOff is always
** set to -1.
**
** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM)
** if an error occurs.
** first token of the phrase. Returns SQLITE_OK if successful, or an error
** code (i.e. SQLITE_NOMEM) if an error occurs.
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option.
@@ -11276,7 +11338,7 @@ struct Fts5PhraseIter {
** Save the pointer passed as the second argument as the extension functions
** "auxiliary data". The pointer may then be retrieved by the current or any
** future invocation of the same fts5 extension function made as part of
** of the same MATCH query using the xGetAuxdata() API.
** the same MATCH query using the xGetAuxdata() API.
**
** Each extension function is allocated a single auxiliary data slot for
** each FTS query (MATCH expression). If the extension function is invoked
@@ -11291,7 +11353,7 @@ struct Fts5PhraseIter {
** The xDelete callback, if one is specified, is also invoked on the
** auxiliary data pointer after the FTS5 query has finished.
**
** If an error (e.g. an OOM condition) occurs within this function, an
** If an error (e.g. an OOM condition) occurs within this function,
** the auxiliary data is set to NULL and an error code returned. If the
** xDelete parameter was not NULL, it is invoked on the auxiliary data
** pointer before returning.
@@ -11524,11 +11586,11 @@ struct Fts5ExtensionApi {
** the tokenizer substitutes "first" for "1st" and the query works
** as expected.
**
** <li> By adding multiple synonyms for a single term to the FTS index.
** In this case, when tokenizing query text, the tokenizer may
** provide multiple synonyms for a single term within the document.
** FTS5 then queries the index for each synonym individually. For
** example, faced with the query:
** <li> By querying the index for all synonyms of each query term
** separately. In this case, when tokenizing query text, the
** tokenizer may provide multiple synonyms for a single term
** within the document. FTS5 then queries the index for each
** synonym individually. For example, faced with the query:
**
** <codeblock>
** ... MATCH 'first place'</codeblock>
@@ -11552,7 +11614,7 @@ struct Fts5ExtensionApi {
** "place".
**
** This way, even if the tokenizer does not provide synonyms
** when tokenizing query text (it should not - to do would be
** when tokenizing query text (it should not - to do so would be
** inefficient), it doesn't matter if the user queries for
** 'first + place' or '1st + place', as there are entries in the
** FTS index corresponding to both forms of the first token.

View File

@@ -319,6 +319,9 @@ struct sqlite3_api_routines {
void(*xDestroy)(void*));
/* Version 3.26.0 and later */
const char *(*normalized_sql)(sqlite3_stmt*);
/* Version 3.28.0 and later */
int (*stmt_isexplain)(sqlite3_stmt*);
int (*value_frombind)(sqlite3_value*);
};
/*
@@ -608,6 +611,9 @@ typedef int (*sqlite3_loadext_entry)(
#define sqlite3_create_window_function sqlite3_api->create_window_function
/* Version 3.26.0 and later */
#define sqlite3_normalized_sql sqlite3_api->normalized_sql
/* Version 3.28.0 and later */
#define sqlite3_stmt_isexplain sqlite3_api->isexplain
#define sqlite3_value_frombind sqlite3_api->frombind
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)

View File

@@ -113,7 +113,6 @@ add_qtc_library(ClangSupport
requestcompletionsmessage.cpp requestcompletionsmessage.h
requestfollowsymbolmessage.cpp requestfollowsymbolmessage.h
requestreferencesmessage.cpp requestreferencesmessage.h
requestsourcelocationforrenamingmessage.cpp requestsourcelocationforrenamingmessage.h
requestsourcerangesanddiagnosticsforquerymessage.cpp requestsourcerangesanddiagnosticsforquerymessage.h
requestsourcerangesforquerymessage.cpp requestsourcerangesforquerymessage.h
requesttooltipmessage.cpp requesttooltipmessage.h
@@ -121,7 +120,6 @@ add_qtc_library(ClangSupport
sourcelocationcontainer.cpp sourcelocationcontainer.h
sourcelocationcontainerv2.cpp sourcelocationcontainerv2.h
sourcelocationscontainer.cpp sourcelocationscontainer.h
sourcelocationsforrenamingmessage.cpp sourcelocationsforrenamingmessage.h
sourcerangecontainer.cpp sourcerangecontainer.h
sourcerangecontainerv2.cpp sourcerangecontainerv2.h
sourcerangesanddiagnosticsforquerymessage.cpp sourcerangesanddiagnosticsforquerymessage.h

View File

@@ -38,7 +38,6 @@ QDebug operator<<(QDebug debug, const RequestCompletionsMessage &message)
debug.nospace() << message.filePath << ", ";
debug.nospace() << message.line << ", ";
debug.nospace() << message.column << ", ";
debug.nospace() << message.projectPartId << ", ";
debug.nospace() << message.ticketNumber;
debug.nospace() << message.funcNameStartLine << ", ";
debug.nospace() << message.funcNameStartColumn << ", ";

View File

@@ -88,7 +88,6 @@ public:
public:
Utf8String filePath;
Utf8String projectPartId;
static CLANGSUPPORT_EXPORT quint64 ticketCounter;
quint64 ticketNumber = 0;
quint32 line = 0;

View File

@@ -130,6 +130,7 @@ void QmlDebugConnectionManager::startLocalServer()
if (!m_connection || ++(m_numRetries) >= m_maximumRetries) {
stopConnectionTimer();
destroyConnection();
emit connectionFailed();
}
});
@@ -145,10 +146,10 @@ void QmlDebugConnectionManager::startLocalServer()
void QmlDebugConnectionManager::retryConnect()
{
destroyConnection();
if (m_server.scheme() == Utils::urlSocketScheme()) {
startLocalServer();
} else if (m_server.scheme() == Utils::urlTcpScheme()) {
destroyConnection();
connectToTcpServer();
} else {
emit connectionFailed();

View File

@@ -92,7 +92,7 @@ SimpleReaderNode::Ptr SimpleReaderNode::create(const QString &name, WeakPtr pare
Ptr newNode(new SimpleReaderNode(name, parent));
newNode->m_weakThis = newNode;
if (parent)
parent.data()->m_children.append(newNode);
parent.toStrongRef().data()->m_children.append(newNode);
return newNode;
}
@@ -323,21 +323,21 @@ void SimpleReader::elementEnd()
{
Q_ASSERT(m_currentNode);
qCDebug(simpleReaderLog) << "elementEnd()" << m_currentNode.data()->name();
qCDebug(simpleReaderLog) << "elementEnd()" << m_currentNode.toStrongRef().data()->name();
m_currentNode = m_currentNode.data()->parent();
m_currentNode = m_currentNode.toStrongRef().data()->parent();
}
void SimpleReader::propertyDefinition(const QString &name, const QVariant &value)
{
Q_ASSERT(m_currentNode);
qCDebug(simpleReaderLog) << "propertyDefinition()" << m_currentNode.data()->name() << name << value;
qCDebug(simpleReaderLog) << "propertyDefinition()" << m_currentNode.toStrongRef().data()->name() << name << value;
if (m_currentNode.data()->propertyNames().contains(name))
if (m_currentNode.toStrongRef().data()->propertyNames().contains(name))
addError(tr("Property is defined twice."), currentSourceLocation());
m_currentNode.data()->setProperty(name, value);
m_currentNode.toStrongRef().data()->setProperty(name, value);
}
} // namespace QmlJS

View File

@@ -25,10 +25,10 @@
#include "sqlitedatabasebackend.h"
#include "sqlitebasestatement.h"
#include "sqliteexception.h"
#include "sqlitereadstatement.h"
#include "sqlitereadwritestatement.h"
#include "sqlitebasestatement.h"
#include "sqlitewritestatement.h"
#include <QFileInfo>
@@ -177,8 +177,12 @@ void DatabaseBackend::setLastInsertedRowId(int64_t rowId)
void DatabaseBackend::execute(Utils::SmallStringView sqlStatement)
{
ReadWriteStatement statement(sqlStatement, m_database);
statement.execute();
try {
ReadWriteStatement statement(sqlStatement, m_database);
statement.execute();
} catch (StatementIsBusy &) {
execute(sqlStatement);
}
}
void DatabaseBackend::close()
@@ -217,14 +221,14 @@ void DatabaseBackend::registerBusyHandler()
void DatabaseBackend::registerRankingFunction()
{
sqlite3_create_function_v2(sqliteDatabaseHandle(), "okapi_bm25", -1, SQLITE_ANY, 0, okapi_bm25, 0, 0, 0);
sqlite3_create_function_v2(sqliteDatabaseHandle(), "okapi_bm25f", -1, SQLITE_UTF8, 0, okapi_bm25f, 0, 0, 0);
sqlite3_create_function_v2(sqliteDatabaseHandle(), "okapi_bm25f_kb", -1, SQLITE_UTF8, 0, okapi_bm25f_kb, 0, 0, 0);
// sqlite3_create_function_v2(sqliteDatabaseHandle(), "okapi_bm25", -1, SQLITE_ANY, 0, okapi_bm25, 0, 0, 0);
// sqlite3_create_function_v2(sqliteDatabaseHandle(), "okapi_bm25f", -1, SQLITE_UTF8, 0, okapi_bm25f, 0, 0, 0);
// sqlite3_create_function_v2(sqliteDatabaseHandle(), "okapi_bm25f_kb", -1, SQLITE_UTF8, 0, okapi_bm25f_kb, 0, 0, 0);
}
int DatabaseBackend::busyHandlerCallback(void *, int counter)
{
Q_UNUSED(counter);
Q_UNUSED(counter)
#ifdef QT_DEBUG
//qWarning() << "Busy handler invoked" << counter << "times!";
#endif
@@ -453,11 +457,15 @@ void DatabaseBackend::throwDatabaseIsNotOpen(const char *whatHasHappens) const
template <typename Type>
Type DatabaseBackend::toValue(Utils::SmallStringView sqlStatement)
{
ReadWriteStatement statement(sqlStatement, m_database);
try {
ReadWriteStatement statement(sqlStatement, m_database);
statement.next();
statement.next();
return statement.fetchValue<Type>(0);
return statement.fetchValue<Type>(0);
} catch (StatementIsBusy &) {
return toValue<Type>(sqlStatement);
}
}
} // namespace Sqlite

View File

@@ -158,7 +158,6 @@ add_qtc_library(Utils
textutils.cpp textutils.h
theme/theme.cpp theme/theme.h theme/theme_p.h
tooltip/effects.h
tooltip/reuse.h
tooltip/tips.cpp tooltip/tips.h
tooltip/tooltip.cpp tooltip/tooltip.h
touchbar/touchbar.h

View File

@@ -1,55 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#pragma once
#include <utils/hostosinfo.h>
#include <QPoint>
#include <QRect>
#include <QWidget>
#include <QApplication>
#include <QDesktopWidget>
namespace Utils {
namespace Internal {
inline int screenNumber(const QPoint &pos, QWidget *w)
{
if (QApplication::desktop()->isVirtualDesktop())
return QApplication::desktop()->screenNumber(pos);
else
return QApplication::desktop()->screenNumber(w);
}
inline QRect screenGeometry(const QPoint &pos, QWidget *w)
{
if (HostOsInfo::isMacHost())
return QApplication::desktop()->availableGeometry(screenNumber(pos, w));
return QApplication::desktop()->screenGeometry(screenNumber(pos, w));
}
} // namespace Internal
} // namespace Utils

View File

@@ -25,8 +25,8 @@
#include "tips.h"
#include "tooltip.h"
#include "reuse.h"
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QRect>
@@ -43,6 +43,12 @@
#include <QPaintEvent>
#include <QVBoxLayout>
#include <QPoint>
#include <QRect>
#include <QWidget>
#include <QApplication>
#include <QDesktopWidget>
#include <memory>
namespace Utils {
@@ -287,5 +293,21 @@ bool WidgetTip::equals(int typeId, const QVariant &other, const QVariant &otherC
&& other.value<QWidget *>() == m_widget;
}
int screenNumber(const QPoint &pos, QWidget *w)
{
if (QApplication::desktop()->isVirtualDesktop())
return QApplication::desktop()->screenNumber(pos);
else
return QApplication::desktop()->screenNumber(w);
}
QRect screenGeometry(const QPoint &pos, QWidget *w)
{
if (HostOsInfo::isMacHost())
return QApplication::desktop()->availableGeometry(screenNumber(pos, w));
return QApplication::desktop()->screenGeometry(screenNumber(pos, w));
}
} // namespace Internal
} // namespace Utils

View File

@@ -36,6 +36,9 @@
namespace Utils {
namespace Internal {
int screenNumber(const QPoint &pos, QWidget *w);
QRect screenGeometry(const QPoint &pos, QWidget *w);
class TipLabel : public QLabel
{
public:

View File

@@ -26,21 +26,19 @@
#include "tooltip.h"
#include "tips.h"
#include "effects.h"
#include "reuse.h"
#include <utils/faketooltip.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
#include <QString>
#include <QApplication>
#include <QColor>
#include <QGuiApplication>
#include <QDebug>
#include <QDesktopWidget>
#include <QKeyEvent>
#include <QMenu>
#include <QMouseEvent>
#include <QWidget>
#include <QMenu>
#include <QDebug>
using namespace Utils;
using namespace Internal;
@@ -356,6 +354,7 @@ bool ToolTip::eventFilter(QObject *o, QEvent *event)
!m_rect.contains(static_cast<QMouseEvent*>(event)->pos())) {
hideTipWithDelay();
}
break;
default:
break;
}

View File

@@ -223,7 +223,6 @@ HEADERS += \
$$PWD/elidinglabel.h \
$$PWD/tooltip/tooltip.h \
$$PWD/tooltip/tips.h \
$$PWD/tooltip/reuse.h \
$$PWD/tooltip/effects.h \
$$PWD/unixutils.h \
$$PWD/ansiescapecodehandler.h \

View File

@@ -305,7 +305,6 @@ Project {
prefix: "tooltip/"
files: [
"effects.h",
"reuse.h",
"tips.cpp",
"tips.h",
"tooltip.cpp",

View File

@@ -110,7 +110,7 @@ void TestCodeParser::setState(State state)
m_partialUpdatePostponed = false;
qCDebug(LOG) << "calling scanForTests with postponed files (setState)";
if (!m_reparseTimer.isActive())
scanForTests(m_postponedFiles.toList());
scanForTests(Utils::toList(m_postponedFiles));
}
}
}
@@ -469,7 +469,7 @@ void TestCodeParser::onPartialParsingFinished()
m_partialUpdatePostponed = false;
qCDebug(LOG) << "calling scanForTests with postponed files (onPartialParsingFinished)";
if (!m_reparseTimer.isActive())
scanForTests(m_postponedFiles.toList());
scanForTests(Utils::toList(m_postponedFiles));
} else {
m_dirty |= m_codeModelParsing;
if (m_dirty) {
@@ -491,7 +491,7 @@ void TestCodeParser::onPartialParsingFinished()
void TestCodeParser::parsePostponedFiles()
{
m_reparseTimerTimedOut = true;
scanForTests(m_postponedFiles.toList());
scanForTests(Utils::toList(m_postponedFiles));
}
void TestCodeParser::releaseParserInternals()

View File

@@ -176,10 +176,13 @@ void TestRunner::scheduleNext()
tr("Executable path is empty. (%1)").arg(m_currentConfig->displayName()));
delete m_currentConfig;
m_currentConfig = nullptr;
if (m_selectedTests.isEmpty())
if (m_selectedTests.isEmpty()) {
if (m_fakeFutureInterface)
m_fakeFutureInterface->reportFinished();
onFinished();
else
} else {
onProcessFinished();
}
return;
}
if (!m_currentConfig->project())

View File

@@ -168,6 +168,7 @@ void ClangCompletionContextAnalyzer::handleFunctionCall(int afterOperatorPositio
} else {
const int functionNameStart = startOfFunctionCall(afterOperatorPosition);
if (functionNameStart >= 0) {
m_addSnippets = functionNameStart == afterOperatorPosition;
// Always pass the position right after '(' to libclang because
// positions after the comma might be problematic if a preceding
// argument is invalid code.

View File

@@ -50,6 +50,7 @@
#include <utils/qtcassert.h>
#include <QDebug>
#include <QElapsedTimer>
#include <QFileInfo>
#include <QLoggingCategory>
#include <QSharedPointer>
@@ -302,7 +303,7 @@ WaitForUpdatedCodeWarnings::WaitForUpdatedCodeWarnings(ClangEditorDocumentProces
bool WaitForUpdatedCodeWarnings::wait(int timeOutInMs) const
{
QTime time;
QElapsedTimer time;
time.start();
forever {
@@ -580,7 +581,7 @@ bool ProcessEventsCommand::run()
{
qCDebug(debug) << "line" << context().lineNumber << "ProcessEventsCommand" << m_durationInMs;
QTime time;
QElapsedTimer time;
time.start();
forever {

View File

@@ -226,7 +226,7 @@ bool OpenEditorAtCursorPosition::waitUntilProjectPartChanged(const QString &newP
bool OpenEditorAtCursorPosition::waitUntil(const std::function<bool ()> &condition, int timeout)
{
QTime time;
QElapsedTimer time;
time.start();
forever {
@@ -432,7 +432,7 @@ bool MonitorGeneratedUiFile::waitUntilGenerated(int timeout) const
if (m_isGenerated)
return true;
QTime time;
QElapsedTimer time;
time.start();
forever {
@@ -472,10 +472,10 @@ public:
{
QTC_ASSERT(writeFile(m_filePath, m_fileContents), return false);
QTime totalTime;
QElapsedTimer totalTime;
totalTime.start();
QTime writeFileAgainTime;
QElapsedTimer writeFileAgainTime;
writeFileAgainTime.start();
forever {

View File

@@ -6,11 +6,6 @@ include(../../shared/clang/clang_defines.pri)
requires(!isEmpty(CLANGFORMAT_LIBS))
win32 {
LLVM_BUILDMODE = $$system($$llvm_config --build-mode, lines)
CONFIG(debug, debug|release):requires(equals(LLVM_BUILDMODE, "Debug"))
}
LIBS += $$CLANGFORMAT_LIBS
INCLUDEPATH += $$LLVM_INCLUDEPATH

View File

@@ -197,13 +197,13 @@ static QString configForFile(Utils::FilePath fileName, bool checkForSettings)
{
QDir overrideDir;
if (!checkForSettings || useProjectOverriddenSettings()) {
overrideDir = projectPath().toString();
overrideDir.setPath(projectPath().toString());
if (!overrideDir.isEmpty() && overrideDir.exists(Constants::SETTINGS_FILE_NAME))
return overrideDir.filePath(Constants::SETTINGS_FILE_NAME);
}
if (!checkForSettings || useGlobalOverriddenSettings()) {
overrideDir = globalPath().toString();
overrideDir.setPath(globalPath().toString());
if (!overrideDir.isEmpty() && overrideDir.exists(Constants::SETTINGS_FILE_NAME))
return overrideDir.filePath(Constants::SETTINGS_FILE_NAME);
}

View File

@@ -6,11 +6,6 @@ include(../../shared/clang/clang_defines.pri)
requires(!isEmpty(LIBTOOLING_LIBS))
win32 {
LLVM_BUILDMODE = $$system($$llvm_config --build-mode, lines)
CONFIG(debug, debug|release):requires(equals(LLVM_BUILDMODE, "Debug"))
}
HEADERS += \
clangrefactoringplugin.h \
baseclangquerytexteditorwidget.h \

View File

@@ -464,11 +464,11 @@ void ClangTidyClazyTool::handleStateUpdate()
}
QList<Diagnostic> ClangTidyClazyTool::read(const QString &filePath,
const Utils::FilePath &projectRootDir,
const QSet<Utils::FilePath> &projectFiles,
const QString &logFilePath,
QString *errorMessage) const
{
return readSerializedDiagnostics(filePath, projectRootDir, logFilePath, errorMessage);
return readSerializedDiagnostics(filePath, projectFiles, logFilePath, errorMessage);
}
void ClangTidyClazyTool::onNewDiagnosticsAvailable(const QList<Diagnostic> &diagnostics)

View File

@@ -54,7 +54,7 @@ public:
void startTool(bool askUserForFileSelection) final;
QList<Diagnostic> read(const QString &filePath,
const Utils::FilePath &projectRootDir,
const QSet<Utils::FilePath> &projectFiles,
const QString &logFilePath,
QString *errorMessage) const final;

View File

@@ -50,7 +50,7 @@ public:
virtual void startTool(bool askUserForFileSelection) = 0;
virtual QList<Diagnostic> read(const QString &filePath,
const Utils::FilePath &projectRootDir,
const QSet<Utils::FilePath> &projectFiles,
const QString &logFilePath,
QString *errorMessage) const = 0;

View File

@@ -289,6 +289,7 @@ void ClangToolRunControl::start()
}
m_projectInfo = CppTools::CppModelManager::instance()->projectInfo(m_target->project());
m_projectFiles = Utils::toSet(m_target->project()->files(Project::AllFiles));
// Some projects provides CompilerCallData once a build is finished,
if (m_projectInfo.configurationOrFilesChanged(m_projectInfoBeforeBuild)) {
@@ -361,6 +362,7 @@ void ClangToolRunControl::stop()
QObject::disconnect(runner, nullptr, this, nullptr);
delete runner;
}
m_projectFiles.clear();
m_runners.clear();
m_unitsToProcess.clear();
m_progress.reportFinished();
@@ -390,22 +392,14 @@ void ClangToolRunControl::analyzeNextFile()
Utils::StdOutFormat);
}
static Utils::FilePath cleanPath(const Utils::FilePath &filePath)
{
return Utils::FilePath::fromString(QDir::cleanPath(filePath.toString()));
}
void ClangToolRunControl::onRunnerFinishedWithSuccess(const QString &filePath)
{
const QString logFilePath = qobject_cast<ClangToolRunner *>(sender())->logFilePath();
qCDebug(LOG) << "onRunnerFinishedWithSuccess:" << logFilePath;
QTC_ASSERT(m_projectInfo.project(), return);
const Utils::FilePath projectRootDir = cleanPath(m_projectInfo.project()->projectDirectory());
QString errorMessage;
const QList<Diagnostic> diagnostics = tool()->read(filePath,
projectRootDir,
m_projectFiles,
logFilePath,
&errorMessage);
QFile::remove(logFilePath); // Clean-up.

View File

@@ -104,6 +104,7 @@ private:
QFutureInterface<void> m_progress;
AnalyzeUnits m_unitsToProcess;
QSet<Utils::FilePath> m_projectFiles;
QSet<ClangToolRunner *> m_runners;
int m_initialFilesToProcessSize = 0;
int m_filesAnalyzed = 0;

View File

@@ -122,7 +122,7 @@ static ExplainingStep buildFixIt(const CXDiagnostic cxDiagnostic, unsigned index
}
static Diagnostic buildDiagnostic(const CXDiagnostic cxDiagnostic,
const Utils::FilePath &projectRootDir,
const QSet<Utils::FilePath> &projectFiles,
const QString &nativeFilePath)
{
Diagnostic diagnostic;
@@ -136,7 +136,7 @@ static Diagnostic buildDiagnostic(const CXDiagnostic cxDiagnostic,
diagnostic.location = diagLocationFromSourceLocation(cxLocation);
const auto diagnosticFilePath = Utils::FilePath::fromString(diagnostic.location.filePath);
if (!diagnosticFilePath.isChildOf(projectRootDir))
if (!projectFiles.contains(diagnosticFilePath))
return diagnostic;
// TODO: Introduce CppTools::ProjectFile::isGenerated to filter these out properly
@@ -183,7 +183,7 @@ static Diagnostic buildDiagnostic(const CXDiagnostic cxDiagnostic,
}
static QList<Diagnostic> readSerializedDiagnostics_helper(const QString &filePath,
const Utils::FilePath &projectRootDir,
const QSet<Utils::FilePath> &projectFiles,
const QString &logFilePath)
{
QList<Diagnostic> list;
@@ -206,7 +206,7 @@ static QList<Diagnostic> readSerializedDiagnostics_helper(const QString &filePat
Utils::ExecuteOnDestruction cleanUpDiagnostic([&]() {
clang_disposeDiagnostic(cxDiagnostic);
});
const Diagnostic diagnostic = buildDiagnostic(cxDiagnostic, projectRootDir, nativeFilePath);
const Diagnostic diagnostic = buildDiagnostic(cxDiagnostic, projectFiles, nativeFilePath);
if (!diagnostic.isValid())
continue;
@@ -232,14 +232,14 @@ static bool checkFilePath(const QString &filePath, QString *errorMessage)
}
QList<Diagnostic> readSerializedDiagnostics(const QString &filePath,
const Utils::FilePath &projectRootDir,
const QSet<Utils::FilePath> &projectFiles,
const QString &logFilePath,
QString *errorMessage)
{
if (!checkFilePath(logFilePath, errorMessage))
return QList<Diagnostic>();
return readSerializedDiagnostics_helper(filePath, projectRootDir, logFilePath);
return readSerializedDiagnostics_helper(filePath, projectFiles, logFilePath);
}
} // namespace Internal

View File

@@ -35,7 +35,7 @@ namespace ClangTools {
namespace Internal {
QList<Diagnostic> readSerializedDiagnostics(const QString &filePath,
const Utils::FilePath &projectRootDir,
const QSet<Utils::FilePath> &projectFiles,
const QString &logFilePath,
QString *errorMessage);

View File

@@ -25,8 +25,9 @@
#include "clangtoolsunittests.h"
#include "clangtoolsdiagnostic.h"
#include "clangtidyclazytool.h"
#include "clangtoolsdiagnostic.h"
#include "clangtoolssettings.h"
#include "clangtoolsutils.h"
#include <coreplugin/icore.h>
@@ -50,6 +51,8 @@
using namespace ProjectExplorer;
using namespace Utils;
Q_DECLARE_METATYPE(CppTools::ClangDiagnosticConfig)
namespace ClangTools {
namespace Internal {
@@ -75,16 +78,17 @@ void ClangToolsUnitTests::cleanupTestCase()
delete m_tmpDir;
}
static CppTools::ClangDiagnosticConfig createTidyClazyConfig()
static CppTools::ClangDiagnosticConfig configFor(const QString &tidyChecks,
const QString &clazyChecks)
{
CppTools::ClangDiagnosticConfig config;
config.setId("Test.ClangTidy");
config.setId("Test.MyTestConfig");
config.setDisplayName("Test");
config.setIsReadOnly(true);
config.setClangOptions(QStringList{QStringLiteral("-Wno-everything")});
config.setClangTidyMode(CppTools::ClangDiagnosticConfig::TidyMode::ChecksPrefixList);
config.setClangTidyChecks("modernize-*, misc-*");
config.setClazyChecks("level2");
config.setClangTidyChecks(tidyChecks);
config.setClazyChecks(clazyChecks);
return config;
}
@@ -92,6 +96,7 @@ void ClangToolsUnitTests::testProject()
{
QFETCH(QString, projectFilePath);
QFETCH(int, expectedDiagCount);
QFETCH(CppTools::ClangDiagnosticConfig, diagnosticConfig);
if (projectFilePath.contains("mingw")) {
const ToolChain * const toolchain
= ToolChainKitAspect::toolChain(KitManager::kits().constFirst(),
@@ -106,23 +111,25 @@ void ClangToolsUnitTests::testProject()
ClangTool *tool = ClangTidyClazyTool::instance();
// Change configs
QSharedPointer<CppTools::CppCodeModelSettings> settings = CppTools::codeModelSettings();
const CppTools::ClangDiagnosticConfigs originalConfigs = settings->clangCustomDiagnosticConfigs();
const Core::Id originalId = settings->clangDiagnosticConfigId();
QSharedPointer<CppTools::CppCodeModelSettings> cppToolsSettings = CppTools::codeModelSettings();
ClangToolsSettings *clangToolsSettings = ClangToolsSettings::instance();
const CppTools::ClangDiagnosticConfigs originalConfigs = cppToolsSettings
->clangCustomDiagnosticConfigs();
const Core::Id originalId = clangToolsSettings->diagnosticConfigId();
CppTools::ClangDiagnosticConfigs modifiedConfigs = originalConfigs;
const CppTools::ClangDiagnosticConfig clangTidyConfig = createTidyClazyConfig();
modifiedConfigs.push_back(clangTidyConfig);
modifiedConfigs.push_back(diagnosticConfig);
ExecuteOnDestruction executeOnDestruction([=]() {
// Restore configs
settings->setClangCustomDiagnosticConfigs(originalConfigs);
settings->setClangDiagnosticConfigId(originalId);
cppToolsSettings->setClangCustomDiagnosticConfigs(originalConfigs);
clangToolsSettings->setDiagnosticConfigId(originalId);
clangToolsSettings->writeSettings();
});
settings->setClangCustomDiagnosticConfigs(modifiedConfigs);
settings->setClangDiagnosticConfigId(clangTidyConfig.id());
cppToolsSettings->setClangCustomDiagnosticConfigs(modifiedConfigs);
clangToolsSettings->setDiagnosticConfigId(diagnosticConfig.id());
clangToolsSettings->writeSettings();
tool->startTool(false);
QSignalSpy waiter(tool, SIGNAL(finished(bool)));
@@ -137,43 +144,50 @@ void ClangToolsUnitTests::testProject_data()
{
QTest::addColumn<QString>("projectFilePath");
QTest::addColumn<int>("expectedDiagCount");
QTest::addColumn<CppTools::ClangDiagnosticConfig>("diagnosticConfig");
// For the simple project, we expect the following warning:
// warning: use nullptr [modernize-use-nullptr]
addTestRow("simple/simple.qbs", 1);
addTestRow("simple/simple.pro", 1);
// Test simple C++ project.
CppTools::ClangDiagnosticConfig config = configFor("modernize-use-nullptr", QString());
addTestRow("simple/simple.qbs", 1, config);
addTestRow("simple/simple.pro", 1, config);
addTestRow("simple-library/simple-library.qbs", 0);
addTestRow("simple-library/simple-library.pro", 0);
// Test simple Qt project.
config = configFor("readability-static-accessed-through-instance", QString());
addTestRow("qt-widgets-app/qt-widgets-app.qbs", 1, config);
addTestRow("qt-widgets-app/qt-widgets-app.pro", 1, config);
addTestRow("stdc++11-includes/stdc++11-includes.qbs", 0);
addTestRow("stdc++11-includes/stdc++11-includes.pro", 0);
// Test that libraries can be analyzed.
config = configFor(QString(), QString());
addTestRow("simple-library/simple-library.qbs", 0, config);
addTestRow("simple-library/simple-library.pro", 0, config);
// For qt-widgets-app, we expect the following warning for "a.exec()",
// "a" being the QApplication object:
// warning: static member accessed through instance
// [readability-static-accessed-through-instance]
addTestRow("qt-widgets-app/qt-widgets-app.qbs", 1);
addTestRow("qt-widgets-app/qt-widgets-app.pro", 1);
// Test that standard headers can be parsed.
addTestRow("stdc++11-includes/stdc++11-includes.qbs", 0, config);
addTestRow("stdc++11-includes/stdc++11-includes.pro", 0, config);
addTestRow("qt-essential-includes/qt-essential-includes.qbs", 0);
addTestRow("qt-essential-includes/qt-essential-includes.pro", 0);
// Test that qt essential headers can be parsed.
addTestRow("qt-essential-includes/qt-essential-includes.qbs", 0, config);
addTestRow("qt-essential-includes/qt-essential-includes.pro", 0, config);
addTestRow("mingw-includes/mingw-includes.qbs", 0);
addTestRow("mingw-includes/mingw-includes.pro", 0);
// Test that mingw includes can be parsed.
addTestRow("mingw-includes/mingw-includes.qbs", 0, config);
addTestRow("mingw-includes/mingw-includes.pro", 0, config);
// Test that tidy and clazy diagnostics are emitted for the same project.
addTestRow("clangtidy_clazy/clangtidy_clazy.pro",
4 /* ClangTidy: modernize-*,misc-* */
+ 2 /* Clazy: level1 */);
1 /*tidy*/ + 1 /*clazy*/,
configFor("misc-unconventional-assign-operator", "base-class-event"));
}
void ClangToolsUnitTests::addTestRow(const QByteArray &relativeFilePath,
int expectedDiagCount)
int expectedDiagCount,
const CppTools::ClangDiagnosticConfig &diagnosticConfig)
{
const QString absoluteFilePath = m_tmpDir->absolutePath(relativeFilePath);
const QString fileName = QFileInfo(absoluteFilePath).fileName();
QTest::newRow(fileName.toUtf8().constData()) << absoluteFilePath << expectedDiagCount;
QTest::newRow(fileName.toUtf8().constData())
<< absoluteFilePath << expectedDiagCount << diagnosticConfig;
}
} // namespace Internal

View File

@@ -27,7 +27,10 @@
#include <QObject>
namespace CppTools { namespace Tests { class TemporaryCopiedDir; } }
namespace CppTools {
class ClangDiagnosticConfig;
namespace Tests { class TemporaryCopiedDir; }
} // namespace CppTools
namespace ClangTools {
namespace Internal {
@@ -46,7 +49,9 @@ private slots:
void testProject_data();
private:
void addTestRow(const QByteArray &relativeFilePath, int expectedDiagCount);
void addTestRow(const QByteArray &relativeFilePath,
int expectedDiagCount,
const CppTools::ClangDiagnosticConfig &diagnosticConfig);
private:
CppTools::Tests::TemporaryCopiedDir *m_tmpDir = nullptr;

View File

@@ -40,6 +40,7 @@
#include <QDebug>
#include <QVariant>
#include <QVBoxLayout>
#include <QElapsedTimer>
enum { debug = false };
@@ -267,7 +268,7 @@ void NavigationWidget::onDataUpdate(QSharedPointer<QStandardItem> result)
if (result.isNull())
return;
QTime timer;
QElapsedTimer timer;
if (debug)
timer.start();
// update is received. root item must be updated - and received information

View File

@@ -53,6 +53,7 @@
#include <QReadWriteLock>
#include <QReadLocker>
#include <QWriteLocker>
#include <QElapsedTimer>
enum { debug = false };
@@ -274,7 +275,7 @@ ParserTreeItem::ConstPtr Parser::findItemByRoot(const QStandardItem *item, bool
ParserTreeItem::ConstPtr Parser::parse()
{
QTime time;
QElapsedTimer time;
if (debug)
time.start();

View File

@@ -415,8 +415,7 @@ static QStringList parseDefinition(const QString &definition)
void CMakeTool::parseFunctionDetailsOutput(const QString &output)
{
QSet<QString> functionSet;
functionSet.fromList(m_introspection->m_functions);
const QSet<QString> functionSet = Utils::toSet(m_introspection->m_functions);
bool expectDefinition = false;
QString currentDefinition;

View File

@@ -275,7 +275,7 @@ std::unique_ptr<CMakeProjectNode> TeaLeafReader::generateProjectTree(
});
allIncludePathSet.unite(Utils::toSet(targetIncludePaths));
}
const QList<FilePath> allIncludePaths = allIncludePathSet.toList();
const QList<FilePath> allIncludePaths = Utils::toList(allIncludePathSet);
const QList<const FileNode *> missingHeaders
= Utils::filtered(allFiles, [&allIncludePaths](const FileNode *fn) -> bool {

View File

@@ -50,7 +50,7 @@ using namespace Utils;
namespace {
enum { debug = 0 };
const bool debug = qEnvironmentVariable("QTC_DEBUG_CPPLOCATORFILTERTESTCASE") == "1";
QTC_DECLARE_MYTESTDATADIR("../../../tests/cpplocators/")

View File

@@ -48,10 +48,10 @@ static const TidyNode CLANG_TIDY_CHECKS_ROOT
"",
{
{
"android-",
"abseil-",
{
{
"uration-",
"duration-",
{
"comparison",
"division",
@@ -65,18 +65,23 @@ static const TidyNode CLANG_TIDY_CHECKS_ROOT
"subtraction"
}
},
"aster-strsplit-delimiter",
"faster-strsplit-delimiter",
{
"o-",
"no-",
{
"internal-dependencies",
"namespace"
}
},
"edundant-strcat-calls",
"tr-cat-append",
"tring-find-startswith",
"pgrade-duration-conversions",
"redundant-strcat-calls",
"str-cat-append",
"string-find-startswith",
"upgrade-duration-conversions"
}
},
{
"android-",
{
{
"cloexec-",
{
@@ -715,7 +720,12 @@ static const TidyNode CLANG_TIDY_CHECKS_ROOT
"copy-initialization",
"value-param"
}
},
}
}
},
{
"portability-",
{
"simd-intrinsics"
}
},
@@ -773,8 +783,13 @@ static const TidyNode CLANG_TIDY_CHECKS_ROOT
},
"string-compare",
"uniqueptr-delete-release",
"uppercase-literal-suffix",
"rary-objects"
"uppercase-literal-suffix"
}
},
{
"zircon-",
{
"temporary-objects"
}
}
}

View File

@@ -146,7 +146,7 @@ static bool waitForProcessedEditorDocument_internal(CppEditorDocumentHandle *edi
{
QTC_ASSERT(editorDocument, return false);
QTime timer;
QElapsedTimer timer;
timer.start();
forever {
@@ -208,7 +208,7 @@ CPlusPlus::Document::Ptr TestCase::waitForFileInGlobalSnapshot(const QString &fi
QList<CPlusPlus::Document::Ptr> TestCase::waitForFilesInGlobalSnapshot(const QStringList &filePaths,
int timeOutInMs)
{
QTime t;
QElapsedTimer t;
t.start();
QList<CPlusPlus::Document::Ptr> result;
@@ -231,7 +231,7 @@ bool TestCase::waitUntilCppModelManagerIsAwareOf(Project *project, int timeOutIn
if (!project)
return false;
QTime t;
QElapsedTimer t;
t.start();
CppModelManager *modelManager = CppModelManager::instance();
@@ -275,7 +275,7 @@ ProjectOpenerAndCloser::~ProjectOpenerAndCloser()
foreach (Project *project, m_openProjects)
ProjectExplorerPlugin::unloadProject(project);
QTime t;
QElapsedTimer t;
t.start();
while (!hasGcFinished && t.elapsed() <= 30000)
QCoreApplication::processEvents();

View File

@@ -1006,7 +1006,7 @@ Breakpoints BreakHandler::findBreakpointsByIndex(const QList<QModelIndex> &list)
if (Breakpoint bp = findBreakpointByIndex(index))
items.insert(bp);
}
return items.toList();
return Utils::toList(items);
}
SubBreakpoints BreakHandler::findSubBreakpointsByIndex(const QList<QModelIndex> &list) const
@@ -1016,7 +1016,7 @@ SubBreakpoints BreakHandler::findSubBreakpointsByIndex(const QList<QModelIndex>
if (SubBreakpoint sbp = findSubBreakpointByIndex(index))
items.insert(sbp);
}
return items.toList();
return Utils::toList(items);
}

View File

@@ -442,7 +442,7 @@ void DebuggerMainWindow::restorePersistentSettings()
theMainWindow->setAutoHideTitleBars(settings->value(AUTOHIDE_TITLEBARS_KEY, true).toBool());
theMainWindow->showCentralWidget(settings->value(SHOW_CENTRALWIDGET_KEY, true).toBool());
theMainWindow->d->m_persistentChangedDocks
= QSet<QString>::fromList(settings->value(CHANGED_DOCK_KEY).toStringList());
= Utils::toSet(settings->value(CHANGED_DOCK_KEY).toStringList());
settings->endGroup();
qCDebug(perspectivesLog) << "LOADED DOCKS:" << theMainWindow->d->m_persistentChangedDocks;

View File

@@ -320,7 +320,7 @@ QmlEngine::~QmlEngine()
if (textEditPtr)
documentsToClose << textEditPtr.data()->document();
}
EditorManager::closeDocuments(documentsToClose.toList());
EditorManager::closeDocuments(Utils::toList(documentsToClose));
delete d;
}

View File

@@ -260,7 +260,8 @@ void QmlInspectorAgent::onResult(quint32 queryId, const QVariant &value,
} else {
int index = m_rootContextQueryIds.indexOf(queryId);
if (index < 0) {
m_qmlEngine->expressionEvaluated(queryId, value);
if (QTC_GUARD(m_qmlEngine))
m_qmlEngine->expressionEvaluated(queryId, value);
} else {
Q_ASSERT(index < m_engines.length());
const int engineId = m_engines.at(index).debugId();

View File

@@ -77,6 +77,7 @@
#include <QSettings>
#include <QPluginLoader>
#include <QTime>
#include <QElapsedTimer>
#include <algorithm>
@@ -351,9 +352,9 @@ void FormEditorData::setupViewActions()
void FormEditorData::fullInit()
{
QTC_ASSERT(m_initStage == FormEditorW::RegisterPlugins, return);
QTime *initTime = 0;
QElapsedTimer *initTime = 0;
if (Designer::Constants::Internal::debug) {
initTime = new QTime;
initTime = new QElapsedTimer;
initTime->start();
}

View File

@@ -291,7 +291,7 @@ bool GenericProject::addFiles(const QStringList &filePaths)
for (const QString &filePath : filePaths)
insertSorted(&newList, baseDir.relativeFilePath(filePath));
const QSet<QString> includes = m_projectIncludePaths.toSet();
const QSet<QString> includes = Utils::toSet(m_projectIncludePaths);
QSet<QString> toAdd;
for (const QString &filePath : filePaths) {

View File

@@ -31,6 +31,8 @@
#include "qmt/model/mdependency.h"
#include "qmt/model_controller/modelcontroller.h"
#include <utils/algorithm.h>
#include <QSet>
namespace ModelEditor {
@@ -151,7 +153,7 @@ void PackageViewController::createAncestorDependencies(qmt::MObject *object1, qm
bool PackageViewController::haveMatchingStereotypes(const qmt::MObject *object1,
const qmt::MObject *object2)
{
return !(object1->stereotypes().toSet() & object2->stereotypes().toSet()).isEmpty();
return !(Utils::toSet(object1->stereotypes()) & Utils::toSet(object2->stereotypes())).isEmpty();
}

View File

@@ -27,7 +27,7 @@
#include <QList>
#include <QDialog>
#include <QTime>
#include <QElapsedTimer>
#include "runcontrol.h"
@@ -51,7 +51,7 @@ private:
QList<ProjectExplorer::RunControl *> m_runControls;
QLabel *m_progressLabel;
QTime m_timer;
QElapsedTimer m_timer;
};
} // namespace Internal

View File

@@ -29,6 +29,7 @@
#include <coreplugin/generatedfile.h>
#include <cpptools/abstracteditorsupport.h>
#include <utils/algorithm.h>
#include <utils/fileutils.h>
#include <utils/macroexpander.h>
#include <utils/templateengine.h>
@@ -293,8 +294,8 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara
sm.insert(QLatin1String("PLUGIN_HEADERS"), pluginHeaders);
sm.insert(QLatin1String("PLUGIN_SOURCES"), pluginSources);
sm.insert(QLatin1String("PLUGIN_RESOURCES"), options.resourceFile);
sm.insert(QLatin1String("WIDGET_LIBS"), QStringList(widgetLibraries.toList()).join(blank));
sm.insert(QLatin1String("INCLUSIONS"), QStringList(widgetProjects.toList()).join(QLatin1Char('\n')));
sm.insert(QLatin1String("WIDGET_LIBS"), QStringList(Utils::toList(widgetLibraries)).join(blank));
sm.insert(QLatin1String("INCLUSIONS"), QStringList(Utils::toList(widgetProjects)).join(QLatin1Char('\n')));
const QString proFileContents = processTemplate(p.templatePath + QLatin1String("/tpl_plugin.pro"), sm, errorMessage);
if (proFileContents.isEmpty())
return QList<Core::GeneratedFile>();

View File

@@ -385,8 +385,8 @@ void QmakePriFile::watchFolders(const QSet<FilePath> &folders)
QSet<QString> toWatch = folderStrings;
toWatch.subtract(m_watchedFolders);
m_project->unwatchFolders(toUnwatch.toList(), this);
m_project->watchFolders(toWatch.toList(), this);
m_project->unwatchFolders(Utils::toList(toUnwatch), this);
m_project->watchFolders(Utils::toList(toWatch), this);
m_watchedFolders = folderStrings;
}
@@ -1366,7 +1366,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
result->includedFiles.children.insert(subDirName, subDir);
}
result->exactSubdirs = subDirs.toSet();
result->exactSubdirs = Utils::toSet(subDirs);
}
// Convert ProFileReader::includeFiles to IncludedPriFile structure
@@ -1691,7 +1691,7 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult)
});
}
const QStringList directoriesToAdd = Utils::filtered<QStringList>(
result->directoriesWithWildcards.toList(),
Utils::toList(result->directoriesWithWildcards),
[this](const QString &path) {
return !m_wildcardWatcher->watchesDirectory(path);
});

View File

@@ -831,7 +831,7 @@ void CentralizedFolderWatcher::watchFolders(const QList<QString> &folders, Qmake
// we add the recursive directories we find
QSet<QString> tmp = recursiveDirs(folder);
if (!tmp.isEmpty())
m_watcher.addPaths(tmp.toList());
m_watcher.addPaths(Utils::toList(tmp));
m_recursiveWatchedFolders += tmp;
}
}
@@ -927,7 +927,7 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder)
// If a subdirectory was added, watch it too
QSet<QString> tmp = recursiveDirs(folderWithSlash);
if (!tmp.isEmpty()) {
QSet<QString> alreadyAdded = m_watcher.directories().toSet();
QSet<QString> alreadyAdded = Utils::toSet(m_watcher.directories());
tmp.subtract(alreadyAdded);
if (!tmp.isEmpty())
m_watcher.addPaths(Utils::toList(tmp));

View File

@@ -179,6 +179,8 @@ void LayoutInGridLayout::doIt()
initializeCells();
markUsedCells();
QTC_ASSERT(m_parentNode.isValid(), return);
if (QmlItemNode::isValidQmlItemNode(m_selectionContext.firstSelectedModelNode())) {
const QmlItemNode qmlItemNode = QmlItemNode(m_selectionContext.firstSelectedModelNode());
@@ -256,6 +258,10 @@ void LayoutInGridLayout::collectItemNodes()
m_qmlItemNodes.append(itemNode);
}
}
if (m_qmlItemNodes.isEmpty())
return;
m_parentNode = m_qmlItemNodes.constFirst().instanceParentItem();
}

View File

@@ -625,9 +625,10 @@ bool QmlObjectNode::hasInstanceParent() const
bool QmlObjectNode::hasInstanceParentItem() const
{
return nodeInstance().parentId() >= 0
&& nodeInstanceView()->hasInstanceForId(nodeInstance().parentId())
&& QmlItemNode::isItemOrWindow(view()->modelNodeForInternalId(nodeInstance().parentId()));
return isValid()
&& nodeInstance().parentId() >= 0
&& nodeInstanceView()->hasInstanceForId(nodeInstance().parentId())
&& QmlItemNode::isItemOrWindow(view()->modelNodeForInternalId(nodeInstance().parentId()));
}

View File

@@ -1036,7 +1036,6 @@ QmlJSEditorFactory::QmlJSEditorFactory()
addMimeType(QmlJSTools::Constants::QBS_MIMETYPE);
addMimeType(QmlJSTools::Constants::QMLTYPES_MIMETYPE);
addMimeType(QmlJSTools::Constants::JS_MIMETYPE);
addMimeType(QmlJSTools::Constants::JSON_MIMETYPE);
setDocumentCreator([]() { return new QmlJSEditorDocument; });
setEditorWidgetCreator([]() { return new QmlJSEditorWidget; });

View File

@@ -47,6 +47,7 @@
#include <QDesktopServices>
#include <QDialogButtonBox>
#include <QDir>
#include <QElapsedTimer>
#include <QGridLayout>
#include <QHeaderView>
#include <QIdentityProxyModel>
@@ -608,7 +609,7 @@ private:
const QColor foregroundColor2 = themeColor(Theme::Welcome_ForegroundSecondaryColor); // blacker.
mutable QPersistentModelIndex m_previousIndex;
mutable QTime m_startTime;
mutable QElapsedTimer m_startTime;
mutable QRect m_currentArea;
mutable QPointer<QAbstractItemView> m_currentWidget;
mutable QVector<QPair<QString, QRect>> m_currentTagRects;

View File

@@ -67,7 +67,7 @@ Utils::FilePath UicGenerator::command() const
QStringList UicGenerator::arguments() const
{
return {source().toString()};
return {"-p", source().toString()};
}
FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
@@ -81,7 +81,9 @@ FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process)
return result;
// As far as I can discover in the UIC sources, it writes out local 8-bit encoding. The
// conversion below is to normalize both the encoding, and the line terminators.
result[targetList.first()] = QString::fromLocal8Bit(process->readAllStandardOutput()).toUtf8();
QByteArray content = QString::fromLocal8Bit(process->readAllStandardOutput()).toUtf8();
content.prepend("#pragma once\n");
result[targetList.first()] = content;
return result;
}

View File

@@ -33,12 +33,13 @@
#include <ssh/sshconnection.h>
#include <ssh/sshremoteprocess.h>
#include <QDateTime>
#include <QDir>
#include <QFileInfo>
#include <QList>
#include <QString>
#include <QDateTime>
#include <QHash>
#include <QList>
#include <QQueue>
#include <QString>
using namespace ProjectExplorer;
using namespace QSsh;
@@ -48,6 +49,8 @@ namespace Internal {
enum State { Inactive, PreChecking, Uploading, PostProcessing };
const int MaxConcurrentStatCalls = 10;
class GenericDirectUploadServicePrivate
{
public:
@@ -63,6 +66,7 @@ public:
bool incremental = false;
bool ignoreMissingFiles = false;
QHash<SshRemoteProcess *, DeployableFile> remoteProcs;
QQueue<DeployableFile> filesToStat;
State state = Inactive;
QList<DeployableFile> filesToUpload;
SftpTransferPtr uploader;
@@ -132,11 +136,12 @@ void GenericDirectUploadService::doDeploy()
}
QDateTime GenericDirectUploadService::timestampFromStat(const DeployableFile &file,
SshRemoteProcess *statProc)
SshRemoteProcess *statProc,
const QString &errorMsg)
{
QString errorDetails;
if (statProc->exitStatus() != QProcess::NormalExit)
errorDetails = statProc->errorString();
if (!errorMsg.isEmpty())
errorDetails = errorMsg;
else if (statProc->exitCode() != 0)
errorDetails = QString::fromUtf8(statProc->readAllStandardError());
if (!errorDetails.isEmpty()) {
@@ -168,6 +173,8 @@ QDateTime GenericDirectUploadService::timestampFromStat(const DeployableFile &fi
void GenericDirectUploadService::checkForStateChangeOnRemoteProcFinished()
{
if (d->remoteProcs.size() < MaxConcurrentStatCalls && !d->filesToStat.isEmpty())
runStat(d->filesToStat.dequeue());
if (!d->remoteProcs.isEmpty())
return;
if (d->state == PreChecking) {
@@ -188,6 +195,39 @@ void GenericDirectUploadService::stopDeployment()
handleDeploymentDone();
}
void GenericDirectUploadService::runStat(const DeployableFile &file)
{
// We'd like to use --format=%Y, but it's not supported by busybox.
const QString statCmd = "stat -t " + Utils::QtcProcess::quoteArgUnix(file.remoteFilePath());
SshRemoteProcess * const statProc = connection()->createRemoteProcess(statCmd).release();
statProc->setParent(this);
connect(statProc, &SshRemoteProcess::done, this,
[this, statProc, state = d->state](const QString &errorMsg) {
QTC_ASSERT(d->state == state, return);
const DeployableFile file = d->getFileForProcess(statProc);
QTC_ASSERT(file.isValid(), return);
const QDateTime timestamp = timestampFromStat(file, statProc, errorMsg);
statProc->deleteLater();
switch (state) {
case PreChecking:
if (!timestamp.isValid() || hasRemoteFileChanged(file, timestamp))
d->filesToUpload.append(file);
break;
case PostProcessing:
if (timestamp.isValid())
saveDeploymentTimeStamp(file, timestamp);
break;
case Inactive:
case Uploading:
QTC_CHECK(false);
break;
}
checkForStateChangeOnRemoteProcFinished();
});
d->remoteProcs.insert(statProc, file);
statProc->start();
}
QList<DeployableFile> GenericDirectUploadService::collectFilesToUpload(
const DeployableFile &deployable) const
{
@@ -212,6 +252,7 @@ QList<DeployableFile> GenericDirectUploadService::collectFilesToUpload(
void GenericDirectUploadService::setFinished()
{
d->state = Inactive;
d->filesToStat.clear();
for (auto it = d->remoteProcs.begin(); it != d->remoteProcs.end(); ++it) {
it.key()->disconnect();
it.key()->terminate();
@@ -237,35 +278,10 @@ void GenericDirectUploadService::queryFiles()
d->filesToUpload.append(file);
continue;
}
// We'd like to use --format=%Y, but it's not supported by busybox.
const QString statCmd = "stat -t " + Utils::QtcProcess::quoteArgUnix(file.remoteFilePath());
SshRemoteProcess * const statProc = connection()->createRemoteProcess(statCmd).release();
statProc->setParent(this);
connect(statProc, &SshRemoteProcess::done, this,
[this, statProc, state = d->state] {
QTC_ASSERT(d->state == state, return);
const DeployableFile file = d->getFileForProcess(statProc);
QTC_ASSERT(file.isValid(), return);
const QDateTime timestamp = timestampFromStat(file, statProc);
statProc->deleteLater();
switch (state) {
case PreChecking:
if (!timestamp.isValid() || hasRemoteFileChanged(file, timestamp))
d->filesToUpload.append(file);
break;
case PostProcessing:
if (timestamp.isValid())
saveDeploymentTimeStamp(file, timestamp);
break;
case Inactive:
case Uploading:
QTC_CHECK(false);
break;
}
checkForStateChangeOnRemoteProcFinished();
});
d->remoteProcs.insert(statProc, file);
statProc->start();
if (d->remoteProcs.size() >= MaxConcurrentStatCalls)
d->filesToStat << file;
else
runStat(file);
}
checkForStateChangeOnRemoteProcFinished();
}

View File

@@ -61,8 +61,9 @@ public:
void stopDeployment() override;
private:
void runStat(const ProjectExplorer::DeployableFile &file);
QDateTime timestampFromStat(const ProjectExplorer::DeployableFile &file,
QSsh::SshRemoteProcess *statProc);
QSsh::SshRemoteProcess *statProc, const QString &errorMsg);
void checkForStateChangeOnRemoteProcFinished();
QList<ProjectExplorer::DeployableFile> collectFilesToUpload(

View File

@@ -59,8 +59,8 @@ void CppTodoItemsScanner::scannerParamsChanged()
QSet<QString> filesToBeUpdated;
foreach (const CppTools::ProjectInfo &info, modelManager->projectInfos())
filesToBeUpdated.unite(Utils::transform(info.project().data()->files(ProjectExplorer::Project::SourceFiles),
&Utils::FilePath::toString).toSet());
filesToBeUpdated.unite(Utils::transform<QSet>(info.project().data()->files(ProjectExplorer::Project::SourceFiles),
&Utils::FilePath::toString));
modelManager->updateSourceFiles(filesToBeUpdated);
}

View File

@@ -116,7 +116,7 @@ void OptionsDialog::editKeyword(QListWidgetItem *item)
Keyword keyword;
keyword.name = item->text();
keyword.iconType = static_cast<IconType>(item->data(Qt::UserRole).toInt());
keyword.color = item->textColor();
keyword.color = item->foreground().color();
QSet<QString> keywordNamesButThis = keywordNames();
keywordNamesButThis.remove(keyword.name);
@@ -127,7 +127,7 @@ void OptionsDialog::editKeyword(QListWidgetItem *item)
item->setIcon(icon(keyword.iconType));
item->setText(keyword.name);
item->setData(Qt::UserRole, static_cast<int>(keyword.iconType));
item->setTextColor(keyword.color);
item->setForeground(keyword.color);
}
}

View File

@@ -195,14 +195,24 @@ isEmpty(LLVM_VERSION) {
LLVM_STATIC_LIBS = $$split(LLVM_STATIC_LIBS_STRING, " ")
CLANGFORMAT_MAIN_HEADER = $$LLVM_INCLUDEPATH/clang/Format/Format.h
exists($$CLANGFORMAT_MAIN_HEADER) {
CLANGFORMAT_LIBS=-lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangLex -lclangBasic
ALL_CLANG_LIBS=-lclangFormat -lclangToolingInclusions -lclangTooling -lclangToolingCore \
-lclangRewrite -lclangIndex -lclangFrontend -lclangParse -lclangSerialization \
-lclangSema -lclangEdit -lclangAnalysis -lclangDriver -lclangDynamicASTMatchers \
-lclangASTMatchers -lclangAST -lclangLex -lclangBasic
win32:CLANGFORMAT_LIBS += -lversion
win32 {
LLVM_BUILDMODE = $$system($$llvm_config --build-mode, lines)
CONFIG(debug, debug|release):!equals(LLVM_BUILDMODE, "Debug") {
message("Mismatching build config (Debug vs Release) setting QTC_CLANG_BUILDMODE_MISMATCH")
QTC_CLANG_BUILDMODE_MISMATCH=1
}
}
isEmpty(QTC_CLANG_BUILDMODE_MISMATCH)|!equals(QTC_CLANG_BUILDMODE_MISMATCH, 1) {
CLANGFORMAT_MAIN_HEADER = $$LLVM_INCLUDEPATH/clang/Format/Format.h
exists($$CLANGFORMAT_MAIN_HEADER) {
CLANGFORMAT_LIBS=-lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangLex -lclangBasic
ALL_CLANG_LIBS=-lclangFormat -lclangToolingInclusions -lclangTooling -lclangToolingCore \
-lclangRewrite -lclangIndex -lclangFrontend -lclangParse -lclangSerialization \
-lclangSema -lclangEdit -lclangAnalysis -lclangDriver -lclangDynamicASTMatchers \
-lclangASTMatchers -lclangAST -lclangLex -lclangBasic
win32:CLANGFORMAT_LIBS += -lversion
}
}
win32:ALL_CLANG_LIBS += -lversion
@@ -225,10 +235,12 @@ isEmpty(LLVM_VERSION) {
!contains(QMAKE_DEFAULT_LIBDIRS, $$LLVM_LIBDIR): LIBCLANG_LIBS = -L$${LLVM_LIBDIR}
LIBCLANG_LIBS += $${CLANG_LIB}
QTC_DISABLE_CLANG_REFACTORING=$$(QTC_DISABLE_CLANG_REFACTORING)
isEmpty(QTC_DISABLE_CLANG_REFACTORING) {
!contains(QMAKE_DEFAULT_LIBDIRS, $$LLVM_LIBDIR): LIBTOOLING_LIBS = -L$${LLVM_LIBDIR}
LIBTOOLING_LIBS += $$CLANGTOOLING_LIBS $$LLVM_STATIC_LIBS
isEmpty(QTC_CLANG_BUILDMODE_MISMATCH)|!equals(QTC_CLANG_BUILDMODE_MISMATCH, 1) {
QTC_DISABLE_CLANG_REFACTORING=$$(QTC_DISABLE_CLANG_REFACTORING)
isEmpty(QTC_DISABLE_CLANG_REFACTORING) {
!contains(QMAKE_DEFAULT_LIBDIRS, $$LLVM_LIBDIR): LIBTOOLING_LIBS = -L$${LLVM_LIBDIR}
LIBTOOLING_LIBS += $$CLANGTOOLING_LIBS $$LLVM_STATIC_LIBS
}
}
!isEmpty(CLANGFORMAT_LIBS) {

View File

@@ -103,7 +103,7 @@ void ClangCodeModelServer::documentsOpened(const ClangBackEnd::DocumentsOpenedMe
document.setDirtyIfDependencyIsMet(document.filePath());
DocumentProcessor processor = documentProcessors().create(document);
processor.jobs().setJobFinishedCallback([this](const Jobs::RunningJob &a, IAsyncJob *b) {
onJobFinished(a, b);
return onJobFinished(a, b);
});
}
const std::vector<Document> resetDocuments_ = resetDocuments(toReset);
@@ -401,12 +401,14 @@ void ClangCodeModelServer::processSuspendResumeJobs(const std::vector<Document>
}
}
void ClangCodeModelServer::onJobFinished(const Jobs::RunningJob &jobRecord, IAsyncJob *job)
bool ClangCodeModelServer::onJobFinished(const Jobs::RunningJob &jobRecord, IAsyncJob *job)
{
if (jobRecord.jobRequest.type == JobRequest::Type::UpdateAnnotations) {
const auto updateJob = static_cast<UpdateAnnotationsJob *>(job);
resetDocumentsWithUnresolvedIncludes({updateJob->pinnedDocument()});
return resetDocumentsWithUnresolvedIncludes({updateJob->pinnedDocument()});
}
return false;
}
void ClangCodeModelServer::categorizeFileContainers(const QVector<FileContainer> &fileContainers,
@@ -476,7 +478,7 @@ static bool isDocumentWithUnresolvedIncludesFixable(const Document &document,
return false;
}
void ClangCodeModelServer::resetDocumentsWithUnresolvedIncludes(
int ClangCodeModelServer::resetDocumentsWithUnresolvedIncludes(
const std::vector<Document> &documents)
{
DocumentResetInfos toReset;
@@ -489,6 +491,8 @@ void ClangCodeModelServer::resetDocumentsWithUnresolvedIncludes(
}
resetDocuments(toReset);
return toReset.size();
}
void ClangCodeModelServer::setUpdateAnnotationsTimeOutInMsForTestsOnly(int value)

View File

@@ -83,13 +83,13 @@ private:
void processTimerForVisibleButNotCurrentDocuments();
void processSuspendResumeJobs(const std::vector<Document> &documents);
void onJobFinished(const Jobs::RunningJob &jobRecord, IAsyncJob *job);
bool onJobFinished(const Jobs::RunningJob &jobRecord, IAsyncJob *job);
void categorizeFileContainers(const QVector<FileContainer> &fileContainers,
QVector<FileContainer> &toCreate,
DocumentResetInfos &toReset) const;
std::vector<Document> resetDocuments(const DocumentResetInfos &infos);
void resetDocumentsWithUnresolvedIncludes(const std::vector<Document> &documents);
int resetDocumentsWithUnresolvedIncludes(const std::vector<Document> &documents);
void addAndRunUpdateJobs(std::vector<Document> documents);

Some files were not shown because too many files have changed in this diff Show More