forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/9.0' into 10.0
Change-Id: I8d73198561f6ff7877d580681ca2a0018b7dc3b1
This commit is contained in:
@@ -1143,7 +1143,10 @@ void CMakeConfigurationKitAspect::setKitDefaultConfigHash(ProjectExplorer::Kit *
|
||||
expanded.value = item.expandedValue(k).toUtf8();
|
||||
return expanded;
|
||||
});
|
||||
const QByteArray kitHash = computeDefaultConfigHash(defaultConfigExpanded);
|
||||
const CMakeTool *const tool = CMakeKitAspect::cmakeTool(k);
|
||||
const QByteArray kitHash = computeDefaultConfigHash(defaultConfigExpanded,
|
||||
tool ? tool->cmakeExecutable()
|
||||
: FilePath());
|
||||
|
||||
CMakeConfig config = configuration(k);
|
||||
config.append(CMakeConfigItem(QTC_KIT_DEFAULT_CONFIG_HASH, CMakeConfigItem::INTERNAL, kitHash));
|
||||
@@ -1159,7 +1162,8 @@ CMakeConfigItem CMakeConfigurationKitAspect::kitDefaultConfigHashItem(const Proj
|
||||
});
|
||||
}
|
||||
|
||||
QByteArray CMakeConfigurationKitAspect::computeDefaultConfigHash(const CMakeConfig &config)
|
||||
QByteArray CMakeConfigurationKitAspect::computeDefaultConfigHash(const CMakeConfig &config,
|
||||
const FilePath &cmakeBinary)
|
||||
{
|
||||
const CMakeConfig defaultConfig = defaultConfiguration(nullptr);
|
||||
const QByteArray configValues = std::accumulate(defaultConfig.begin(),
|
||||
@@ -1169,7 +1173,11 @@ QByteArray CMakeConfigurationKitAspect::computeDefaultConfigHash(const CMakeConf
|
||||
const CMakeConfigItem &item) {
|
||||
return sum += config.valueOf(item.key);
|
||||
});
|
||||
return QCryptographicHash::hash(configValues, QCryptographicHash::Md5).toHex();
|
||||
return QCryptographicHash::hash(cmakeBinary.caseSensitivity() == Qt::CaseInsensitive
|
||||
? configValues.toLower()
|
||||
: configValues,
|
||||
QCryptographicHash::Md5)
|
||||
.toHex();
|
||||
}
|
||||
|
||||
QVariant CMakeConfigurationKitAspect::defaultValue(const Kit *k) const
|
||||
|
@@ -93,7 +93,8 @@ public:
|
||||
|
||||
static void setKitDefaultConfigHash(ProjectExplorer::Kit *k);
|
||||
static CMakeConfigItem kitDefaultConfigHashItem(const ProjectExplorer::Kit *k);
|
||||
static QByteArray computeDefaultConfigHash(const CMakeConfig &config);
|
||||
static QByteArray computeDefaultConfigHash(const CMakeConfig &config,
|
||||
const Utils::FilePath &cmakeBinary);
|
||||
|
||||
// KitAspect interface
|
||||
ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final;
|
||||
|
@@ -464,6 +464,35 @@ void updateCompilerPaths(CMakeConfig &config, const Environment &env)
|
||||
updateRelativePath("CMAKE_CXX_COMPILER");
|
||||
}
|
||||
|
||||
void updateConfigWithDirectoryData(CMakeConfig &config, const std::unique_ptr<DirectoryData> &data)
|
||||
{
|
||||
auto updateCompilerValue = [&config, &data](const QByteArray &key, const Utils::Id &language) {
|
||||
auto it = std::find_if(config.begin(), config.end(), [&key](const CMakeConfigItem &ci) {
|
||||
return ci.key == key;
|
||||
});
|
||||
|
||||
auto tcd = Utils::findOrDefault(data->toolChains,
|
||||
[&language](const ToolChainDescription &t) {
|
||||
return t.language == language;
|
||||
});
|
||||
|
||||
if (it != config.end() && it->value.isEmpty())
|
||||
it->value = tcd.compilerPath.toString().toUtf8();
|
||||
else
|
||||
config << CMakeConfigItem(key,
|
||||
CMakeConfigItem::FILEPATH,
|
||||
tcd.compilerPath.toString().toUtf8());
|
||||
};
|
||||
|
||||
updateCompilerValue("CMAKE_C_COMPILER", ProjectExplorer::Constants::C_LANGUAGE_ID);
|
||||
updateCompilerValue("CMAKE_CXX_COMPILER", ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
||||
|
||||
if (data->qt.qt)
|
||||
config << CMakeConfigItem("QT_QMAKE_EXECUTABLE",
|
||||
CMakeConfigItem::FILEPATH,
|
||||
data->qt.qt->qmakeFilePath().toString().toUtf8());
|
||||
}
|
||||
|
||||
QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
|
||||
QString *warningMessage) const
|
||||
{
|
||||
@@ -550,8 +579,6 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
|
||||
CMakeConfigItem::STRING,
|
||||
configurePreset.generator.value().toUtf8());
|
||||
}
|
||||
data->cmakePresetDefaultConfigHash = CMakeConfigurationKitAspect::computeDefaultConfigHash(
|
||||
config);
|
||||
|
||||
const FilePath qmake = qmakeFromCMakeCache(config);
|
||||
if (!qmake.isEmpty())
|
||||
@@ -560,6 +587,12 @@ QList<void *> CMakeProjectImporter::examineDirectory(const FilePath &importPath,
|
||||
// ToolChains:
|
||||
data->toolChains = extractToolChainsFromCache(config);
|
||||
|
||||
// Update QT_QMAKE_EXECUTABLE and CMAKE_C|XX_COMPILER config values
|
||||
updateConfigWithDirectoryData(config, data);
|
||||
|
||||
data->cmakePresetDefaultConfigHash
|
||||
= CMakeConfigurationKitAspect::computeDefaultConfigHash(config, data->cmakeBinary);
|
||||
|
||||
QByteArrayList buildConfigurationTypes = {cache.valueOf("CMAKE_BUILD_TYPE")};
|
||||
if (buildConfigurationTypes.front().isEmpty()) {
|
||||
buildConfigurationTypes.clear();
|
||||
|
@@ -252,6 +252,7 @@ QtOptionsPageWidget::QtOptionsPageWidget()
|
||||
m_nameEdit = new QLineEdit;
|
||||
|
||||
m_qmakePath = new QLabel;
|
||||
m_qmakePath->setObjectName("qmakePath"); // for Squish
|
||||
m_qmakePath->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||
m_qmakePath->setTextInteractionFlags(Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse);
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
"generator": "Ninja",
|
||||
"installDir": "../inst-${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_PREFIX_PATH": "$env{SYSTEMDRIVE}/Qt/6.3.2/mingw_64"
|
||||
"CMAKE_PREFIX_PATH": "$env{SYSTEMDRIVE}/Qt/6.4.2/mingw_64"
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
@@ -34,7 +34,7 @@
|
||||
"inherits" : "mingw",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"CMAKE_PREFIX_PATH": "$env{SystemDrive}/Qt/6.3.2/mingw_64"
|
||||
"CMAKE_PREFIX_PATH": "$env{SystemDrive}/Qt/6.4.2/mingw_64"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -56,7 +56,7 @@
|
||||
},
|
||||
"environment" : {
|
||||
"HOST_SYSTEM_NAME": "Windows",
|
||||
"QT_VERSION": "6.3.2"
|
||||
"QT_VERSION": "6.4.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -64,7 +64,7 @@
|
||||
"displayName": "Visual C++ 2019 x64 Ninja",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-${presetName}",
|
||||
"toolchainFile" : "c:/Qt/6.3.2/msvc2019_64/lib/cmake/Qt6/qt.toolchain.cmake",
|
||||
"toolchainFile" : "c:/Qt/6.4.2/msvc2019_64/lib/cmake/Qt6/qt.toolchain.cmake",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
},
|
||||
@@ -92,7 +92,7 @@
|
||||
"displayName": "Linux GCC",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build-${presetName}",
|
||||
"toolchainFile" : "$env{HOME}/Qt/6.3.2/gcc_64/lib/cmake/Qt6/qt.toolchain.cmake",
|
||||
"toolchainFile" : "$env{HOME}/Qt/6.4.2/gcc_64/lib/cmake/Qt6/qt.toolchain.cmake",
|
||||
"condition" : {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
|
@@ -418,7 +418,7 @@ def __chooseTargets__(targets, availableTargets=None, additionalFunc=None):
|
||||
"window=':Qt Creator_Core::Internal::MainWindow' "
|
||||
"summaryText='%s' visible='1'}"
|
||||
% Targets.getStringForTarget(current))
|
||||
detailsButton = getChildByClass(detailsWidget, "Utils::DetailsButton")
|
||||
detailsButton = getChildByClass(detailsWidget, "QToolButton")
|
||||
clickButton(detailsButton)
|
||||
additionalFunc()
|
||||
clickButton(detailsButton)
|
||||
|
@@ -40,17 +40,16 @@ def main():
|
||||
myCompTE = "SampleApp.SampleApp.qml\\.qrc./.MyComponent\\.qml"
|
||||
# there should be new QML file generated with name "MyComponent.qml"
|
||||
try:
|
||||
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 5000)
|
||||
# openDocument() doesn't wait for expected elements, so it might be faster than the updates
|
||||
# to the tree. Explicitly wait here to avoid timing issues. Using wFOI() instead of
|
||||
# snooze() allows to proceed earlier, just in case it can find the item.
|
||||
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView",
|
||||
addBranchWildcardToRoot(myCompTE), 2000)
|
||||
except:
|
||||
try:
|
||||
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000)
|
||||
except:
|
||||
test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer")
|
||||
saveAndExit()
|
||||
return
|
||||
test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer")
|
||||
pass
|
||||
# open MyComponent.qml file for verification
|
||||
if not openDocument(myCompTE):
|
||||
if not test.verify(openDocument(myCompTE),
|
||||
"Was MyComponent.qml properly generated in project explorer?"):
|
||||
test.fatal("Could not open MyComponent.qml.")
|
||||
saveAndExit()
|
||||
return
|
||||
|
@@ -31,6 +31,13 @@ def __checkKits__():
|
||||
mouseClick(waitForObjectItem(":Options_QListView", "Kits"))
|
||||
# check compilers
|
||||
expectedCompilers = __getExpectedCompilers__()
|
||||
llvmForBuild = os.getenv("SYSTEST_LLVM_FROM_BUILD", None)
|
||||
if llvmForBuild is not None:
|
||||
internalClangExe = os.path.join(llvmForBuild, "bin", "clang")
|
||||
if platform.system() in ("Microsoft", "Windows"):
|
||||
internalClangExe.append(".exe")
|
||||
if os.path.exists(internalClangExe):
|
||||
expectedCompilers.append(internalClangExe)
|
||||
foundCompilers = []
|
||||
foundCompilerNames = []
|
||||
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Compilers")
|
||||
|
@@ -67,8 +67,8 @@ def performEditMenu():
|
||||
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'} "
|
||||
"type='QTreeView' unnamed='1' visible='1'}")
|
||||
tree = __iterateChildren__(objInspTV.model(), None)
|
||||
expectedMenuSequence = [["menuSquishTestFile", 2], ["actionOpen", 3], ["separator", 3],
|
||||
["actionShutdown", 3]]
|
||||
expectedMenuSequence = [["menuSquishTestFile", 2], ["actionOpen", 3], ["actionShutdown", 3],
|
||||
["separator", 3]]
|
||||
seqStart = tree.index(expectedMenuSequence[0])
|
||||
test.verify(seqStart != -1 and tree[seqStart:seqStart + 4] == expectedMenuSequence,
|
||||
"Verify Object Inspector contains expected menu inclusive children.")
|
||||
|
Reference in New Issue
Block a user