forked from qt-creator/qt-creator
Revert "Revert "Merge remote-tracking branch 'origin/4.15'""
This reverts commit f0a86d4510.
Reverting a merge doesn't "undo" it - the changes would be lost
forever even with subsequent merges.
So we need to revert the revert to get the changes.
Change-Id: I65928f876f4dc886561bed17c4b2aa42b388c1e3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/iversioncontrol.h>
|
||||
#include <coreplugin/vcsmanager.h>
|
||||
#include <coreplugin/editormanager/documentmodel.h>
|
||||
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
@@ -1073,6 +1074,23 @@ QStringList Project::availableQmlPreviewTranslations(QString *errorMessage)
|
||||
});
|
||||
}
|
||||
|
||||
QList<Core::IDocument *> Project::modifiedDocuments() const
|
||||
{
|
||||
QList<Core::IDocument *> modifiedProjectDocuments;
|
||||
|
||||
for (Core::IDocument *doc : Core::DocumentModel::openedDocuments()) {
|
||||
if (doc->isModified() && isKnownFile(doc->filePath()))
|
||||
modifiedProjectDocuments.append(doc);
|
||||
}
|
||||
|
||||
return modifiedProjectDocuments;
|
||||
}
|
||||
|
||||
bool Project::isModified() const
|
||||
{
|
||||
return !modifiedDocuments().isEmpty();
|
||||
}
|
||||
|
||||
#if defined(WITH_TESTS)
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
@@ -185,6 +185,9 @@ public:
|
||||
|
||||
QStringList availableQmlPreviewTranslations(QString *errorMessage);
|
||||
|
||||
QList<Core::IDocument *> modifiedDocuments() const;
|
||||
bool isModified() const;
|
||||
|
||||
signals:
|
||||
void projectFileIsDirty(const Utils::FilePath &path);
|
||||
|
||||
|
||||
@@ -25,22 +25,23 @@
|
||||
|
||||
#include "quick2propertyeditorview.h"
|
||||
|
||||
#include "propertyeditorvalue.h"
|
||||
#include "aligndistribute.h"
|
||||
#include "annotationeditor/annotationeditor.h"
|
||||
#include "bindingeditor/actioneditor.h"
|
||||
#include "bindingeditor/bindingeditor.h"
|
||||
#include "fileresourcesmodel.h"
|
||||
#include "gradientmodel.h"
|
||||
#include "gradientpresetdefaultlistmodel.h"
|
||||
#include "gradientpresetcustomlistmodel.h"
|
||||
#include "gradientpresetdefaultlistmodel.h"
|
||||
#include "itemfiltermodel.h"
|
||||
#include "simplecolorpalettemodel.h"
|
||||
#include "bindingeditor/bindingeditor.h"
|
||||
#include "bindingeditor/actioneditor.h"
|
||||
#include "annotationeditor/annotationeditor.h"
|
||||
#include "qmlanchorbindingproxy.h"
|
||||
#include "theme.h"
|
||||
#include "aligndistribute.h"
|
||||
#include "propertyeditorcontextobject.h"
|
||||
#include "tooltip.h"
|
||||
#include "propertyeditorqmlbackend.h"
|
||||
#include "propertyeditorvalue.h"
|
||||
#include "qmlanchorbindingproxy.h"
|
||||
#include "richtexteditor/richtexteditorproxy.h"
|
||||
#include "simplecolorpalettemodel.h"
|
||||
#include "theme.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
@@ -71,6 +72,11 @@ void Quick2PropertyEditorView::registerQmlTypes()
|
||||
Tooltip::registerDeclarativeType();
|
||||
EasingCurveEditor::registerDeclarativeType();
|
||||
RichTextEditorProxy::registerDeclarativeType();
|
||||
QUrl regExpUrl = QUrl::fromLocalFile(PropertyEditorQmlBackend::propertyEditorResourcesPath()
|
||||
+ "/RegExpValidator.qml");
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
qmlRegisterType(regExpUrl, "HelperWidgets", 2, 0, "RegExpValidator");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,8 +66,4 @@ private:
|
||||
mutable QVariant m_value;
|
||||
};
|
||||
|
||||
QMLDESIGNERCORE_EXPORT QDataStream &operator<<(QDataStream &stream, const QList<PropertyContainer> &propertyContainerList);
|
||||
QMLDESIGNERCORE_EXPORT QDataStream &operator>>(QDataStream &stream, QList<PropertyContainer> &propertyContainerList);
|
||||
QMLDESIGNERCORE_EXPORT QDebug operator<<(QDebug debug, QList<PropertyContainer> &propertyContainerList);
|
||||
|
||||
} //namespace QmlDesigner
|
||||
|
||||
@@ -203,7 +203,7 @@ static bool isIdToAvoid(const QString& id)
|
||||
|
||||
static bool idContainsWrongLetter(const QString& id)
|
||||
{
|
||||
static QRegularExpression idExpr(QStringLiteral("^[a-z_][a-zA-Z0-9_]+$"));
|
||||
static QRegularExpression idExpr(QStringLiteral("^[a-z_][a-zA-Z0-9_]*$"));
|
||||
return !id.contains(idExpr);
|
||||
}
|
||||
|
||||
|
||||
@@ -113,37 +113,5 @@ QDebug operator<<(QDebug debug, const PropertyContainer &propertyContainer)
|
||||
return debug.space();
|
||||
}
|
||||
|
||||
QDataStream &operator<<(QDataStream &stream, const QList<PropertyContainer> &propertyContainerList)
|
||||
{
|
||||
stream << propertyContainerList.count();
|
||||
foreach (const PropertyContainer &propertyContainer, propertyContainerList)
|
||||
stream << propertyContainer;
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &stream, QList<PropertyContainer> &propertyContainerList)
|
||||
{
|
||||
int count;
|
||||
stream >> count;
|
||||
Q_ASSERT(count >= 0);
|
||||
for ( int i = 0; i < count; i++) {
|
||||
PropertyContainer propertyContainer;
|
||||
stream >> propertyContainer;
|
||||
propertyContainerList.append(propertyContainer);
|
||||
}
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
QDebug operator<<(QDebug debug, QList<PropertyContainer> &propertyContainerList)
|
||||
{
|
||||
foreach (const PropertyContainer &propertyContainer, propertyContainerList)
|
||||
debug << propertyContainer;
|
||||
|
||||
return debug.space();
|
||||
}
|
||||
|
||||
|
||||
} //namespace QmlDesigner
|
||||
|
||||
|
||||
@@ -55,18 +55,19 @@
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/designmode.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <coreplugin/messagebox.h>
|
||||
#include <coreplugin/modemanager.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <extensionsystem/pluginspec.h>
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <sqlitelibraryinitializer.h>
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -211,7 +212,9 @@ QmlDesignerPlugin::~QmlDesignerPlugin()
|
||||
////////////////////////////////////////////////////
|
||||
bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage/* = 0*/)
|
||||
{
|
||||
QDir{}.mkpath(Core::ICore::cacheResourcePath().toString());
|
||||
Sqlite::LibraryInitializer::initialize();
|
||||
|
||||
QDir{}.mkpath(Core::ICore::cacheResourcePath());
|
||||
|
||||
if (!Utils::HostOsInfo::canCreateOpenGLContext(errorMessage))
|
||||
return false;
|
||||
@@ -219,10 +222,8 @@ bool QmlDesignerPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
if (DesignerSettings::getValue(DesignerSettingsKey::STANDALONE_MODE).toBool())
|
||||
GenerateResource::generateMenuEntry();
|
||||
|
||||
const QString fontPath
|
||||
= Core::ICore::resourcePath(
|
||||
"qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf")
|
||||
.toString();
|
||||
QString fontPath = Core::ICore::resourcePath() +
|
||||
QStringLiteral("/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf");
|
||||
if (QFontDatabase::addApplicationFont(fontPath) < 0)
|
||||
qCWarning(qmldesignerLog) << "Could not add font " << fontPath << "to font database";
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#include "qmldebugtranslationclient.h"
|
||||
#include <qmldebug/qpacketprotocol.h>
|
||||
|
||||
#include <QUrl>
|
||||
|
||||
#ifdef FOUND_QML_DEBUG_TRANSLATION_PROTOCOL
|
||||
#include <private/qqmldebugtranslationprotocol_p.h>
|
||||
#endif
|
||||
|
||||
@@ -407,7 +407,7 @@ void CodeAssistantPrivate::finalizeProposal()
|
||||
|
||||
bool CodeAssistantPrivate::isDisplayingProposal() const
|
||||
{
|
||||
return m_proposalWidget != nullptr && m_proposalWidget->isVisible();
|
||||
return m_proposalWidget != nullptr && m_proposalWidget->proposalIsVisible();
|
||||
}
|
||||
|
||||
bool CodeAssistantPrivate::isWaitingForProposal() const
|
||||
|
||||
@@ -219,10 +219,15 @@ void FunctionHintProposalWidget::closeProposal()
|
||||
abort();
|
||||
}
|
||||
|
||||
bool FunctionHintProposalWidget::proposalIsVisible() const
|
||||
{
|
||||
return d->m_popupFrame->isVisible();
|
||||
}
|
||||
|
||||
void FunctionHintProposalWidget::abort()
|
||||
{
|
||||
qApp->removeEventFilter(this);
|
||||
if (d->m_popupFrame->isVisible())
|
||||
if (proposalIsVisible())
|
||||
d->m_popupFrame->close();
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ public:
|
||||
void updateProposal(const QString &prefix) override;
|
||||
void closeProposal() override;
|
||||
|
||||
bool proposalIsVisible() const override;
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *o, QEvent *e) override;
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@ public:
|
||||
virtual void updateProposal(const QString &prefix) = 0;
|
||||
virtual void closeProposal() = 0;
|
||||
|
||||
virtual bool proposalIsVisible() const { return isVisible(); }
|
||||
|
||||
int basePosition() const;
|
||||
void setBasePosition(int basePosition);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user