Merge "Merge remote-tracking branch 'origin/7.0'"

This commit is contained in:
The Qt Project
2022-05-09 07:49:34 +00:00
11 changed files with 58 additions and 16 deletions

View File

@@ -656,17 +656,25 @@ def qdump__QFile(d, value):
# 9fc0965 and a373ffcd change the layout of the private structure # 9fc0965 and a373ffcd change the layout of the private structure
qtVersion = d.qtVersion() qtVersion = d.qtVersion()
is32bit = d.ptrSize() == 4 is32bit = d.ptrSize() == 4
if qtVersion >= 0x060000: # FIXME: values 0 are wrong. As the file name is the
# FIXME: values 0 are wrong. As the file name is the # only direct member of QFilePrivate, the offsets are
# only direct member of QFilePrivate, the offsets are # equal to sizeof(QFileDevicePrivate), the base class.
# equal to sizeof(QFileDevicePrivate), the base class. if qtVersion >= 0x060300 and d.qtTypeInfoVersion() >= 22:
if d.isWindowsTarget():
if d.isMsvcTarget():
offset = 0 if is32bit else 424
else:
offset = 0 if is32bit else 424
else:
offset = 300 if is32bit else 424
elif qtVersion >= 0x060000 and d.qtTypeInfoVersion() >= 20:
if d.isWindowsTarget(): if d.isWindowsTarget():
if d.isMsvcTarget(): if d.isMsvcTarget():
offset = 0 if is32bit else 304 offset = 0 if is32bit else 304
else: else:
offset = 0 if is32bit else 304 offset = 0 if is32bit else 304
else: else:
offset = 0 if is32bit else 304 offset = 196 if is32bit else 304
elif qtVersion >= 0x050600 and d.qtTypeInfoVersion() >= 17: elif qtVersion >= 0x050600 and d.qtTypeInfoVersion() >= 17:
# Some QRingBuffer member got removed in 8f92baf5c9 # Some QRingBuffer member got removed in 8f92baf5c9
if d.isWindowsTarget(): if d.isWindowsTarget():

View File

@@ -47,13 +47,14 @@ public:
FadingIndicatorPrivate(QWidget *parent, FadingIndicator::TextSize size) FadingIndicatorPrivate(QWidget *parent, FadingIndicator::TextSize size)
: QWidget(parent) : QWidget(parent)
{ {
setAttribute(Qt::WA_TransparentForMouseEvents, true);
m_effect = new QGraphicsOpacityEffect(this); m_effect = new QGraphicsOpacityEffect(this);
setGraphicsEffect(m_effect); setGraphicsEffect(m_effect);
m_effect->setOpacity(.999); m_effect->setOpacity(.999);
m_label = new QLabel; m_label = new QLabel;
QFont font = m_label->font(); QFont font = m_label->font();
font.setPixelSize(size == FadingIndicator::LargeText ? 45 : 22); font.setPixelSize(size == FadingIndicator::LargeText ? 30 : 18);
m_label->setFont(font); m_label->setFont(font);
QPalette pal = palette(); QPalette pal = palette();
pal.setColor(QPalette::WindowText, pal.color(QPalette::Window)); pal.setColor(QPalette::WindowText, pal.color(QPalette::Window));
@@ -67,6 +68,7 @@ public:
{ {
m_pixmap = QPixmap(); m_pixmap = QPixmap();
m_label->setText(text); m_label->setText(text);
m_effect->setOpacity(.6); // because of the fat opaque background color
layout()->setSizeConstraint(QLayout::SetFixedSize); layout()->setSizeConstraint(QLayout::SetFixedSize);
adjustSize(); adjustSize();
QWidget *parent = parentWidget(); QWidget *parent = parentWidget();

View File

@@ -402,6 +402,8 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD
this, &ClangdSettingsWidget::settingsDataChanged); this, &ClangdSettingsWidget::settingsDataChanged);
connect(&d->sizeThresholdSpinBox, qOverload<int>(&QSpinBox::valueChanged), connect(&d->sizeThresholdSpinBox, qOverload<int>(&QSpinBox::valueChanged),
this, &ClangdSettingsWidget::settingsDataChanged); this, &ClangdSettingsWidget::settingsDataChanged);
connect(&d->documentUpdateThreshold, qOverload<int>(&QSpinBox::valueChanged),
this, &ClangdSettingsWidget::settingsDataChanged);
connect(&d->clangdChooser, &Utils::PathChooser::pathChanged, connect(&d->clangdChooser, &Utils::PathChooser::pathChanged,
this, &ClangdSettingsWidget::settingsDataChanged); this, &ClangdSettingsWidget::settingsDataChanged);
} }

View File

