Merge remote-tracking branch 'origin/4.10'

Conflicts:
	src/libs/utils/consoleprocess_win.cpp

Change-Id: Ibdc265eed2f7080726e11ff6f2931c8559943af2
This commit is contained in:
Eike Ziller
2019-08-22 09:53:37 +02:00
24 changed files with 2155 additions and 1092 deletions

View File

@@ -286,6 +286,14 @@ function(enable_pch target)
endif()
endfunction()
function(qtc_output_binary_dir varName)
if (QTC_MERGE_BINARY_DIR)
set(${varName} ${QtCreator_BINARY_DIR} PARENT_SCOPE)
else()
set(${varName} ${PROJECT_BINARY_DIR} PARENT_SCOPE)
endif()
endfunction()
#
# Public API functions
#
@@ -354,6 +362,7 @@ function(add_qtc_library name)
set_property(SOURCE ${file} PROPERTY SKIP_AUTOMOC ON)
endforeach()
qtc_output_binary_dir(_output_binary_dir)
set_target_properties(${name} PROPERTIES
SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
VERSION "${IDE_VERSION}"
@@ -361,9 +370,9 @@ function(add_qtc_library name)
VISIBILITY_INLINES_HIDDEN ON
BUILD_RPATH "${_LIB_RPATH}"
INSTALL_RPATH "${_LIB_RPATH}"
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${IDE_BIN_PATH}"
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${IDE_LIBRARY_PATH}"
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${IDE_LIBRARY_PATH}"
RUNTIME_OUTPUT_DIRECTORY "${_output_binary_dir}/${IDE_BIN_PATH}"
LIBRARY_OUTPUT_DIRECTORY "${_output_binary_dir}/${IDE_LIBRARY_PATH}"
ARCHIVE_OUTPUT_DIRECTORY "${_output_binary_dir}/${IDE_LIBRARY_PATH}"
${_arg_PROPERTIES}
)
enable_pch(${name})
@@ -557,6 +566,7 @@ function(add_qtc_plugin target_name)
set(plugin_dir "${_arg_PLUGIN_PATH}")
endif()
qtc_output_binary_dir(_output_binary_dir)
set_target_properties(${target_name} PROPERTIES
SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
CXX_VISIBILITY_PRESET hidden
@@ -565,9 +575,9 @@ function(add_qtc_plugin target_name)
_arg_VERSION "${_arg_VERSION}"
BUILD_RPATH "${_PLUGIN_RPATH}"
INSTALL_RPATH "${_PLUGIN_RPATH}"
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${plugin_dir}"
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${plugin_dir}"
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${plugin_dir}"
LIBRARY_OUTPUT_DIRECTORY "${_output_binary_dir}/${plugin_dir}"
ARCHIVE_OUTPUT_DIRECTORY "${_output_binary_dir}/${plugin_dir}"
RUNTIME_OUTPUT_DIRECTORY "${_output_binary_dir}/${plugin_dir}"
OUTPUT_NAME "${name}"
${_arg_PROPERTIES}
)
@@ -703,10 +713,11 @@ function(add_qtc_executable name)
target_include_directories("${name}" PRIVATE "${CMAKE_BINARY_DIR}/src" ${_arg_INCLUDES})
target_compile_definitions("${name}" PRIVATE ${_arg_DEFINES} ${TEST_DEFINES} ${DEFAULT_DEFINES})
target_link_libraries("${name}" PRIVATE ${_arg_DEPENDS} ${_TEST_DEPENDS})
qtc_output_binary_dir(_output_binary_dir)
set_target_properties("${name}" PROPERTIES
BUILD_RPATH "${_RPATH_BASE}/${_RELATIVE_LIB_PATH}"
INSTALL_RPATH "${_RPATH_BASE}/${_RELATIVE_LIB_PATH}"
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${_DESTINATION}"
RUNTIME_OUTPUT_DIRECTORY "${_output_binary_dir}/${_DESTINATION}"
${_arg_PROPERTIES}
)
enable_pch(${name})

View File

