forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/7.0'"
This commit is contained in:
@@ -1739,8 +1739,22 @@ void InitialCMakeArgumentsAspect::setAllValues(const QString &values, QStringLis
|
||||
{
|
||||
QStringList arguments = values.split('\n', Qt::SkipEmptyParts);
|
||||
for (QString &arg: arguments) {
|
||||
if (arg.startsWith("-G"))
|
||||
arg.replace("-G", "-DCMAKE_GENERATOR:STRING=");
|
||||
if (arg.startsWith("-G")) {
|
||||
const QString strDash(" - ");
|
||||
const int idxDash = arg.indexOf(strDash);
|
||||
if (idxDash > 0) {
|
||||
// -GCodeBlocks - Ninja
|
||||
QString generator = "-DCMAKE_GENERATOR:STRING=" + arg.mid(idxDash + strDash.length());
|
||||
arguments.append(generator);
|
||||
|
||||
arg = arg.left(idxDash);
|
||||
arg.replace("-G", "-DCMAKE_EXTRA_GENERATOR:STRING=");
|
||||
|
||||
} else {
|
||||
// -GNinja
|
||||
arg.replace("-G", "-DCMAKE_GENERATOR:STRING=");
|
||||
}
|
||||
}
|
||||
if (arg.startsWith("-A"))
|
||||
arg.replace("-A", "-DCMAKE_GENERATOR_PLATFORM:STRING=");
|
||||
if (arg.startsWith("-T"))
|
||||
|
||||
@@ -668,11 +668,10 @@ CMakeConfig CMakeGeneratorKitAspect::generatorCMakeConfig(const ProjectExplorer:
|
||||
if (info.generator.isEmpty())
|
||||
return config;
|
||||
|
||||
if (info.extraGenerator.isEmpty())
|
||||
config << CMakeConfigItem("CMAKE_GENERATOR", info.generator.toUtf8());
|
||||
else
|
||||
config << CMakeConfigItem("CMAKE_GENERATOR",
|
||||
(info.extraGenerator + " - " + info.generator).toUtf8());
|
||||
config << CMakeConfigItem("CMAKE_GENERATOR", info.generator.toUtf8());
|
||||
|
||||
if (!info.extraGenerator.isEmpty())
|
||||
config << CMakeConfigItem("CMAKE_EXTRA_GENERATOR", info.extraGenerator.toUtf8());
|
||||
|
||||
if (!info.platform.isEmpty())
|
||||
config << CMakeConfigItem("CMAKE_GENERATOR_PLATFORM", info.platform.toUtf8());
|
||||
|
||||
@@ -406,6 +406,7 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
if (hovered) {
|
||||
if (index != m_previousIndex) {
|
||||
m_previousIndex = index;
|
||||
m_currentTagRects.clear();
|
||||
m_blurredThumbnail = QPixmap();
|
||||
m_startTime.start();
|
||||
m_currentWidget = qobject_cast<QAbstractItemView *>(
|
||||
@@ -524,10 +525,10 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
painter->drawText(tagsLabelRect, tagsLabelText);
|
||||
|
||||
painter->setPen(themeColor(Theme::Welcome_LinkColor));
|
||||
m_currentTagRects.clear();
|
||||
int emptyTagRowsLeft = 2;
|
||||
int xx = 0;
|
||||
int yy = 0;
|
||||
const bool populateTagsRects = m_currentTagRects.empty();
|
||||
for (const QString &tag : item->tags) {
|
||||
const int ww = fm.horizontalAdvance(tag) + tagsHorSpacing;
|
||||
if (xx + ww > textArea.width() - tagsLabelRect.width()) {
|
||||
@@ -539,7 +540,8 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
||||
const QRect tagRect = QRect(xx, yy, ww, tagsLabelRect.height())
|
||||
.translated(tagsLabelRect.topRight());
|
||||
painter->drawText(tagRect, tag);
|
||||
m_currentTagRects.append({ tag, tagRect.translated(rc.topLeft()) });
|
||||
if (populateTagsRects)
|
||||
m_currentTagRects.append({ tag, tagRect });
|
||||
xx += ww;
|
||||
}
|
||||
|
||||
@@ -559,16 +561,16 @@ bool ListItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
|
||||
return false;
|
||||
|
||||
if (index.isValid()) {
|
||||
const QPoint pos = mev->pos();
|
||||
if (pos.y() > option.rect.y() + TagsSeparatorY) {
|
||||
//const QStringList tags = idx.data(Tags).toStringList();
|
||||
for (const auto &it : qAsConst(m_currentTagRects)) {
|
||||
if (it.second.contains(pos))
|
||||
emit tagClicked(it.first);
|
||||
}
|
||||
} else {
|
||||
const QPoint mousePos = mev->pos() - option.rect.topLeft();
|
||||
const auto tagUnderMouse =
|
||||
Utils::findOrDefault(m_currentTagRects,
|
||||
[&mousePos](const QPair<QString, QRect> &tag) {
|
||||
return tag.second.contains(mousePos);
|
||||
});
|
||||
if (!tagUnderMouse.first.isEmpty())
|
||||
emit tagClicked(tagUnderMouse.first);
|
||||
else
|
||||
clickAction(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return QStyledItemDelegate::editorEvent(event, model, option, index);
|
||||
|
||||
@@ -3476,18 +3476,24 @@ public:
|
||||
};
|
||||
for (auto spec : classLayout) {
|
||||
const auto iter = m_headerFileCode.find(spec);
|
||||
if (iter != m_headerFileCode.end())
|
||||
insertAndIndent(m_headerFile, headerLocationFor(spec), *iter);
|
||||
if (iter != m_headerFileCode.end()) {
|
||||
const InsertionLocation loc = headerLocationFor(spec);
|
||||
m_headerFile->setOpenEditor(true, m_headerFile->position(loc.line(), loc.column()));
|
||||
insertAndIndent(m_headerFile, loc, *iter);
|
||||
}
|
||||
}
|
||||
if (!m_sourceFileCode.isEmpty() && m_sourceFileInsertionPoint.isValid())
|
||||
if (!m_sourceFileCode.isEmpty() && m_sourceFileInsertionPoint.isValid()) {
|
||||
m_sourceFile->setOpenEditor(true, m_sourceFile->position(
|
||||
m_sourceFileInsertionPoint.line(),
|
||||
m_sourceFileInsertionPoint.column()));
|
||||
insertAndIndent(m_sourceFile, m_sourceFileInsertionPoint, m_sourceFileCode);
|
||||
}
|
||||
|
||||
if (!m_headerFileChangeSet.isEmpty()) {
|
||||
m_headerFile->setChangeSet(m_headerFileChangeSet);
|
||||
m_headerFile->apply();
|
||||
}
|
||||
if (!m_sourceFileChangeSet.isEmpty()) {
|
||||
m_sourceFile->setOpenEditor();
|
||||
m_sourceFile->setChangeSet(m_sourceFileChangeSet);
|
||||
m_sourceFile->apply();
|
||||
}
|
||||
|
||||
@@ -125,12 +125,14 @@ void DiagnosticManager::showDiagnostics(const DocumentUri &uri, int version)
|
||||
if (TextDocument *doc = TextDocument::textDocumentForFilePath(filePath)) {
|
||||
QList<QTextEdit::ExtraSelection> extraSelections;
|
||||
const VersionedDiagnostics &versionedDiagnostics = m_diagnostics.value(uri);
|
||||
if (versionedDiagnostics.version.value_or(version) == version) {
|
||||
if (versionedDiagnostics.version.value_or(version) == version
|
||||
&& !versionedDiagnostics.diagnostics.isEmpty()) {
|
||||
QList<TextEditor::TextMark *> &marks = m_marks[filePath];
|
||||
const bool isProjectFile = m_client->project()
|
||||
&& m_client->project()->isKnownFile(filePath);
|
||||
for (const Diagnostic &diagnostic : versionedDiagnostics.diagnostics) {
|
||||
extraSelections << toDiagnosticsSelections(diagnostic, doc->document());
|
||||
m_marks[filePath].append(m_textMarkCreator(filePath, diagnostic, isProjectFile));
|
||||
marks.append(m_textMarkCreator(filePath, diagnostic, isProjectFile));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ QtcPlugin {
|
||||
|
||||
Depends { name: "Qt.core" }
|
||||
Depends { name: "Qt.widgets" }
|
||||
Depends { name: "Qt.testlib"; condition: qtc.testsEnabled }
|
||||
Depends { name: "Utils" }
|
||||
|
||||
Depends { name: "Core" }
|
||||
@@ -14,6 +15,8 @@ QtcPlugin {
|
||||
Depends { name: "CMakeProjectManager" }
|
||||
Depends { name: "QtSupport" }
|
||||
|
||||
Depends { name: "qtc_gtest_gmock"; condition: qtc.testsEnabled; required: false }
|
||||
|
||||
files: [
|
||||
"mcuabstractpackage.h",
|
||||
"mcupackage.cpp",
|
||||
@@ -45,4 +48,20 @@ QtcPlugin {
|
||||
"mcukitinformation.cpp",
|
||||
"mcukitinformation.h"
|
||||
]
|
||||
|
||||
Group {
|
||||
name: "McuSupport test files"
|
||||
condition: qtc.testsEnabled && (qtc_gtest_gmock.hasRepo || qtc_gtest_gmock.externalLibsPresent)
|
||||
prefix: "test/"
|
||||
files: [
|
||||
"packagemock.h",
|
||||
"unittest.cpp", "unittest.h"
|
||||
]
|
||||
}
|
||||
|
||||
Properties {
|
||||
condition: qtc.testsEnabled && (qtc_gtest_gmock.hasRepo || qtc_gtest_gmock.externalLibsPresent)
|
||||
cpp.defines: base.concat(["GOOGLE_TEST_IS_FOUND"])
|
||||
cpp.includePaths: base.concat([ "." ])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ void QbsBuildSystem::handleQbsParsingDone(bool success)
|
||||
m_qbsUpdateFutureInterface->reportCanceled();
|
||||
}
|
||||
|
||||
m_qbsProjectParser->deleteLater();
|
||||
delete m_qbsProjectParser;
|
||||
m_qbsProjectParser = nullptr;
|
||||
m_qbsUpdateFutureInterface->reportFinished();
|
||||
delete m_qbsUpdateFutureInterface;
|
||||
@@ -792,6 +792,8 @@ static void getExpandedCompilerFlags(QStringList &cFlags, QStringList &cxxFlags,
|
||||
commonFlags << "-fPIC";
|
||||
}
|
||||
cFlags = cxxFlags = commonFlags;
|
||||
cFlags << arrayToStringList(getCppProp("cFlags"));
|
||||
cxxFlags << arrayToStringList(getCppProp("cxxFlags"));
|
||||
|
||||
const auto cxxLanguageVersion = arrayToStringList(getCppProp("cxxLanguageVersion"));
|
||||
if (cxxLanguageVersion.contains("c++23"))
|
||||
|
||||
@@ -384,7 +384,9 @@ void QbsSession::insertRequestedModuleProperties(QJsonObject &request)
|
||||
"cpp.commonCompilerFlags",
|
||||
"cpp.compilerVersionMajor",
|
||||
"cpp.compilerVersionMinor",
|
||||
"cpp.cFlags",
|
||||
"cpp.cLanguageVersion",
|
||||
"cpp.cxxFlags",
|
||||
"cpp.cxxLanguageVersion",
|
||||
"cpp.cxxStandardLibrary",
|
||||
"cpp.defines",
|
||||
|
||||
@@ -190,12 +190,6 @@ static void addSpacerToToolBar(QToolBar *toolBar)
|
||||
|
||||
void DesignModeWidget::setup()
|
||||
{
|
||||
auto &actionManager = viewManager().designerActionManager();
|
||||
actionManager.createDefaultDesignerActions();
|
||||
actionManager.createDefaultAddResourceHandler();
|
||||
actionManager.createDefaultModelNodePreviewImageHandlers();
|
||||
actionManager.polishActions();
|
||||
|
||||
auto settings = Core::ICore::settings(QSettings::UserScope);
|
||||
|
||||
ADS::DockManager::setConfigFlags(ADS::DockManager::DefaultNonOpaqueConfig);
|
||||
|
||||
@@ -328,6 +328,15 @@ void QmlDesignerPlugin::extensionsInitialized()
|
||||
connect(Core::ICore::instance(), &Core::ICore::coreAboutToOpen, this, [this] {
|
||||
integrateIntoQtCreator(&d->mainWidget);
|
||||
});
|
||||
|
||||
if (QmlProjectManager::QmlProject::isQtDesignStudio())
|
||||
d->mainWidget.initialize();
|
||||
|
||||
auto &actionManager = d->viewManager.designerActionManager();
|
||||
actionManager.createDefaultDesignerActions();
|
||||
actionManager.createDefaultAddResourceHandler();
|
||||
actionManager.createDefaultModelNodePreviewImageHandlers();
|
||||
actionManager.polishActions();
|
||||
}
|
||||
|
||||
static QStringList allUiQmlFilesforCurrentProject(const Utils::FilePath &fileName)
|
||||
|
||||
@@ -775,7 +775,7 @@ void setSettingIfDifferent(const QString &key, bool value, bool &dirty)
|
||||
{
|
||||
QSettings *s = Core::ICore::settings();
|
||||
if (s->value(key, false).toBool() != value) {
|
||||
dirty = false;
|
||||
dirty = true;
|
||||
s->setValue(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
Submodule src/shared/qbs updated: 29b15e594f...c934cbfae9
@@ -260,14 +260,25 @@ bool AddDeviceOperation::test() const
|
||||
{
|
||||
QVariantMap map = initializeDevices();
|
||||
|
||||
AddDeviceData devData = {
|
||||
QLatin1String("test id"), QLatin1String("test name"),
|
||||
1, 2, QLatin1String("HW"), QLatin1String("SW"),
|
||||
QLatin1String("debugServer"), QLatin1String("ports"),
|
||||
QLatin1String("host"), QLatin1String("keyfile"), 3,
|
||||
QLatin1String("ostype"), QLatin1String("passwd"), 4, 5,
|
||||
QLatin1String("uname"), 6, KeyValuePairList()
|
||||
};
|
||||
AddDeviceData devData;
|
||||
devData.m_id = "test id";
|
||||
devData.m_displayName = "test name";
|
||||
devData.m_type = 1;
|
||||
devData.m_authentication = 2;
|
||||
devData.m_b2q_platformHardware = "HW";
|
||||
devData.m_b2q_platformSoftware = "SW";
|
||||
devData.m_debugServer = "debugServer";
|
||||
devData.m_freePortsSpec = "ports";
|
||||
devData.m_host = "host";
|
||||
devData.m_keyFile = "keyfile";
|
||||
devData.m_origin = 3;
|
||||
devData.m_osType = "ostype";
|
||||
devData.m_password = "passwd";
|
||||
devData.m_sshPort = 4;
|
||||
devData.m_timeout = 5;
|
||||
devData.m_uname = "uname";
|
||||
devData.m_version = 6;
|
||||
|
||||
QVariantMap result = devData.addDevice(map);
|
||||
QVariantMap data = result.value(QLatin1String(DEVICEMANAGER_ID)).toMap();
|
||||
QVariantList devList = data.value(QLatin1String(DEVICE_LIST_ID)).toList();
|
||||
|
||||
@@ -336,14 +336,25 @@ bool AddKitOperation::test() const
|
||||
qtMap = AddQtData{"{qt-id}", "Qt", "desktop-qt", "/usr/bin/qmake", {}, {}}.addQt(qtMap);
|
||||
|
||||
QVariantMap devMap = AddDeviceOperation::initializeDevices();
|
||||
devMap = AddDeviceData{"{dev-id}", "Dev", 0, 0,
|
||||
"HWplatform", "SWplatform",
|
||||
"localhost", "10000-11000",
|
||||
"localhost", "", 42,
|
||||
"desktop", "", 22, 10000,
|
||||
"uname", 1,
|
||||
KeyValuePairList()}
|
||||
.addDevice(devMap);
|
||||
AddDeviceData devData;
|
||||
devData.m_id = "{dev-id}";
|
||||
devData.m_displayName = "Dev";
|
||||
devData.m_type = 0;
|
||||
devData.m_authentication = 0;
|
||||
devData.m_b2q_platformHardware = "HWplatform";
|
||||
devData.m_b2q_platformSoftware = "SWplatform";
|
||||
devData.m_debugServer = "localhost";
|
||||
devData.m_freePortsSpec = "10000-11000";
|
||||
devData.m_host = "localhost";
|
||||
devData.m_keyFile = "";
|
||||
devData.m_origin = 42;
|
||||
devData.m_osType = "desktop";
|
||||
devData.m_password = "";
|
||||
devData.m_sshPort = 22;
|
||||
devData.m_timeout = 10000;
|
||||
devData.m_uname = "uname";
|
||||
devData.m_version = 1;
|
||||
devMap = devData.addDevice(devMap);
|
||||
|
||||
const QStringList env = {"TEST=1", "PATH"};
|
||||
|
||||
|
||||
@@ -106,12 +106,25 @@ bool RmKitOperation::test() const
|
||||
qtMap = AddQtData{"{qt-id}", "Qt", "desktop-qt", "/usr/bin/qmake", {}, {}}.addQt(qtMap);
|
||||
|
||||
QVariantMap devMap = AddDeviceOperation::initializeDevices();
|
||||
devMap = AddDeviceData{"{dev-id}", "Dev", 0, 0,
|
||||
"HWplatform", "SWplatform",
|
||||
"localhost", "10000-11000", "localhost", "", 42,
|
||||
"desktop", "", 22, 10000, "uname", 1,
|
||||
KeyValuePairList()}
|
||||
.addDevice(devMap);
|
||||
AddDeviceData devData;
|
||||
devData.m_id = "{dev-id}";
|
||||
devData.m_displayName = "Dev";
|
||||
devData.m_type = 0;
|
||||
devData.m_authentication = 0;
|
||||
devData.m_b2q_platformHardware = "HWplatform";
|
||||
devData.m_b2q_platformSoftware = "SWplatform";
|
||||
devData.m_debugServer = "localhost";
|
||||
devData.m_freePortsSpec = "10000-11000";
|
||||
devData.m_host = "localhost";
|
||||
devData.m_keyFile = "";
|
||||
devData.m_origin = 42;
|
||||
devData.m_osType = "desktop";
|
||||
devData.m_password = "";
|
||||
devData.m_sshPort = 22;
|
||||
devData.m_timeout = 10000;
|
||||
devData.m_uname = "uname";
|
||||
devData.m_version = 1;
|
||||
devMap = devData.addDevice(devMap);
|
||||
|
||||
QHash<QString, QString> tcs;
|
||||
tcs.insert("Cxx", "{tc-id}");
|
||||
|
||||
Reference in New Issue
Block a user