@@ -95,6 +95,7 @@ IAssistProposal *FunctionHintProcessor::perform(const AssistInterface *interface
auto uri = DocumentUri::fromFilePath(interface->filePath()); auto uri = DocumentUri::fromFilePath(interface->filePath());
SignatureHelpRequest request((TextDocumentPositionParams(TextDocumentIdentifier(uri), Position(cursor)))); SignatureHelpRequest request((TextDocumentPositionParams(TextDocumentIdentifier(uri), Position(cursor))));
request.setResponseCallback([this](auto response) { this->handleSignatureResponse(response); }); request.setResponseCallback([this](auto response) { this->handleSignatureResponse(response); });
m_client->addAssistProcessor(this);
m_client->sendContent(request); m_client->sendContent(request);
m_currentRequest = request.id(); m_currentRequest = request.id();
return nullptr; return nullptr;

View File

@@ -1907,6 +1907,9 @@ void NodeInstanceView::updateWatcher(const QString &path)
const QString projPath = QFileInfo(model()->fileUrl().toLocalFile()).absolutePath(); const QString projPath = QFileInfo(model()->fileUrl().toLocalFile()).absolutePath();
#endif #endif
if (projPath.isEmpty())
return;
const QStringList files = m_fileSystemWatcher->files(); const QStringList files = m_fileSystemWatcher->files();
const QStringList directories = m_fileSystemWatcher->directories(); const QStringList directories = m_fileSystemWatcher->directories();
if (path.isEmpty()) { if (path.isEmpty()) {
@@ -2025,6 +2028,8 @@ void NodeInstanceView::updateQsbPathToFilterMap()
m_qsbPathToFilterMap.clear(); m_qsbPathToFilterMap.clear();
if (m_currentTarget && !m_qsbPath.isEmpty()) { if (m_currentTarget && !m_qsbPath.isEmpty()) {
const auto bs = qobject_cast<QmlProjectManager::QmlBuildSystem *>(m_currentTarget->buildSystem()); const auto bs = qobject_cast<QmlProjectManager::QmlBuildSystem *>(m_currentTarget->buildSystem());
if (!bs)
return;
const QStringList shaderToolFiles = bs->shaderToolFiles(); const QStringList shaderToolFiles = bs->shaderToolFiles();
#ifndef QMLDESIGNER_TEST #ifndef QMLDESIGNER_TEST
@@ -2032,6 +2037,9 @@ void NodeInstanceView::updateQsbPathToFilterMap()
#else #else
const QString projPath = QFileInfo(model()->fileUrl().toLocalFile()).absolutePath(); const QString projPath = QFileInfo(model()->fileUrl().toLocalFile()).absolutePath();
#endif #endif
if (projPath.isEmpty())
return;
// Parse ShaderTool files from project configuration. // Parse ShaderTool files from project configuration.
// Separate files to path and file name (called filter here as it can contain wildcards) // Separate files to path and file name (called filter here as it can contain wildcards)
// and group filters by paths. Blank path indicates project-wide file wildcard. // and group filters by paths. Blank path indicates project-wide file wildcard.
@@ -2056,6 +2064,9 @@ void NodeInstanceView::handleShaderChanges()
return; return;
const auto bs = qobject_cast<QmlProjectManager::QmlBuildSystem *>(m_currentTarget->buildSystem()); const auto bs = qobject_cast<QmlProjectManager::QmlBuildSystem *>(m_currentTarget->buildSystem());
if (!bs)
return;
QStringList baseArgs = bs->shaderToolArgs(); QStringList baseArgs = bs->shaderToolArgs();
if (baseArgs.isEmpty()) if (baseArgs.isEmpty())
return; return;

View File

@@ -210,10 +210,15 @@ TypeName QmlTimelineKeyframeGroup::valueType() const
const ModelNode targetNode = target(); const ModelNode targetNode = target();
if (targetNode.isValid() && targetNode.hasMetaInfo()) TypeName typeName;
return targetNode.metaInfo().propertyTypeName(propertyName());
return TypeName(); if (targetNode.isValid() && targetNode.hasMetaInfo())
typeName = targetNode.metaInfo().propertyTypeName(propertyName());
if (typeName.startsWith("<cpp>."))
typeName.remove(0, 6);
return typeName;
} }
bool QmlTimelineKeyframeGroup::hasKeyframe(qreal frame) bool QmlTimelineKeyframeGroup::hasKeyframe(qreal frame)

View File

@@ -50,7 +50,7 @@ const char WARNING_FOR_DESIGNER_FEATURES_IN_EDITOR[] = "WarnAboutQtQuickDesigner
const char SHOW_DEBUGVIEW[] = "ShowQtQuickDesignerDebugView"; const char SHOW_DEBUGVIEW[] = "ShowQtQuickDesignerDebugView";
const char ENABLE_DEBUGVIEW[] = "EnableQtQuickDesignerDebugView"; const char ENABLE_DEBUGVIEW[] = "EnableQtQuickDesignerDebugView";
const char ALWAYS_SAVE_IN_CRUMBLEBAR[] = "AlwaysSaveInCrumbleBar"; const char ALWAYS_SAVE_IN_CRUMBLEBAR[] = "AlwaysSaveInCrumbleBar";
const char USE_DEFAULT_PUPPET[] = "UseDefaultPuppet"; const char USE_DEFAULT_PUPPET[] = "UseDefaultQml2Puppet";
const char PUPPET_TOPLEVEL_BUILD_DIRECTORY[] = "PuppetToplevelBuildDirectory"; const char PUPPET_TOPLEVEL_BUILD_DIRECTORY[] = "PuppetToplevelBuildDirectory";
const char PUPPET_DEFAULT_DIRECTORY[] = "PuppetDefaultDirectory"; const char PUPPET_DEFAULT_DIRECTORY[] = "PuppetDefaultDirectory";
const char CONTROLS_STYLE[] = "ControlsStyle"; const char CONTROLS_STYLE[] = "ControlsStyle";

View File

@@ -653,7 +653,6 @@ void QmlDesignerPlugin::emitUsageStatistics(const QString &identifier)
{ {
QTC_ASSERT(instance(), return); QTC_ASSERT(instance(), return);
emit instance()->usageStatisticsNotifier(normalizeIdentifier(identifier)); emit instance()->usageStatisticsNotifier(normalizeIdentifier(identifier));
qDebug() << normalizeIdentifier(identifier);
} }
void QmlDesignerPlugin::emitUsageStatisticsContextAction(const QString &identifier) void QmlDesignerPlugin::emitUsageStatisticsContextAction(const QString &identifier)
@@ -680,7 +679,6 @@ void QmlDesignerPlugin::emitUsageStatisticsTime(const QString &identifier, int e
{ {
QTC_ASSERT(instance(), return); QTC_ASSERT(instance(), return);
emit instance()->usageStatisticsUsageTimer(normalizeIdentifier(identifier), elapsed); emit instance()->usageStatisticsUsageTimer(normalizeIdentifier(identifier), elapsed);
qDebug() << normalizeIdentifier(identifier);
} }
QmlDesignerPlugin *QmlDesignerPlugin::instance() QmlDesignerPlugin *QmlDesignerPlugin::instance()

View File

@@ -197,6 +197,7 @@ class StateListener : public QObject
public: public:
explicit StateListener(QObject *parent); explicit StateListener(QObject *parent);
~StateListener();
static QString windowTitleVcsTopic(const QString &filePath); static QString windowTitleVcsTopic(const QString &filePath);
@@ -221,10 +222,14 @@ StateListener::StateListener(QObject *parent) : QObject(parent)
connect(SessionManager::instance(), &SessionManager::startupProjectChanged, connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
this, &StateListener::slotStateChanged); this, &StateListener::slotStateChanged);
EditorManager::setWindowTitleVcsTopicHandler(&StateListener::windowTitleVcsTopic); EditorManager::setWindowTitleVcsTopicHandler(&StateListener::windowTitleVcsTopic);
} }
StateListener::~StateListener()
{
EditorManager::setWindowTitleVcsTopicHandler({});
}
QString StateListener::windowTitleVcsTopic(const QString &filePath) QString StateListener::windowTitleVcsTopic(const QString &filePath)
{ {
FilePath searchPath; FilePath searchPath;

View File

@@ -157,7 +157,17 @@ void tst_offsets::offsets_data()
const int qtVersion = QT_VERSION; const int qtVersion = QT_VERSION;
const quintptr qtTypeVersion = qtHookData[6]; const quintptr qtTypeVersion = qtHookData[6];
if (qtTypeVersion >= 20) if (qtTypeVersion >= 22)
#ifdef Q_OS_WIN
# ifdef Q_CC_MSVC
OFFSET_TEST(QFilePrivate, fileName) << 0 << 424;
# else // MinGW
OFFSET_TEST(QFilePrivate, fileName) << 0 << 424;
# endif
#else
OFFSET_TEST(QFilePrivate, fileName) << 300 << 424;
#endif
else if (qtTypeVersion >= 20)
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# ifdef Q_CC_MSVC # ifdef Q_CC_MSVC
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304; OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
@@ -165,7 +175,7 @@ void tst_offsets::offsets_data()
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304; OFFSET_TEST(QFilePrivate, fileName) << 0 << 304;
# endif # endif
#else #else
OFFSET_TEST(QFilePrivate, fileName) << 0 << 304; OFFSET_TEST(QFilePrivate, fileName) << 196 << 304;
#endif #endif
else if (qtVersion > 0x50600 && qtTypeVersion >= 17) else if (qtVersion > 0x50600 && qtTypeVersion >= 17)
#ifdef Q_OS_WIN #ifdef Q_OS_WIN

View File

@@ -77,7 +77,7 @@ Attention! If any of these prerequisites cannot be satisfied the tests will like
Prerequisites - debugging and analyzing Prerequisites - debugging and analyzing
----------------------------------------- -----------------------------------------
In tst_simple_debug from suite_debbugger, Creator needs to read data from an application it In tst_simple_debug from suite_debugger, Creator needs to read data from an application it
started. On Windows, this has the following prerequisites: started. On Windows, this has the following prerequisites:
Either: Either:
* have no firewall at all enabled (sure that's a bad idea) * have no firewall at all enabled (sure that's a bad idea)