@@ -671,24 +671,6 @@
\endtable
\section1 Checking JSON Data Structure
\QC validates instances of JSON entities against
\l{http://tools.ietf.org/html/draft-zyp-json-schema-03}
{A JSON Media Type for Describing the Structure and Meaning of JSON Documents}.
However, \QC does not understand the entire specification.
A JSON schema defines the structure of JSON data. It determines what JSON
data is required for an application and how to interact with it.
The specification does not define how to map JSON instances with JSON
schemas. \QC looks for a JSON schema file with a name that matches the
name of the JSON instance file in the user configuration folder. For
example, \c {~/config/QtProject/qtcreator/json} on Linux and \macos and
\c {C:\Users\username\AppData\Roaming\QtCreator\qtcreator\json} on
Windows. To check JSON data structure, copy the JSON schema file to the
above folder.
\section1 Resetting the Code Model
If you change the build and run kit when you have QML files open in the code

View File

@@ -533,6 +533,14 @@ Column {
visible: false
function applyPreset() {
if (!gradientLine.hasGradient)
{
if (colorEditor.shapeGradients)
gradientLine.gradientTypeName = "LinearGradient"
else
gradientLine.gradientTypeName = "Gradient"
}
if (presetList.gradientData.presetType == 0) {
gradientLine.setPresetByID(presetList.gradientData.presetID);
}

View File

@@ -62,9 +62,7 @@ StudioControls.ComboBox {
ColorLogic {
id: colorLogic
backendValue: comboBox.backendValue
onValueFromBackendChanged: {
invalidate();
}
onValueFromBackendChanged: invalidate()
function invalidate() {
@@ -74,9 +72,9 @@ StudioControls.ComboBox {
block = true
if (manualMapping) {
valueFromBackendChanged();
comboBox.valueFromBackendChanged()
} else if (!comboBox.useInteger) {
var enumString = comboBox.backendValue.enumeration;
var enumString = comboBox.backendValue.enumeration
if (enumString === "")
enumString = comboBox.backendValue.value
@@ -100,24 +98,23 @@ StudioControls.ComboBox {
onActivated: {
if (!__isCompleted)
return;
return
if (backendValue === undefined)
return;
return
if (manualMapping)
return;
return
if (!comboBox.useInteger) {
backendValue.setEnumeration(comboBox.scope, comboBox.currentText);
backendValue.setEnumeration(comboBox.scope, comboBox.currentText)
} else {
backendValue.value = comboBox.currentIndex;
backendValue.value = comboBox.currentIndex
}
}
Component.onCompleted: {
colorLogic.invalidate()
__isCompleted = true;
__isCompleted = true
}
}

View File

@@ -48,6 +48,7 @@ Dialog {
property int stopsCount;
property int presetID;
property int presetType; //default(0) or custom(1)
property Item selectedItem;
}
function addGradient(stopsPositions, stopsColors, stopsCount) {

View File

@@ -64,7 +64,6 @@ Rectangle {
clip: true
delegate: gradientDelegate
property int gridColumns: width / tabBackground.gridCellWidth;
cellWidth: width / gridColumns
cellHeight: 180
@@ -78,6 +77,8 @@ Rectangle {
clip: false
property real flexibleWidth: (gradientTable.width - gradientTable.cellWidth * gradientTable.gridColumns) / gradientTable.gridColumns
property bool isSelected: false
width: gradientTable.cellWidth + flexibleWidth - 8; height: tabBackground.delegateHeight
radius: 16
@@ -93,7 +94,11 @@ Rectangle {
gradientData.presetID = presetID;
gradientData.presetType = presetTabView.currentIndex
// console.log( "#" + preset + " " + presetName + " Stops: " + stopsPosList + " Colors: " + stopsColorList);
if (gradientData.selectedItem != null)
gradientData.selectedItem.isSelected = false
backgroundCard.isSelected = true
gradientData.selectedItem = backgroundCard
}
onEntered: {
if (backgroundCard.state != "CLICKED") {
@@ -107,6 +112,13 @@ Rectangle {
}
} //mouseArea
onIsSelectedChanged: {
if (isSelected)
backgroundCard.state = "CLICKED"
else
backgroundCard.state = "USUAL"
}
states: [
State {
name: "HOVER"
@@ -119,6 +131,17 @@ Rectangle {
border.color: "#029de0"
}
},
State {
name: "CLICKED"
PropertyChanges {
target: backgroundCard
color:"#029de0"
z: 4
clip: true
border.width: 1
border.color: "#606060"
}
},
State {
name: "USUAL"
PropertyChanges

File diff suppressed because it is too large Load Diff

View File

@@ -329,7 +329,7 @@ bool ConsoleProcess::startTerminalEmulator(QSettings *settings, const QString &w
// cmdLine is assumed to be detached -
// https://blogs.msdn.microsoft.com/oldnewthing/20090601-00/?p=18083
QString totalEnvironment = env.toStringList().join(QChar('\0')) + '\0';
QString totalEnvironment = env.toStringList().join(QChar(QChar::Null)) + QChar(QChar::Null);
LPVOID envPtr = (env != Environment::systemEnvironment())
? (WCHAR *)(totalEnvironment.utf16()) : nullptr;

View File

@@ -131,13 +131,13 @@ void AutoTestUnitTests::testCodeParser_data()
<< 1 << 0 << 0 << 0;
QTest::newRow("mixedAutoTestAndQuickTests")
<< QString(m_tmpDir->path() + "/mixed_atp/mixed_atp.pro")
<< 4 << 10 << 4 << 10;
<< 4 << 10 << 5 << 10;
QTest::newRow("plainAutoTestQbs")
<< QString(m_tmpDir->path() + "/plain/plain.qbs")
<< 1 << 0 << 0 << 0;
QTest::newRow("mixedAutoTestAndQuickTestsQbs")
<< QString(m_tmpDir->path() + "/mixed_atp/mixed_atp.qbs")
<< 4 << 10 << 4 << 10;
<< 4 << 10 << 5 << 10;
}
void AutoTestUnitTests::testCodeParserSwitchStartup()
@@ -184,7 +184,7 @@ void AutoTestUnitTests::testCodeParserSwitchStartup_data()
QList<int> expectedAutoTests = QList<int>() << 1 << 4 << 1 << 4;
QList<int> expectedNamedQuickTests = QList<int>() << 0 << 10 << 0 << 10;
QList<int> expectedUnnamedQuickTests = QList<int>() << 0 << 4 << 0 << 4;
QList<int> expectedUnnamedQuickTests = QList<int>() << 0 << 5 << 0 << 5;
QList<int> expectedDataTagsCount = QList<int>() << 0 << 10 << 0 << 10;
QTest::newRow("loadMultipleProjects")

View File

@@ -95,7 +95,8 @@ bool QtTestResult::isDirectParentOf(const TestResult *other, bool *needsIntermed
return qtOther->m_dataTag == m_dataTag;
}
} else if (qtOther->isTestFunction()) {
return isTestCase() || m_function == qtOther->m_function;
return isTestCase() || (m_function == qtOther->m_function
&& qtOther->result() != ResultType::TestStart);
}
}
return false;

View File

@@ -329,7 +329,8 @@ TestTreeItem *QuickTestTreeItem::find(const TestParseResult *result)
case GroupNode:
return findChildByNameAndFile(result->name, result->fileName);
case TestCase:
return name().isEmpty() ? findChildByNameAndFile(result->name, result->fileName)
return name().isEmpty() ? findChildByNameFileAndLine(result->name, result->fileName,
result->line)
: findChildByName(result->name);
default:
return nullptr;
@@ -351,7 +352,8 @@ TestTreeItem *QuickTestTreeItem::findChild(const TestTreeItem *other)
case TestCase:
if (otherType != TestFunction && otherType != TestDataFunction && otherType != TestSpecialFunction)
return nullptr;
return name().isEmpty() ? findChildByNameAndFile(other->name(), other->filePath())
return name().isEmpty() ? findChildByNameFileAndLine(other->name(), other->filePath(),
other->line())
: findChildByName(other->name());
default:
return nullptr;
@@ -368,8 +370,7 @@ bool QuickTestTreeItem::modify(const TestParseResult *result)
case TestFunction:
case TestDataFunction:
case TestSpecialFunction:
return name().isEmpty() ? modifyLineAndColumn(result)
: modifyTestFunctionContent(result);
return modifyTestFunctionContent(result);
default:
return false;
}
@@ -454,6 +455,14 @@ TestTreeItem *QuickTestTreeItem::findChildByFileNameAndType(const QString &fileP
});
}
TestTreeItem *QuickTestTreeItem::findChildByNameFileAndLine(const QString &name,
const QString &filePath, unsigned line)
{
return findFirstLevelChild([name, filePath, line](const TestTreeItem *other) {
return other->filePath() == filePath && other->line() == line && other->name() == name;
});
}
TestTreeItem *QuickTestTreeItem::unnamedQuickTests() const
{
if (type() != Root)

View File

@@ -59,6 +59,8 @@ public:
private:
TestTreeItem *findChildByFileNameAndType(const QString &filePath, const QString &name,
Type tType);
TestTreeItem *findChildByNameFileAndLine(const QString &name, const QString &filePath,
unsigned line);
TestTreeItem *unnamedQuickTests() const;
};

View File

@@ -152,8 +152,17 @@ bool TestQmlVisitor::visit(QmlJS::AST::FunctionDeclaration *ast)
else
locationAndType.m_type = TestTreeItem::TestFunction;
m_caseParseStack.top().m_functions.append(
QuickTestFunctionSpec{name.toString(), locationAndType});
const QString nameStr = name.toString();
// identical test functions inside the same file are not working - will fail at runtime
if (!Utils::anyOf(m_caseParseStack.top().m_functions,
[nameStr, locationAndType](const QuickTestFunctionSpec func) {
return func.m_locationAndType.m_type == locationAndType.m_type
&& func.m_functionName == nameStr
&& func.m_locationAndType.m_name == locationAndType.m_name;
})) {
m_caseParseStack.top().m_functions.append(
QuickTestFunctionSpec{nameStr, locationAndType});
}
}
return false;
}

View File

@@ -67,5 +67,11 @@ TestCase {
verify(true);
}
}
TestCase { // 2nd unnamed with same function name - legal as long it's a different TestCase
function test_func() {
verify(true);
}
}
}

View File

@@ -440,7 +440,6 @@ void ILocatorFilter::setConfigurable(bool configurable)
\sa prepareSearch()
\sa caseSensitivity()
\sa containsWildcard()
*/
/*!

View File

@@ -55,6 +55,11 @@ QString DiffEditorController::baseDirectory() const
return m_document->baseDirectory();
}
void DiffEditorController::setBaseDirectory(const QString &directory)
{
m_document->setBaseDirectory(directory);
}
int DiffEditorController::contextLineCount() const
{
return m_document->contextLineCount();

View File

@@ -48,6 +48,7 @@ public:
bool isReloading() const;
QString baseDirectory() const;
void setBaseDirectory(const QString &directory);
int contextLineCount() const;
bool ignoreWhitespace() const;

View File

@@ -113,7 +113,8 @@ void DiffEditorDocument::setDiffFiles(const QList<FileData> &data, const QString
const QString &startupFile)
{
m_diffFiles = data;
m_baseDirectory = directory;
if (!directory.isEmpty())
m_baseDirectory = directory;
m_startupFile = startupFile;
emit documentChanged();
}
@@ -128,6 +129,11 @@ QString DiffEditorDocument::baseDirectory() const
return m_baseDirectory;
}
void DiffEditorDocument::setBaseDirectory(const QString &directory)
{
m_baseDirectory = directory;
}
QString DiffEditorDocument::startupFile() const
{
return m_startupFile;

View File

@@ -60,6 +60,7 @@ public:
const QString &startupFile = QString());
QList<FileData> diffFiles() const;
QString baseDirectory() const;
void setBaseDirectory(const QString &directory);
QString startupFile() const;
void setDescription(const QString &description);

View File

@@ -183,11 +183,12 @@ void StatesEditorModel::renameState(int internalNodeId, const QString &newName)
return;
if (newName.isEmpty() ||! m_statesEditorView->validStateName(newName)) {
auto w = Core::AsynchronousMessageBox::warning(tr("Invalid state name"),
newName.isEmpty() ?
tr("The empty string as a name is reserved for the base state.") :
tr("Name already used in another state"));
w->setAttribute(Qt::WA_ShowModal, false);
QTimer::singleShot(0, [newName]{
auto w = Core::AsynchronousMessageBox::warning(tr("Invalid state name"),
newName.isEmpty() ?
tr("The empty string as a name is reserved for the base state.") :
tr("Name already used in another state"));
});
reset();
} else {
m_statesEditorView->renameState(internalNodeId, newName);

View File

@@ -169,7 +169,6 @@ void TimelineGraphicsScene::setWidth(int width)
void TimelineGraphicsScene::invalidateLayout()
{
m_layout->invalidate();
toolBar()->setCurrentTimeline(currentTimeline());
}
void TimelineGraphicsScene::setCurrenFrame(const QmlTimeline &timeline, qreal frame)

View File

@@ -149,6 +149,11 @@ void TimelineView::nodeReparented(const ModelNode &node,
newPropertyParent.parentModelNode())) {
QmlTimelineKeyframeGroup frames(newPropertyParent.parentModelNode());
m_timelineWidget->graphicsScene()->invalidateSectionForTarget(frames.target());
QmlTimeline currentTimeline = m_timelineWidget->graphicsScene()->currentTimeline();
if (currentTimeline.isValid())
m_timelineWidget->toolBar()->setCurrentTimeline(currentTimeline);
} else if (QmlTimelineKeyframeGroup::checkKeyframesType(
node)) { /* During copy and paste type info might be incomplete */
QmlTimelineKeyframeGroup frames(node);

View File

@@ -236,6 +236,7 @@ VcsBaseDiffEditorController::VcsBaseDiffEditorController(IDocument *document,
: DiffEditorController(document)
, d(new VcsBaseDiffEditorControllerPrivate(this, client, workingDirectory))
{
setBaseDirectory(workingDirectory);
}
VcsBaseDiffEditorController::~VcsBaseDiffEditorController()

View File

@@ -17,7 +17,7 @@ add_qtc_executable(iostool
if (TARGET iostool)
if (CMAKE_VERSION VERSION_LESS 3.13)
target_link_libraries(iostool "-Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/Info.plist")
target_link_libraries(iostool PRIVATE "-Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/Info.plist")
else()
target_link_options(iostool PRIVATE "-Wl,-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_SOURCE_DIR}/Info.plist")
endif()