forked from qt-creator/qt-creator
QmlDesigner: Merge cmake files
To improve testability external dependencies are now broken with an interface. It is a first step to test individual units without injection of source files. Task-number: QDS-7571 Change-Id: I4255c8668022f1097947e4ea5788f2a6b605365d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -11,6 +11,508 @@ add_feature_info("ProjectStorage" ${USE_PROJECTSTORAGE} "")
|
||||
env_with_default("QDS_WITH_QMLDOM" ENV_QDS_WITH_QMLDOM OFF)
|
||||
option(WITH_QMLDOM "Build with QmlDom" ${ENV_QDS_WITH_QMLDOM})
|
||||
add_feature_info("Build with QmlDom" ${WITH_QMLDOM} "")
|
||||
|
||||
add_qtc_library(QmlDesignerUtils STATIC
|
||||
DEPENDS
|
||||
Qt5::Gui
|
||||
DEFINES QMLDESIGNERUTILS_LIBRARY
|
||||
PUBLIC_DEFINES $<$<BOOL:QTC_STATIC_BUILD>:QMLDESIGNER_STATIC_LIBRARY>
|
||||
PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR}/utils
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/utils
|
||||
SOURCES
|
||||
designersettings.cpp designersettings.h
|
||||
hdrimage.cpp hdrimage.h
|
||||
qmldesignerutils_global.h
|
||||
)
|
||||
|
||||
add_qtc_library(QmlDesignerCore STATIC
|
||||
DEPENDS
|
||||
Threads::Threads
|
||||
Qt5::CorePrivate
|
||||
CPlusPlus
|
||||
Utils
|
||||
Qt5::Widgets
|
||||
Qt5::Qml
|
||||
Core
|
||||
ProjectExplorer
|
||||
QmakeProjectManager
|
||||
QmlJS
|
||||
QmlJSEditor
|
||||
QmlJSTools
|
||||
QmlProjectManager
|
||||
QtSupport
|
||||
PUBLIC_DEPENDS
|
||||
QmlDesignerUtils
|
||||
TextEditor
|
||||
Sqlite
|
||||
DEFINES QMLDESIGNERCORE_LIBRARY QMLDESIGNERUTILS_STATIC_LIBRARY
|
||||
INCLUDES
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
PUBLIC_INCLUDES
|
||||
${CMAKE_CURRENT_LIST_DIR}/designercore
|
||||
${CMAKE_CURRENT_LIST_DIR}/designercore/include
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/designercore
|
||||
SOURCES
|
||||
rewritertransaction.cpp
|
||||
rewritertransaction.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
CONDITION UNIX AND NOT APPLE
|
||||
PUBLIC_DEPENDS rt
|
||||
)
|
||||
|
||||
set(UI_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/designercore/instances/puppetbuildprogressdialog.ui
|
||||
${CMAKE_CURRENT_LIST_DIR}/designercore/instances/puppetdialog.ui
|
||||
)
|
||||
qt_wrap_ui(UI_SOURCES ${UI_FILES})
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
INCLUDES ${CMAKE_CURRENT_BINARY_DIR}
|
||||
SOURCES
|
||||
${UI_SOURCES}
|
||||
${UI_FILES}
|
||||
)
|
||||
set_source_files_properties(${UI_FILES} PROPERTIES SKIP_AUTOUIC ON)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
INCLUDES ${CMAKE_CURRENT_LIST_DIR}/designercore/exceptions
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/designercore/exceptions
|
||||
SOURCES
|
||||
exception.cpp
|
||||
invalidargumentexception.cpp
|
||||
invalididexception.cpp
|
||||
invalidmetainfoexception.cpp
|
||||
invalidmodelnodeexception.cpp
|
||||
invalidmodelstateexception.cpp
|
||||
invalidpropertyexception.cpp
|
||||
invalidqmlsourceexception.cpp
|
||||
invalidreparentingexception.cpp
|
||||
invalidslideindexexception.cpp
|
||||
notimplementedexception.cpp
|
||||
removebasestateexception.cpp
|
||||
rewritingexception.cpp
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
INCLUDES ${CMAKE_CURRENT_LIST_DIR}/designercore/filemanager
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/designercore/filemanager
|
||||
SOURCES
|
||||
addarraymembervisitor.cpp
|
||||
addarraymembervisitor.h
|
||||
addobjectvisitor.cpp
|
||||
addobjectvisitor.h
|
||||
addpropertyvisitor.cpp
|
||||
addpropertyvisitor.h
|
||||
astobjecttextextractor.cpp
|
||||
astobjecttextextractor.h
|
||||
changeimportsvisitor.cpp
|
||||
changeimportsvisitor.h
|
||||
changeobjecttypevisitor.cpp
|
||||
changeobjecttypevisitor.h
|
||||
changepropertyvisitor.cpp
|
||||
changepropertyvisitor.h
|
||||
firstdefinitionfinder.cpp
|
||||
firstdefinitionfinder.h
|
||||
moveobjectbeforeobjectvisitor.cpp
|
||||
moveobjectbeforeobjectvisitor.h
|
||||
moveobjectvisitor.cpp
|
||||
moveobjectvisitor.h
|
||||
objectlengthcalculator.cpp
|
||||
objectlengthcalculator.h
|
||||
qmlrefactoring.cpp
|
||||
qmlrefactoring.h
|
||||
qmlrewriter.cpp
|
||||
qmlrewriter.h
|
||||
removepropertyvisitor.cpp
|
||||
removepropertyvisitor.h
|
||||
removeuiobjectmembervisitor.cpp
|
||||
removeuiobjectmembervisitor.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
INCLUDES ${CMAKE_CURRENT_LIST_DIR}/designercore/imagecache
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/designercore/imagecache
|
||||
SOURCES
|
||||
asynchronousexplicitimagecache.cpp
|
||||
asynchronousimagecache.cpp
|
||||
asynchronousimagefactory.cpp
|
||||
asynchronousimagefactory.h
|
||||
imagecachecollector.cpp
|
||||
imagecachecollector.h
|
||||
imagecachedispatchcollector.h
|
||||
imagecachecollectorinterface.h
|
||||
imagecacheconnectionmanager.cpp
|
||||
imagecacheconnectionmanager.h
|
||||
imagecachefontcollector.cpp
|
||||
imagecachefontcollector.h
|
||||
imagecachegenerator.cpp
|
||||
imagecachegenerator.h
|
||||
imagecachegeneratorinterface.h
|
||||
imagecachestorage.h
|
||||
imagecachestorageinterface.h
|
||||
meshimagecachecollector.cpp
|
||||
meshimagecachecollector.h
|
||||
synchronousimagecache.cpp
|
||||
timestampprovider.cpp
|
||||
timestampprovider.h
|
||||
timestampproviderinterface.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/designercore/include
|
||||
SOURCES
|
||||
abstractproperty.h
|
||||
abstractview.h
|
||||
anchorline.h
|
||||
annotation.h
|
||||
asynchronousexplicitimagecache.h
|
||||
asynchronousimagecache.h
|
||||
auxiliarydata.h
|
||||
auxiliarydataproperties.h
|
||||
basetexteditmodifier.h
|
||||
bindingproperty.h
|
||||
componenttextmodifier.h
|
||||
customnotifications.h
|
||||
documentmessage.h
|
||||
enumerationmetainfo.h
|
||||
exception.h
|
||||
externaldependenciesinterface.h
|
||||
forwardview.h
|
||||
imagecacheauxiliarydata.h
|
||||
import.h
|
||||
invalidargumentexception.h
|
||||
invalididexception.h
|
||||
invalidmetainfoexception.h
|
||||
invalidmodelnodeexception.h
|
||||
invalidmodelstateexception.h
|
||||
invalidpropertyexception.h
|
||||
invalidqmlsourceexception.h
|
||||
invalidreparentingexception.h
|
||||
invalidslideindexexception.h
|
||||
itemlibraryinfo.h
|
||||
mathutils.h
|
||||
metainfo.h
|
||||
metainforeader.h
|
||||
model.h
|
||||
modelmerger.h
|
||||
modelnode.h
|
||||
modelnodepositionstorage.h
|
||||
nodeabstractproperty.h
|
||||
nodehints.h
|
||||
nodeinstance.h
|
||||
nodeinstanceview.h
|
||||
nodelistproperty.h
|
||||
nodemetainfo.h
|
||||
nodeproperty.h
|
||||
notimplementedexception.h
|
||||
plaintexteditmodifier.h
|
||||
propertycontainer.h
|
||||
propertymetainfo.h
|
||||
propertynode.h
|
||||
propertyparser.h
|
||||
qmlanchors.h
|
||||
qmlchangeset.h
|
||||
qmlconnections.h
|
||||
qmldesignercorelib_global.h
|
||||
qmlitemnode.h
|
||||
qmlmodelnodefacade.h
|
||||
qmlobjectnode.h
|
||||
qmlstate.h
|
||||
qmltimeline.h
|
||||
qmltimelinekeyframegroup.h
|
||||
removebasestateexception.h
|
||||
rewriterview.h
|
||||
rewritingexception.h
|
||||
signalhandlerproperty.h
|
||||
stylesheetmerger.h
|
||||
subcomponentmanager.h
|
||||
synchronousimagecache.h
|
||||
textmodifier.h
|
||||
variantproperty.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
INCLUDES
|
||||
${CMAKE_CURRENT_LIST_DIR}/designercore/metainfo
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/designercore/metainfo
|
||||
SOURCES
|
||||
itemlibraryinfo.cpp
|
||||
metainfo.cpp
|
||||
metainforeader.cpp
|
||||
nodehints.cpp
|
||||
nodemetainfo.cpp
|
||||
subcomponentmanager.cpp
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
PUBLIC_INCLUDES ${CMAKE_CURRENT_LIST_DIR}/designercore/instances
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/designercore/instances
|
||||
SOURCES
|
||||
baseconnectionmanager.cpp
|
||||
baseconnectionmanager.h
|
||||
connectionmanager.cpp
|
||||
connectionmanager.h
|
||||
connectionmanagerinterface.cpp
|
||||
connectionmanagerinterface.h
|
||||
nodeinstance.cpp
|
||||
nodeinstanceserverproxy.cpp
|
||||
nodeinstanceserverproxy.h
|
||||
nodeinstanceview.cpp
|
||||
puppetbuildprogressdialog.cpp
|
||||
puppetbuildprogressdialog.h
|
||||
puppetstarter.cpp
|
||||
puppetstarter.h
|
||||
puppetdialog.cpp
|
||||
puppetdialog.h
|
||||
qprocessuniqueptr.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
INCLUDES ${CMAKE_CURRENT_LIST_DIR}/designercore/model
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/designercore/model
|
||||
SOURCES
|
||||
abstractproperty.cpp
|
||||
abstractview.cpp
|
||||
anchorline.cpp
|
||||
annotation.cpp
|
||||
bindingproperty.cpp
|
||||
componenttextmodifier.cpp
|
||||
documentmessage.cpp
|
||||
import.cpp
|
||||
internalbindingproperty.cpp
|
||||
internalbindingproperty.h
|
||||
internalnode.cpp
|
||||
internalnode_p.h
|
||||
internalnodeabstractproperty.cpp
|
||||
internalnodeabstractproperty.h
|
||||
internalnodelistproperty.cpp
|
||||
internalnodelistproperty.h
|
||||
internalnodeproperty.cpp
|
||||
internalnodeproperty.h
|
||||
internalproperty.cpp
|
||||
internalproperty.h
|
||||
internalsignalhandlerproperty.cpp
|
||||
internalsignalhandlerproperty.h
|
||||
internalvariantproperty.cpp
|
||||
internalvariantproperty.h
|
||||
model.cpp
|
||||
model_p.h
|
||||
modelmerger.cpp
|
||||
modelnode.cpp
|
||||
modelnodepositionrecalculator.cpp
|
||||
modelnodepositionrecalculator.h
|
||||
modelnodepositionstorage.cpp
|
||||
modeltotextmerger.cpp
|
||||
modeltotextmerger.h
|
||||
nodeabstractproperty.cpp
|
||||
nodelistproperty.cpp
|
||||
nodeproperty.cpp
|
||||
plaintexteditmodifier.cpp
|
||||
propertycontainer.cpp
|
||||
propertynode.cpp
|
||||
propertyparser.cpp
|
||||
qml3dnode.cpp
|
||||
qmlanchors.cpp
|
||||
qmlchangeset.cpp
|
||||
qmlconnections.cpp
|
||||
qmlitemnode.cpp
|
||||
qmlmodelnodefacade.cpp
|
||||
qmlobjectnode.cpp
|
||||
qmlstate.cpp
|
||||
qmltextgenerator.cpp
|
||||
qmltextgenerator.h
|
||||
qmltimeline.cpp
|
||||
qmltimelinekeyframegroup.cpp
|
||||
qmlvisualnode.cpp
|
||||
rewriteaction.cpp
|
||||
rewriteaction.h
|
||||
rewriteactioncompressor.cpp
|
||||
rewriteactioncompressor.h
|
||||
rewriterview.cpp
|
||||
signalhandlerproperty.cpp
|
||||
stylesheetmerger.cpp
|
||||
textmodifier.cpp
|
||||
texttomodelmerger.cpp
|
||||
texttomodelmerger.h
|
||||
variantproperty.cpp
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
INCLUDES ${CMAKE_CURRENT_LIST_DIR}/designercore/pluginmanager
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/designercore/pluginmanager
|
||||
SOURCES
|
||||
widgetpluginmanager.cpp
|
||||
widgetpluginmanager.h
|
||||
widgetpluginpath.cpp
|
||||
widgetpluginpath.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet
|
||||
INCLUDES
|
||||
${CMAKE_CURRENT_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/commands
|
||||
${CMAKE_CURRENT_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/container
|
||||
PUBLIC_INCLUDES
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/interfaces"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/types"
|
||||
SOURCES
|
||||
commands/captureddatacommand.h
|
||||
commands/changeauxiliarycommand.cpp
|
||||
commands/changeauxiliarycommand.h
|
||||
commands/changebindingscommand.cpp
|
||||
commands/changebindingscommand.h
|
||||
commands/changefileurlcommand.cpp
|
||||
commands/changefileurlcommand.h
|
||||
commands/changeidscommand.cpp
|
||||
commands/changeidscommand.h
|
||||
commands/changelanguagecommand.cpp
|
||||
commands/changelanguagecommand.h
|
||||
commands/changenodesourcecommand.cpp
|
||||
commands/changenodesourcecommand.h
|
||||
commands/changepreviewimagesizecommand.cpp
|
||||
commands/changepreviewimagesizecommand.h
|
||||
commands/changeselectioncommand.cpp
|
||||
commands/changeselectioncommand.h
|
||||
commands/changestatecommand.cpp
|
||||
commands/changestatecommand.h
|
||||
commands/changevaluescommand.cpp
|
||||
commands/changevaluescommand.h
|
||||
commands/childrenchangedcommand.cpp
|
||||
commands/childrenchangedcommand.h
|
||||
commands/clearscenecommand.cpp
|
||||
commands/clearscenecommand.h
|
||||
commands/completecomponentcommand.cpp
|
||||
commands/completecomponentcommand.h
|
||||
commands/componentcompletedcommand.cpp
|
||||
commands/componentcompletedcommand.h
|
||||
commands/createinstancescommand.cpp
|
||||
commands/createinstancescommand.h
|
||||
commands/createscenecommand.cpp
|
||||
commands/createscenecommand.h
|
||||
commands/debugoutputcommand.cpp
|
||||
commands/debugoutputcommand.h
|
||||
commands/endpuppetcommand.cpp
|
||||
commands/endpuppetcommand.h
|
||||
commands/informationchangedcommand.cpp
|
||||
commands/informationchangedcommand.h
|
||||
commands/nanotracecommand.cpp
|
||||
commands/nanotracecommand.h
|
||||
commands/inputeventcommand.cpp
|
||||
commands/inputeventcommand.h
|
||||
commands/pixmapchangedcommand.cpp
|
||||
commands/pixmapchangedcommand.h
|
||||
commands/puppetalivecommand.cpp
|
||||
commands/puppetalivecommand.h
|
||||
commands/puppettocreatorcommand.cpp
|
||||
commands/puppettocreatorcommand.h
|
||||
commands/removeinstancescommand.cpp
|
||||
commands/removeinstancescommand.h
|
||||
commands/removepropertiescommand.cpp
|
||||
commands/removepropertiescommand.h
|
||||
commands/removesharedmemorycommand.cpp
|
||||
commands/removesharedmemorycommand.h
|
||||
commands/reparentinstancescommand.cpp
|
||||
commands/reparentinstancescommand.h
|
||||
commands/requestmodelnodepreviewimagecommand.cpp
|
||||
commands/requestmodelnodepreviewimagecommand.h
|
||||
commands/scenecreatedcommand.h
|
||||
commands/statepreviewimagechangedcommand.cpp
|
||||
commands/statepreviewimagechangedcommand.h
|
||||
commands/synchronizecommand.h
|
||||
commands/tokencommand.cpp
|
||||
commands/tokencommand.h
|
||||
commands/update3dviewstatecommand.cpp
|
||||
commands/update3dviewstatecommand.h
|
||||
commands/valueschangedcommand.cpp
|
||||
commands/valueschangedcommand.h
|
||||
commands/view3dactioncommand.cpp
|
||||
commands/view3dactioncommand.h
|
||||
|
||||
container/addimportcontainer.cpp
|
||||
container/addimportcontainer.h
|
||||
container/idcontainer.cpp
|
||||
container/idcontainer.h
|
||||
container/imagecontainer.cpp
|
||||
container/imagecontainer.h
|
||||
container/informationcontainer.cpp
|
||||
container/informationcontainer.h
|
||||
container/instancecontainer.cpp
|
||||
container/instancecontainer.h
|
||||
container/mockuptypecontainer.cpp
|
||||
container/mockuptypecontainer.h
|
||||
container/propertyabstractcontainer.cpp
|
||||
container/propertyabstractcontainer.h
|
||||
container/propertybindingcontainer.cpp
|
||||
container/propertybindingcontainer.h
|
||||
container/propertyvaluecontainer.cpp
|
||||
container/propertyvaluecontainer.h
|
||||
container/reparentcontainer.cpp
|
||||
container/reparentcontainer.h
|
||||
container/sharedmemory.h
|
||||
|
||||
interfaces/commondefines.h
|
||||
interfaces/nodeinstanceclientinterface.h
|
||||
interfaces/nodeinstanceglobal.h
|
||||
interfaces/nodeinstanceserverinterface.cpp
|
||||
interfaces/nodeinstanceserverinterface.h
|
||||
|
||||
types/enumeration.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
SOURCES_PREFIX designercore/projectstorage
|
||||
PUBLIC_INCLUDES designercore/projectstorage
|
||||
SOURCES
|
||||
commontypecache.h
|
||||
directorypathcompressor.h
|
||||
filesysteminterface.h
|
||||
filesystem.cpp filesystem.h
|
||||
filestatus.h
|
||||
filestatuscache.cpp filestatuscache.h
|
||||
nonlockingmutex.h
|
||||
projectstorageinterface.h
|
||||
projectstoragefwd.h
|
||||
projectstorageinfotypes.h
|
||||
projectstoragepathwatcher.h
|
||||
projectstoragepathwatcherinterface.h
|
||||
projectstoragepathwatchernotifierinterface.h
|
||||
projectstoragepathwatcher.h
|
||||
projectstoragepathwatchertypes.h
|
||||
projectstorageprinting.h
|
||||
projectstoragetypes.h
|
||||
projectstorageupdater.cpp projectstorageupdater.h
|
||||
projectstorage.cpp projectstorage.h
|
||||
sourcepath.h
|
||||
sourcepathcache.h
|
||||
sourcepathcache.h
|
||||
sourcepathcachetypes.h
|
||||
sourcepathview.h
|
||||
storagecache.h
|
||||
storagecacheentry.h
|
||||
storagecachefwd.h
|
||||
qmldocumentparserinterface.h
|
||||
qmltypesparserinterface.h
|
||||
qmltypesparser.cpp qmltypesparser.h
|
||||
qmldocumentparser.cpp qmldocumentparser.h
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
CONDITION UNIX
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/container
|
||||
SOURCES sharedmemory_unix.cpp
|
||||
)
|
||||
|
||||
extend_qtc_library(QmlDesignerCore
|
||||
CONDITION NOT UNIX
|
||||
SOURCES_PREFIX ${CMAKE_CURRENT_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/container
|
||||
SOURCES sharedmemory_qt.cpp
|
||||
)
|
||||
|
||||
file(GLOB PROJECTSTORAGE_EXCLUDED_SOURCES designercore/projectstorage/*.cpp)
|
||||
set_property(SOURCE ${PROJECTSTORAGE_EXCLUDED_SOURCES} PROPERTY SKIP_AUTOMOC ON)
|
||||
|
||||
add_qtc_plugin(QmlDesigner
|
||||
CONDITION Qt5_VERSION VERSION_GREATER_EQUAL 6.2.0 AND TARGET Qt5::QuickWidgets AND TARGET Qt5::Svg
|
||||
DEPENDS
|
||||
@@ -20,17 +522,30 @@ add_qtc_plugin(QmlDesigner
|
||||
IDE_LIBRARY_BASENAME=\"${IDE_LIBRARY_BASE_PATH}\"
|
||||
SHARE_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/../../../share/qtcreator/qmldesigner"
|
||||
$<$<BOOL:${USE_PROJECTSTORAGE}>:QDS_USE_PROJECTSTORAGE>
|
||||
QMLDESIGNER_LIBRARY QMLDESIGNERCORE_STATIC_LIBRARY QMLDESIGNERUTILS_STATIC_LIBRARY
|
||||
INCLUDES
|
||||
${CMAKE_CURRENT_LIST_DIR}/components
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/assetslibrary
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/debugview
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/edit3d
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/formeditor
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/integration
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/itemlibrary
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/materialbrowser
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/materialeditor
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/navigator
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/propertyeditor
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/stateseditor
|
||||
${CMAKE_CURRENT_LIST_DIR}/components/texteditor
|
||||
PUBLIC_INCLUDES
|
||||
"${CMAKE_CURRENT_LIST_DIR}"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/designercore/include"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/interfaces"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/../../../share/qtcreator/qml/qmlpuppet/types"
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
PUBLIC_DEPENDS
|
||||
QmlDesignerCore
|
||||
PLUGIN_DEPENDS
|
||||
Core ProjectExplorer QmlJSEditor QmakeProjectManager QmlProjectManager
|
||||
QtSupport TextEditor
|
||||
QtSupport
|
||||
PLUGIN_RECOMMENDS QmlPreview
|
||||
SOURCES
|
||||
designersettings.cpp designersettings.h
|
||||
designmodecontext.cpp designmodecontext.h
|
||||
designmodewidget.cpp designmodewidget.h
|
||||
documentmanager.cpp documentmanager.h
|
||||
@@ -39,9 +554,11 @@ add_qtc_plugin(QmlDesigner
|
||||
generateresource.cpp generateresource.h
|
||||
openuiqmlfiledialog.cpp openuiqmlfiledialog.h openuiqmlfiledialog.ui
|
||||
puppetenvironmentbuilder.cpp puppetenvironmentbuilder.h
|
||||
qmldesigner_global.h
|
||||
qmldesignerconstants.h
|
||||
qmldesignericons.h
|
||||
qmldesignerplugin.cpp qmldesignerplugin.h
|
||||
qmldesignerexternaldependencies.cpp qmldesignerexternaldependencies.h
|
||||
qmldesignerprojectmanager.cpp qmldesignerprojectmanager.h
|
||||
settingspage.cpp settingspage.h settingspage.ui
|
||||
shortcutmanager.cpp shortcutmanager.h
|
||||
@@ -57,9 +574,6 @@ add_qtc_plugin(QmlDesigner
|
||||
QMLDESIGNER_PLUGIN_PATH "${QmlDesignerPluginInstallPrefix}"
|
||||
)
|
||||
|
||||
include(qmldesignercore.cmake)
|
||||
extend_with_qmldesigner_core(QmlDesigner)
|
||||
|
||||
function(get_and_add_as_subdirectory name repository git_tag build_dir source_dir source_subdir)
|
||||
# make the configuration in the build dir
|
||||
file(MAKE_DIRECTORY ${build_dir}/${name})
|
||||
@@ -191,6 +705,14 @@ add_qtc_plugin(qtquickplugin
|
||||
|
||||
add_subdirectory(studioplugin)
|
||||
|
||||
extend_qtc_plugin(QmlDesigner
|
||||
SOURCES_PREFIX components
|
||||
PUBLIC_INCLUDES components
|
||||
DEFINES QMLDESIGNERCOMPONENTS_LIBRARY
|
||||
SOURCES
|
||||
qmldesignercomponents_global.h
|
||||
)
|
||||
|
||||
extend_qtc_plugin(QmlDesigner
|
||||
SOURCES_PREFIX components/componentcore
|
||||
PUBLIC_INCLUDES components/componentcore
|
||||
@@ -217,7 +739,6 @@ extend_qtc_plugin(QmlDesigner
|
||||
selectioncontext.cpp selectioncontext.h
|
||||
theme.cpp theme.h
|
||||
zoomaction.cpp zoomaction.h
|
||||
hdrimage.cpp hdrimage.h
|
||||
svgpasteaction.cpp svgpasteaction.h
|
||||
viewmanager.cpp viewmanager.h
|
||||
)
|
||||
@@ -472,41 +993,6 @@ extend_qtc_plugin(QmlDesigner
|
||||
|
||||
)
|
||||
|
||||
extend_qtc_plugin(QmlDesigner
|
||||
SOURCES_PREFIX designercore/projectstorage
|
||||
SOURCES
|
||||
commontypecache.h
|
||||
directorypathcompressor.h
|
||||
filesysteminterface.h
|
||||
filesystem.cpp filesystem.h
|
||||
filestatus.h
|
||||
filestatuscache.cpp filestatuscache.h
|
||||
nonlockingmutex.h
|
||||
projectstorageinterface.h
|
||||
projectstoragefwd.h
|
||||
projectstorageinfotypes.h
|
||||
projectstoragepathwatcher.h
|
||||
projectstoragepathwatcherinterface.h
|
||||
projectstoragepathwatchernotifierinterface.h
|
||||
projectstoragepathwatcher.h
|
||||
projectstoragepathwatchertypes.h
|
||||
projectstorageprinting.h
|
||||
projectstoragetypes.h
|
||||
projectstorageupdater.cpp projectstorageupdater.h
|
||||
sourcepath.h
|
||||
sourcepathcache.h
|
||||
sourcepathcache.h
|
||||
sourcepathcachetypes.h
|
||||
sourcepathview.h
|
||||
storagecache.h
|
||||
storagecacheentry.h
|
||||
storagecachefwd.h
|
||||
qmldocumentparserinterface.h
|
||||
qmltypesparserinterface.h
|
||||
qmltypesparser.cpp qmltypesparser.h
|
||||
qmldocumentparser.cpp qmldocumentparser.h
|
||||
)
|
||||
|
||||
extend_qtc_plugin(QmlDesigner
|
||||
SOURCES_PREFIX designercore/instances
|
||||
SOURCES
|
||||
|
@@ -269,7 +269,8 @@ void AssetExporter::preprocessQmlFile(const Utils::FilePath &path)
|
||||
textEdit.setPlainText(QString::fromUtf8(reader.data()));
|
||||
NotIndentingTextEditModifier *modifier = new NotIndentingTextEditModifier(&textEdit);
|
||||
modifier->setParent(model.get());
|
||||
auto rewriterView = std::make_unique<RewriterView>(QmlDesigner::RewriterView::Validate);
|
||||
auto rewriterView = std::make_unique<RewriterView>(m_view->externalDependencies(),
|
||||
QmlDesigner::RewriterView::Validate);
|
||||
rewriterView->setCheckSemanticErrors(false);
|
||||
rewriterView->setTextModifier(modifier);
|
||||
model->attachView(rewriterView.get());
|
||||
|
@@ -43,7 +43,8 @@ AssetExporterPlugin::AssetExporterPlugin()
|
||||
|
||||
auto *designerPlugin = QmlDesigner::QmlDesignerPlugin::instance();
|
||||
auto &viewManager = designerPlugin->viewManager();
|
||||
m_view = viewManager.registerView(std::make_unique<AssetExporterView>());
|
||||
m_view = viewManager.registerView(std::make_unique<AssetExporterView>(
|
||||
designerPlugin->externalDependenciesForPluginInitializationOnly()));
|
||||
|
||||
// Add dumper templates for factory instantiation.
|
||||
Component::addNodeDumper<ItemNodeDumper>();
|
||||
|
@@ -23,8 +23,9 @@ const int MinRetry = 2;
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
AssetExporterView::AssetExporterView()
|
||||
: m_timer(this)
|
||||
AssetExporterView::AssetExporterView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView(externalDependencies)
|
||||
, m_timer(this)
|
||||
{
|
||||
m_timer.setInterval(RetryIntervalMs);
|
||||
// We periodically check if file is loaded.
|
||||
|
@@ -29,7 +29,7 @@ public:
|
||||
Loaded
|
||||
};
|
||||
|
||||
AssetExporterView();
|
||||
AssetExporterView(ExternalDependenciesInterface &externalDependencies);
|
||||
|
||||
bool loadQmlFile(const Utils::FilePath &path, uint timeoutSecs = 10);
|
||||
bool saveQmlFile(QString *error) const;
|
||||
|
@@ -4,8 +4,8 @@
|
||||
#include "assetslibraryiconprovider.h"
|
||||
#include "assetslibrarymodel.h"
|
||||
|
||||
#include <hdrimage.h>
|
||||
#include <theme.h>
|
||||
#include <utils/hdrimage.h>
|
||||
#include <utils/stylehelper.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
@@ -7,10 +7,10 @@
|
||||
|
||||
#include <designersettings.h>
|
||||
#include <documentmanager.h>
|
||||
#include <hdrimage.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
#include <synchronousimagecache.h>
|
||||
#include <theme.h>
|
||||
#include <utils/hdrimage.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
|
@@ -43,7 +43,9 @@ public:
|
||||
SynchronousImageCache synchronousFontImageCache{storage, timeStampProvider, fontCollector};
|
||||
};
|
||||
|
||||
AssetsLibraryView::AssetsLibraryView() {}
|
||||
AssetsLibraryView::AssetsLibraryView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
{}
|
||||
|
||||
AssetsLibraryView::~AssetsLibraryView()
|
||||
{}
|
||||
|
@@ -19,7 +19,7 @@ class AssetsLibraryView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AssetsLibraryView();
|
||||
AssetsLibraryView(ExternalDependenciesInterface &externalDependencies);
|
||||
~AssetsLibraryView() override;
|
||||
|
||||
bool hasWidget() const override;
|
||||
|
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT DefaultAction : public QAction
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT DefaultAction : public QAction
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -25,7 +25,7 @@ protected:
|
||||
SelectionContext m_selectionContext;
|
||||
};
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT AbstractAction : public ActionInterface
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT AbstractAction : public ActionInterface
|
||||
{
|
||||
public:
|
||||
AbstractAction(const QString &description = QString());
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT AbstractActionGroup : public ActionInterface
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT AbstractActionGroup : public ActionInterface
|
||||
{
|
||||
public:
|
||||
AbstractActionGroup(const QString &displayName);
|
||||
|
@@ -12,7 +12,7 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT ActionInterface
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT ActionInterface
|
||||
{
|
||||
public:
|
||||
enum Type {
|
||||
|
@@ -78,7 +78,8 @@ private:
|
||||
QToolBar *m_toolBar;
|
||||
};
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT DesignerActionManager {
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT DesignerActionManager
|
||||
{
|
||||
public:
|
||||
DesignerActionManager(DesignerActionManagerView *designerActionManagerView);
|
||||
~DesignerActionManager();
|
||||
|
@@ -11,8 +11,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
DesignerActionManagerView::DesignerActionManagerView()
|
||||
: m_designerActionManager(this)
|
||||
DesignerActionManagerView::DesignerActionManagerView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_designerActionManager(this)
|
||||
, m_isInRewriterTransaction(false)
|
||||
, m_setupContextDirty(false)
|
||||
{
|
||||
|
@@ -16,7 +16,7 @@ class DesignerActionManagerView : public AbstractView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DesignerActionManagerView();
|
||||
DesignerActionManagerView(ExternalDependenciesInterface &externalDependencies);
|
||||
|
||||
void modelAttached(Model *model) override;
|
||||
void modelAboutToBeDetached(Model *model) override;
|
||||
|
@@ -578,10 +578,14 @@ static QString toUpper(const QString &signal)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void addSignal(const QString &typeName, const QString &itemId, const QString &signalName, bool isRootModelNode)
|
||||
static void addSignal(const QString &typeName,
|
||||
const QString &itemId,
|
||||
const QString &signalName,
|
||||
bool isRootModelNode,
|
||||
ExternalDependenciesInterface &externanDependencies)
|
||||
{
|
||||
auto model = Model::create("Item", 2, 0);
|
||||
RewriterView rewriterView(RewriterView::Amend);
|
||||
RewriterView rewriterView(externanDependencies, RewriterView::Amend);
|
||||
|
||||
auto textEdit = qobject_cast<TextEditor::TextEditorWidget*>
|
||||
(Core::EditorManager::currentEditor()->widget());
|
||||
@@ -700,12 +704,19 @@ void addSignalHandlerOrGotoImplementation(const SelectionContext &selectionState
|
||||
if (dialog->signal().isEmpty())
|
||||
return;
|
||||
|
||||
qmlObjectNode.view()->executeInTransaction("NavigatorTreeModel:exportItem", [=](){
|
||||
|
||||
addSignal(typeName, itemId, dialog->signal(), isModelNodeRoot);
|
||||
qmlObjectNode.view()->executeInTransaction("NavigatorTreeModel:exportItem", [=]() {
|
||||
addSignal(typeName,
|
||||
itemId,
|
||||
dialog->signal(),
|
||||
isModelNodeRoot,
|
||||
selectionState.view()->externalDependencies());
|
||||
});
|
||||
|
||||
addSignal(typeName, itemId, dialog->signal(), isModelNodeRoot);
|
||||
addSignal(typeName,
|
||||
itemId,
|
||||
dialog->signal(),
|
||||
isModelNodeRoot,
|
||||
selectionState.view()->externalDependencies());
|
||||
|
||||
//Move cursor to correct curser position
|
||||
const QString filePath = Core::EditorManager::currentDocument()->filePath().toString();
|
||||
@@ -1524,7 +1535,8 @@ void styleMerge(const SelectionContext &selectionContext, const QString &templat
|
||||
textEditTemplate.setPlainText(imports + qmlTemplateString);
|
||||
NotIndentingTextEditModifier textModifierTemplate(&textEditTemplate);
|
||||
|
||||
QScopedPointer<RewriterView> templateRewriterView(new RewriterView(RewriterView::Amend));
|
||||
QScopedPointer<RewriterView> templateRewriterView(
|
||||
new RewriterView(selectionContext.view()->externalDependencies(), RewriterView::Amend));
|
||||
templateRewriterView->setTextModifier(&textModifierTemplate);
|
||||
templateModel->attachView(templateRewriterView.data());
|
||||
templateRewriterView->setCheckSemanticErrors(false);
|
||||
@@ -1543,7 +1555,8 @@ void styleMerge(const SelectionContext &selectionContext, const QString &templat
|
||||
textEditStyle.setPlainText(parentRewriterView->textModifierContent());
|
||||
NotIndentingTextEditModifier textModifierStyle(&textEditStyle);
|
||||
|
||||
QScopedPointer<RewriterView> styleRewriterView(new RewriterView(RewriterView::Amend));
|
||||
QScopedPointer<RewriterView> styleRewriterView(
|
||||
new RewriterView(selectionContext.view()->externalDependencies(), RewriterView::Amend));
|
||||
styleRewriterView->setTextModifier(&textModifierStyle);
|
||||
styleModel->attachView(styleRewriterView.data());
|
||||
|
||||
|
@@ -1,17 +1,17 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <qmldesignercorelib_global.h>
|
||||
#include <abstractview.h>
|
||||
#include <QPointF>
|
||||
#include <QPointer>
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT SelectionContext {
|
||||
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT SelectionContext
|
||||
{
|
||||
public:
|
||||
enum class UpdateMode {
|
||||
Normal,
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <qmldesignercorelib_global.h>
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <utils/theme/theme.h>
|
||||
|
||||
@@ -16,7 +16,7 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT Theme : public Utils::Theme
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT Theme : public Utils::Theme
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@@ -47,9 +47,26 @@ static Q_LOGGING_CATEGORY(viewBenchmark, "qtc.viewmanager.attach", QtWarningMsg)
|
||||
class ViewManagerData
|
||||
{
|
||||
public:
|
||||
ViewManagerData(AsynchronousImageCache &imageCache)
|
||||
: itemLibraryView(imageCache)
|
||||
, propertyEditorView(imageCache)
|
||||
ViewManagerData(AsynchronousImageCache &imageCache,
|
||||
ExternalDependenciesInterface &externalDependencies)
|
||||
: debugView{externalDependencies}
|
||||
, designerActionManagerView{externalDependencies}
|
||||
, nodeInstanceView(QCoreApplication::arguments().contains("-capture-puppet-stream")
|
||||
? capturingConnectionManager
|
||||
: connectionManager,
|
||||
externalDependencies)
|
||||
, componentView{externalDependencies}
|
||||
, edit3DView{externalDependencies}
|
||||
, formEditorView{externalDependencies}
|
||||
, textEditorView{externalDependencies}
|
||||
, assetsLibraryView{externalDependencies}
|
||||
, itemLibraryView(imageCache, externalDependencies)
|
||||
, navigatorView{externalDependencies}
|
||||
, propertyEditorView(imageCache, externalDependencies)
|
||||
, materialEditorView{externalDependencies}
|
||||
, materialBrowserView{externalDependencies}
|
||||
, statesEditorView{externalDependencies}
|
||||
, newStatesEditorView{externalDependencies}
|
||||
{}
|
||||
|
||||
InteractiveConnectionManager connectionManager;
|
||||
@@ -57,9 +74,7 @@ public:
|
||||
QmlModelState savedState;
|
||||
Internal::DebugView debugView;
|
||||
DesignerActionManagerView designerActionManagerView;
|
||||
NodeInstanceView nodeInstanceView{
|
||||
QCoreApplication::arguments().contains("-capture-puppet-stream") ? capturingConnectionManager
|
||||
: connectionManager};
|
||||
NodeInstanceView nodeInstanceView;
|
||||
ComponentView componentView;
|
||||
Edit3DView edit3DView;
|
||||
FormEditorView formEditorView;
|
||||
@@ -81,8 +96,9 @@ static CrumbleBar *crumbleBar() {
|
||||
return QmlDesignerPlugin::instance()->mainWidget()->crumbleBar();
|
||||
}
|
||||
|
||||
ViewManager::ViewManager(AsynchronousImageCache &imageCache)
|
||||
: d(std::make_unique<ViewManagerData>(imageCache))
|
||||
ViewManager::ViewManager(AsynchronousImageCache &imageCache,
|
||||
ExternalDependenciesInterface &externalDependencies)
|
||||
: d(std::make_unique<ViewManagerData>(imageCache, externalDependencies))
|
||||
{
|
||||
d->formEditorView.setGotoErrorCallback([this](int line, int column) {
|
||||
d->textEditorView.gotoCursorPosition(line, column);
|
||||
|
@@ -3,7 +3,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "abstractview.h"
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <abstractview.h>
|
||||
|
||||
#include <coreplugin/icontext.h>
|
||||
|
||||
@@ -28,10 +30,11 @@ namespace Internal { class DesignModeWidget; }
|
||||
|
||||
class ViewManagerData;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT ViewManager
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT ViewManager
|
||||
{
|
||||
public:
|
||||
ViewManager(class AsynchronousImageCache &imageCache);
|
||||
ViewManager(class AsynchronousImageCache &imageCache,
|
||||
class ExternalDependenciesInterface &externalDependencies);
|
||||
~ViewManager();
|
||||
|
||||
void attachRewriterView();
|
||||
|
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
#pragma once
|
||||
|
||||
#include <qmldesignercorelib_global.h>
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <QPointer>
|
||||
#include <QWidgetAction>
|
||||
@@ -15,7 +15,7 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT ZoomAction : public QWidgetAction
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT ZoomAction : public QWidgetAction
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -24,8 +24,9 @@ namespace QmlDesigner {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
ConnectionView::ConnectionView()
|
||||
: m_connectionViewWidget(new ConnectionViewWidget())
|
||||
ConnectionView::ConnectionView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_connectionViewWidget(new ConnectionViewWidget())
|
||||
, m_connectionModel(new ConnectionModel(this))
|
||||
, m_bindingModel(new BindingModel(this))
|
||||
, m_dynamicPropertiesModel(new DynamicPropertiesModel(false, this))
|
||||
|
@@ -28,7 +28,7 @@ class ConnectionView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ConnectionView();
|
||||
ConnectionView(ExternalDependenciesInterface &externalDependencies);
|
||||
~ConnectionView() override;
|
||||
|
||||
// AbstractView
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "theme.h"
|
||||
#include "signalhandlerproperty.h"
|
||||
|
||||
#include <designeractionmanager.h>
|
||||
#include <designersettings.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
|
||||
|
@@ -21,8 +21,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
CurveEditorView::CurveEditorView()
|
||||
: m_block(false)
|
||||
CurveEditorView::CurveEditorView(ExternalDependenciesInterface &externalDepoendencies)
|
||||
: AbstractView{externalDepoendencies}
|
||||
, m_block(false)
|
||||
, m_model(new CurveEditorModel())
|
||||
, m_editor(new CurveEditor(m_model))
|
||||
{
|
||||
|
@@ -16,7 +16,7 @@ class CurveEditorView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CurveEditorView();
|
||||
explicit CurveEditorView(ExternalDependenciesInterface &externalDepoendencies);
|
||||
~CurveEditorView() override;
|
||||
|
||||
public:
|
||||
|
@@ -39,8 +39,9 @@ namespace QmlDesigner {
|
||||
|
||||
namespace Internal {
|
||||
|
||||
DebugView::DebugView()
|
||||
: m_debugViewWidget(new DebugViewWidget)
|
||||
DebugView::DebugView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_debugViewWidget(new DebugViewWidget)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@ class DebugView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DebugView();
|
||||
DebugView(ExternalDependenciesInterface &externalDependencies);
|
||||
~DebugView() override;
|
||||
|
||||
// AbstractView
|
||||
|
@@ -10,7 +10,6 @@
|
||||
#include "metainfo.h"
|
||||
#include "nodehints.h"
|
||||
#include "seekerslider.h"
|
||||
#include "view3dactioncommand.h"
|
||||
|
||||
#include <auxiliarydataproperties.h>
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -31,7 +30,8 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
Edit3DView::Edit3DView()
|
||||
Edit3DView::Edit3DView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
{
|
||||
m_compressionTimer.setInterval(1000);
|
||||
m_compressionTimer.setSingleShot(true);
|
||||
|
@@ -2,6 +2,8 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
#pragma once
|
||||
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <abstractview.h>
|
||||
#include <modelcache.h>
|
||||
|
||||
@@ -22,12 +24,12 @@ class Edit3DAction;
|
||||
class Edit3DCameraAction;
|
||||
class SeekerSlider;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT Edit3DView : public AbstractView
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT Edit3DView : public AbstractView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Edit3DView();
|
||||
Edit3DView(ExternalDependenciesInterface &externalDependencies);
|
||||
~Edit3DView() override;
|
||||
|
||||
WidgetInfo widgetInfo() override;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
// Copyright (C) 2020 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "edit3dwidget.h"
|
||||
#include "edit3dactions.h"
|
||||
#include "edit3dcanvas.h"
|
||||
#include "edit3dview.h"
|
||||
#include "edit3dwidget.h"
|
||||
#include "edit3dvisibilitytogglesmenu.h"
|
||||
#include "metainfo.h"
|
||||
#include "modelnodeoperations.h"
|
||||
@@ -12,8 +12,9 @@
|
||||
#include "qmldesignerplugin.h"
|
||||
#include "qmlvisualnode.h"
|
||||
#include "viewmanager.h"
|
||||
#include <seekerslider.h>
|
||||
#include <designeractionmanager.h>
|
||||
#include <nodeinstanceview.h>
|
||||
#include <seekerslider.h>
|
||||
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
|
@@ -44,12 +44,12 @@ static Utils::FilePath findFile(const Utils::FilePath &path, const QString &file
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
NodeListView *EventList::st_nodeView = nullptr;
|
||||
static std::unique_ptr<NodeListView> st_nodeView;
|
||||
|
||||
void EventList::setNodeProperties(AbstractView *view)
|
||||
{
|
||||
st_nodeView = new NodeListView(view);
|
||||
st_nodeView = std::make_unique<NodeListView>(view->externalDependencies());
|
||||
view->model()->attachView(st_nodeView.get());
|
||||
}
|
||||
|
||||
void EventList::selectNode(int internalId)
|
||||
@@ -108,7 +108,7 @@ QStandardItemModel *EventList::nodeModel()
|
||||
|
||||
NodeListView *EventList::nodeListView()
|
||||
{
|
||||
return st_nodeView;
|
||||
return st_nodeView.get();
|
||||
}
|
||||
|
||||
ModelNode EventList::modelNode(const QString &id)
|
||||
@@ -196,7 +196,8 @@ void EventList::initialize(EventListPluginView *parent)
|
||||
}
|
||||
|
||||
if (!m_eventView) {
|
||||
m_eventView = std::make_unique<EventListView>();
|
||||
m_eventView = std::make_unique<EventListView>(parent->externalDependencies());
|
||||
|
||||
m_model->attachView(m_eventView.get());
|
||||
}
|
||||
}
|
||||
|
@@ -49,8 +49,6 @@ public:
|
||||
void write(const QString &text);
|
||||
|
||||
private:
|
||||
static NodeListView *st_nodeView;
|
||||
|
||||
std::unique_ptr<Model> m_model;
|
||||
std::unique_ptr<EventListView> m_eventView;
|
||||
Utils::FilePath m_path;
|
||||
|
@@ -75,7 +75,8 @@ void EventListDialog::initialize(EventList &events)
|
||||
Model *model = events.model();
|
||||
m_modifier->setParent(model);
|
||||
|
||||
m_rewriter = new RewriterView(QmlDesigner::RewriterView::Validate);
|
||||
m_rewriter = new RewriterView(events.view()->externalDependencies(),
|
||||
QmlDesigner::RewriterView::Validate);
|
||||
m_rewriter->setParent(model);
|
||||
m_rewriter->setTextModifier(m_modifier);
|
||||
m_rewriter->setCheckSemanticErrors(false);
|
||||
|
@@ -7,11 +7,12 @@
|
||||
#include "eventlistdialog.h"
|
||||
|
||||
#include "signalhandlerproperty.h"
|
||||
#include <componentcore/componentcore_constants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <designeractionmanager.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <extensionsystem/pluginspec.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
#include <componentcore/componentcore_constants.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
@@ -30,8 +31,9 @@ SignalHandlerProperty signalPropertyFromAction(ActionInterface *interface)
|
||||
return SignalHandlerProperty();
|
||||
}
|
||||
|
||||
EventListPluginView::EventListPluginView()
|
||||
: m_eventlist()
|
||||
EventListPluginView::EventListPluginView(ExternalDependenciesInterface &externalDepoendencies)
|
||||
: AbstractView{externalDepoendencies}
|
||||
, m_eventlist()
|
||||
, m_eventListDialog(nullptr)
|
||||
, m_assigner(nullptr)
|
||||
, m_signalConnector(nullptr)
|
||||
|
@@ -16,7 +16,7 @@ class EventListPluginView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EventListPluginView();
|
||||
EventListPluginView(ExternalDependenciesInterface &externalDepoendencies);
|
||||
~EventListPluginView() override = default;
|
||||
|
||||
void registerActions();
|
||||
|
@@ -50,8 +50,9 @@ QStringList EventListModel::connectEvents(const QStringList &eventIds)
|
||||
return out;
|
||||
}
|
||||
|
||||
EventListView::EventListView()
|
||||
: m_eventlist()
|
||||
EventListView::EventListView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_eventlist()
|
||||
, m_model(std::make_unique<EventListModel>())
|
||||
{}
|
||||
|
||||
|
@@ -51,7 +51,7 @@ class EventListView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EventListView();
|
||||
explicit EventListView(ExternalDependenciesInterface &externalDependencies);
|
||||
~EventListView() override;
|
||||
|
||||
void nodeRemoved(const ModelNode &removedNode,
|
||||
|
@@ -41,11 +41,10 @@ NodeListModel::NodeListModel(QObject *parent)
|
||||
setSortRole(internalIdRole);
|
||||
}
|
||||
|
||||
NodeListView::NodeListView(AbstractView *parent)
|
||||
: m_itemModel(new NodeListModel(this))
|
||||
NodeListView::NodeListView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_itemModel(new NodeListModel(this))
|
||||
{
|
||||
setParent(parent);
|
||||
parent->model()->attachView(this);
|
||||
reset();
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,7 @@ class NodeListView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit NodeListView(AbstractView *parent);
|
||||
explicit NodeListView(ExternalDependenciesInterface &externalDependencies);
|
||||
~NodeListView() override;
|
||||
|
||||
int currentNode() const;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT AbstractCustomTool : public QmlDesigner::AbstractFormEditorTool
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT AbstractCustomTool : public QmlDesigner::AbstractFormEditorTool
|
||||
{
|
||||
public:
|
||||
AbstractCustomTool();
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "formeditoritem.h"
|
||||
|
||||
#include <qmldesignercorelib_global.h>
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include "snapper.h"
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace QmlDesigner {
|
||||
|
||||
class FormEditorView;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT AbstractFormEditorTool
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT AbstractFormEditorTool
|
||||
{
|
||||
friend FormEditorView;
|
||||
|
||||
|
@@ -2,9 +2,11 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
#pragma once
|
||||
|
||||
#include <qmlitemnode.h>
|
||||
#include "snappinglinecreator.h"
|
||||
|
||||
#include <qmldesignercomponents_global.h>
|
||||
#include <qmlitemnode.h>
|
||||
|
||||
#include <QPointer>
|
||||
#include <QGraphicsWidget>
|
||||
|
||||
@@ -25,7 +27,7 @@ namespace Internal {
|
||||
class MoveController;
|
||||
}
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT FormEditorItem : public QGraphicsItem
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT FormEditorItem : public QGraphicsItem
|
||||
{
|
||||
friend FormEditorScene;
|
||||
|
||||
|
@@ -21,7 +21,7 @@ class FormEditorItem;
|
||||
class FormEditorView;
|
||||
class LayerItem;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT FormEditorScene : public QGraphicsScene
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT FormEditorScene : public QGraphicsScene
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@@ -42,7 +42,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
FormEditorView::FormEditorView() {}
|
||||
FormEditorView::FormEditorView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
{}
|
||||
|
||||
FormEditorScene* FormEditorView::scene() const
|
||||
{
|
||||
|
@@ -2,6 +2,8 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
#pragma once
|
||||
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <abstractview.h>
|
||||
|
||||
#include <QPicture>
|
||||
@@ -34,12 +36,12 @@ class DragTool;
|
||||
class ItemLibraryEntry;
|
||||
class QmlItemNode;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT FormEditorView : public AbstractView
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT FormEditorView : public AbstractView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FormEditorView();
|
||||
FormEditorView(ExternalDependenciesInterface &externalDependencies);
|
||||
~FormEditorView() override;
|
||||
|
||||
// AbstractView
|
||||
|
@@ -4,13 +4,13 @@
|
||||
|
||||
#include "resizecontroller.h"
|
||||
|
||||
#include <qmldesignercorelib_global.h>
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <QGraphicsItem>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT ResizeHandleItem : public QGraphicsItem
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT ResizeHandleItem : public QGraphicsItem
|
||||
{
|
||||
public:
|
||||
enum
|
||||
|
@@ -4,13 +4,13 @@
|
||||
|
||||
#include "rotationcontroller.h"
|
||||
|
||||
#include <qmldesignercorelib_global.h>
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <QGraphicsItem>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT RotationHandleItem : public QGraphicsItem
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT RotationHandleItem : public QGraphicsItem
|
||||
{
|
||||
public:
|
||||
enum
|
||||
|
@@ -15,8 +15,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
ComponentView::ComponentView()
|
||||
: m_standardItemModel(new QStandardItemModel(this))
|
||||
ComponentView::ComponentView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_standardItemModel(new QStandardItemModel(this))
|
||||
, m_componentAction(new ComponentAction(this))
|
||||
{
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ public:
|
||||
ModelNodeRole = Qt::UserRole
|
||||
};
|
||||
|
||||
ComponentView();
|
||||
ComponentView(ExternalDependenciesInterface &externalDependencies);
|
||||
|
||||
void modelAttached(Model *model) override;
|
||||
void modelAboutToBeDetached(Model *model) override;
|
||||
|
@@ -60,13 +60,15 @@ namespace QmlDesigner {
|
||||
DesignDocument acts as a facade to a model representing a qml document,
|
||||
and the different views/widgets accessing it.
|
||||
*/
|
||||
DesignDocument::DesignDocument(ProjectStorage<Sqlite::Database> &projectStorage)
|
||||
DesignDocument::DesignDocument(ProjectStorage<Sqlite::Database> &projectStorage,
|
||||
ExternalDependenciesInterface &externalDependencies)
|
||||
: m_documentModel(Model::create("QtQuick.Item", 1, 0))
|
||||
, m_subComponentManager(new SubComponentManager(m_documentModel.get(), this))
|
||||
, m_rewriterView(new RewriterView(RewriterView::Amend))
|
||||
, m_subComponentManager(new SubComponentManager(m_documentModel.get(), externalDependencies))
|
||||
, m_rewriterView(new RewriterView(externalDependencies, RewriterView::Amend))
|
||||
, m_documentLoaded(false)
|
||||
, m_currentTarget(nullptr)
|
||||
, m_projectStorage(projectStorage)
|
||||
, m_externalDependencies{externalDependencies}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -477,11 +479,11 @@ void DesignDocument::deleteSelected()
|
||||
|
||||
void DesignDocument::copySelected()
|
||||
{
|
||||
DesignDocumentView view;
|
||||
DesignDocumentView view{m_externalDependencies};
|
||||
|
||||
currentModel()->attachView(&view);
|
||||
|
||||
DesignDocumentView::copyModelNodes(view.selectedModelNodes());
|
||||
DesignDocumentView::copyModelNodes(view.selectedModelNodes(), m_externalDependencies);
|
||||
}
|
||||
|
||||
void DesignDocument::cutSelected()
|
||||
@@ -537,12 +539,12 @@ void DesignDocument::paste()
|
||||
if (TimelineActions::clipboardContainsKeyframes()) // pasting keyframes is handled in TimelineView
|
||||
return;
|
||||
|
||||
auto pasteModel = DesignDocumentView::pasteToModel();
|
||||
auto pasteModel = DesignDocumentView::pasteToModel(m_externalDependencies);
|
||||
|
||||
if (!pasteModel)
|
||||
return;
|
||||
|
||||
DesignDocumentView view;
|
||||
DesignDocumentView view{m_externalDependencies};
|
||||
pasteModel->attachView(&view);
|
||||
ModelNode rootNode(view.rootModelNode());
|
||||
QList<ModelNode> selectedNodes = rootNode.directSubModelNodes();
|
||||
@@ -662,7 +664,7 @@ void DesignDocument::selectAll()
|
||||
if (!currentModel())
|
||||
return;
|
||||
|
||||
DesignDocumentView view;
|
||||
DesignDocumentView view{m_externalDependencies};
|
||||
currentModel()->attachView(&view);
|
||||
|
||||
QList<ModelNode> allNodesExceptRootNode(view.allModelNodes());
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include <projectstorage/projectstoragefwd.h>
|
||||
#include <rewriterview.h>
|
||||
#include <subcomponentmanager.h>
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
@@ -33,12 +34,13 @@ class CrumbleBarInfo;
|
||||
class ViewManager;
|
||||
class AbstractView;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT DesignDocument: public QObject
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT DesignDocument : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
DesignDocument(ProjectStorage<Sqlite::Database> &projectStorage);
|
||||
DesignDocument(ProjectStorage<Sqlite::Database> &projectStorage,
|
||||
ExternalDependenciesInterface &externalDependencies);
|
||||
~DesignDocument() override;
|
||||
|
||||
QString displayName() const;
|
||||
@@ -139,6 +141,7 @@ private: // variables
|
||||
bool m_documentLoaded;
|
||||
ProjectExplorer::Target *m_currentTarget;
|
||||
ProjectStorage<Sqlite::Database> &m_projectStorage;
|
||||
ExternalDependenciesInterface &m_externalDependencies;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
@@ -22,8 +22,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
DesignDocumentView::DesignDocumentView()
|
||||
: m_modelMerger(new ModelMerger(this))
|
||||
DesignDocumentView::DesignDocumentView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_modelMerger(new ModelMerger(this))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -79,7 +80,6 @@ void DesignDocumentView::fromClipboard()
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
QString DesignDocumentView::toText() const
|
||||
{
|
||||
auto outputModel = Model::create("QtQuick.Rectangle", 1, 0, model());
|
||||
@@ -97,7 +97,8 @@ QString DesignDocumentView::toText() const
|
||||
textEdit.setPlainText(imports + QStringLiteral("Item {\n}\n"));
|
||||
NotIndentingTextEditModifier modifier(&textEdit);
|
||||
|
||||
QScopedPointer<RewriterView> rewriterView(new RewriterView(RewriterView::Amend));
|
||||
QScopedPointer<RewriterView> rewriterView(
|
||||
new RewriterView(externalDependencies(), RewriterView::Amend));
|
||||
rewriterView->setCheckSemanticErrors(false);
|
||||
rewriterView->setTextModifier(&modifier);
|
||||
outputModel->setRewriterView(rewriterView.data());
|
||||
@@ -126,7 +127,7 @@ void DesignDocumentView::fromText(const QString &text)
|
||||
textEdit.setPlainText(imports + text);
|
||||
NotIndentingTextEditModifier modifier(&textEdit);
|
||||
|
||||
RewriterView rewriterView;
|
||||
RewriterView rewriterView{externalDependencies()};
|
||||
rewriterView.setCheckSemanticErrors(false);
|
||||
rewriterView.setTextModifier(&modifier);
|
||||
inputModel->setRewriterView(&rewriterView);
|
||||
@@ -151,7 +152,7 @@ static Model *currentModel()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<Model> DesignDocumentView::pasteToModel()
|
||||
std::unique_ptr<Model> DesignDocumentView::pasteToModel(ExternalDependenciesInterface &externalDependencies)
|
||||
{
|
||||
Model *parentModel = currentModel();
|
||||
|
||||
@@ -167,7 +168,7 @@ std::unique_ptr<Model> DesignDocumentView::pasteToModel()
|
||||
pasteModel->setFileUrl(parentModel->fileUrl());
|
||||
pasteModel->changeImports(parentModel->imports(), {});
|
||||
|
||||
DesignDocumentView view;
|
||||
DesignDocumentView view{externalDependencies};
|
||||
pasteModel->attachView(&view);
|
||||
|
||||
view.fromClipboard();
|
||||
@@ -175,7 +176,8 @@ std::unique_ptr<Model> DesignDocumentView::pasteToModel()
|
||||
return pasteModel;
|
||||
}
|
||||
|
||||
void DesignDocumentView::copyModelNodes(const QList<ModelNode> &nodesToCopy)
|
||||
void DesignDocumentView::copyModelNodes(const QList<ModelNode> &nodesToCopy,
|
||||
ExternalDependenciesInterface &externalDependencies)
|
||||
{
|
||||
Model *parentModel = currentModel();
|
||||
|
||||
@@ -201,7 +203,7 @@ void DesignDocumentView::copyModelNodes(const QList<ModelNode> &nodesToCopy)
|
||||
}
|
||||
}
|
||||
|
||||
DesignDocumentView view;
|
||||
DesignDocumentView view{externalDependencies};
|
||||
copyModel->attachView(&view);
|
||||
|
||||
if (selectedNodes.count() == 1) {
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <abstractview.h>
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -11,11 +12,11 @@ namespace QmlDesigner {
|
||||
|
||||
class ModelMerger;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT DesignDocumentView : public AbstractView
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT DesignDocumentView : public AbstractView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DesignDocumentView();
|
||||
DesignDocumentView(ExternalDependenciesInterface &externalDependencies);
|
||||
~DesignDocumentView() override;
|
||||
|
||||
ModelNode insertModel(const ModelNode &modelNode);
|
||||
@@ -27,8 +28,9 @@ public:
|
||||
QString toText() const;
|
||||
void fromText(const QString &text);
|
||||
|
||||
static std::unique_ptr<Model> pasteToModel();
|
||||
static void copyModelNodes(const QList<ModelNode> &nodesToCopy);
|
||||
static std::unique_ptr<Model> pasteToModel(ExternalDependenciesInterface &externalDependencies);
|
||||
static void copyModelNodes(const QList<ModelNode> &nodesToCopy,
|
||||
ExternalDependenciesInterface &externalDependencies);
|
||||
|
||||
private:
|
||||
std::unique_ptr<ModelMerger> m_modelMerger;
|
||||
|
@@ -5,10 +5,10 @@
|
||||
#include "qmldesignerplugin.h"
|
||||
#include "qmldesignerconstants.h"
|
||||
|
||||
#include "rewriterview.h"
|
||||
#include "model.h"
|
||||
#include "puppetcreator.h"
|
||||
#include "puppetstarter.h"
|
||||
#include "rewritertransaction.h"
|
||||
#include "rewriterview.h"
|
||||
#include "rewritingexception.h"
|
||||
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
@@ -568,9 +568,6 @@ void ItemLibraryAssetImporter::startNextImportProcess()
|
||||
Model *model = doc ? doc->currentModel() : nullptr;
|
||||
|
||||
if (model) {
|
||||
PuppetCreator puppetCreator(doc->currentTarget(), model);
|
||||
puppetCreator.createQml2PuppetExecutableIfMissing();
|
||||
|
||||
bool done = false;
|
||||
while (!m_puppetQueue.isEmpty() && !done) {
|
||||
const ParseData pd = m_parseData.value(m_puppetQueue.takeLast());
|
||||
@@ -581,7 +578,8 @@ void ItemLibraryAssetImporter::startNextImportProcess()
|
||||
<< pd.outDir.absolutePath() << QString::fromUtf8(optDoc.toJson());
|
||||
|
||||
m_currentImportId = pd.importId;
|
||||
m_puppetProcess = puppetCreator.createPuppetProcess(
|
||||
m_puppetProcess = PuppetStarter::createPuppetProcess(
|
||||
{},
|
||||
"custom",
|
||||
{},
|
||||
[&] {},
|
||||
@@ -611,15 +609,13 @@ void ItemLibraryAssetImporter::startNextIconProcess()
|
||||
Model *model = doc ? doc->currentModel() : nullptr;
|
||||
|
||||
if (model) {
|
||||
PuppetCreator puppetCreator(doc->currentTarget(), model);
|
||||
puppetCreator.createQml2PuppetExecutableIfMissing();
|
||||
|
||||
bool done = false;
|
||||
while (!m_puppetQueue.isEmpty() && !done) {
|
||||
const ParseData pd = m_parseData.value(m_puppetQueue.takeLast());
|
||||
QStringList puppetArgs;
|
||||
puppetArgs << "--rendericon" << QString::number(24) << pd.iconFile << pd.iconSource;
|
||||
m_puppetProcess = puppetCreator.createPuppetProcess(
|
||||
m_puppetProcess = PuppetStarter::createPuppetProcess(
|
||||
{},
|
||||
"custom",
|
||||
{},
|
||||
[&] {},
|
||||
|
@@ -2,12 +2,14 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "itemlibraryview.h"
|
||||
#include "itemlibrarywidget.h"
|
||||
#include "itemlibraryassetimportdialog.h"
|
||||
#include "itemlibrarywidget.h"
|
||||
#include "metainfo.h"
|
||||
#include <asynchronousimagecache.h>
|
||||
#include <bindingproperty.h>
|
||||
#include <componentcore_constants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <designeractionmanager.h>
|
||||
#include <import.h>
|
||||
#include <nodelistproperty.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
@@ -17,14 +19,15 @@
|
||||
#include <rewriterview.h>
|
||||
#include <sqlitedatabase.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <qmldesignerconstants.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
#include <qmlitemnode.h>
|
||||
#include <qmldesignerconstants.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
ItemLibraryView::ItemLibraryView(AsynchronousImageCache &imageCache)
|
||||
: AbstractView()
|
||||
ItemLibraryView::ItemLibraryView(AsynchronousImageCache &imageCache,
|
||||
ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView(externalDependencies)
|
||||
, m_imageCache(imageCache)
|
||||
{}
|
||||
|
||||
|
@@ -16,7 +16,8 @@ class ItemLibraryView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ItemLibraryView(class AsynchronousImageCache &imageCache);
|
||||
ItemLibraryView(class AsynchronousImageCache &imageCache,
|
||||
ExternalDependenciesInterface &externalDependencies);
|
||||
~ItemLibraryView() override;
|
||||
|
||||
bool hasWidget() const override;
|
||||
|
@@ -25,7 +25,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
MaterialBrowserView::MaterialBrowserView() {}
|
||||
MaterialBrowserView::MaterialBrowserView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
{}
|
||||
|
||||
MaterialBrowserView::~MaterialBrowserView()
|
||||
{}
|
||||
|
@@ -18,7 +18,7 @@ class MaterialBrowserView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MaterialBrowserView();
|
||||
MaterialBrowserView(ExternalDependenciesInterface &externalDependencies);
|
||||
~MaterialBrowserView() override;
|
||||
|
||||
bool hasWidget() const override;
|
||||
|
@@ -48,8 +48,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
MaterialEditorView::MaterialEditorView()
|
||||
: m_stackedWidget(new QStackedWidget)
|
||||
MaterialEditorView::MaterialEditorView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_stackedWidget(new QStackedWidget)
|
||||
, m_dynamicPropertiesModel(new Internal::DynamicPropertiesModel(true, this))
|
||||
{
|
||||
m_updateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F7), m_stackedWidget);
|
||||
|
@@ -31,7 +31,7 @@ class MaterialEditorView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MaterialEditorView();
|
||||
MaterialEditorView(ExternalDependenciesInterface &externalDependencies);
|
||||
~MaterialEditorView() override;
|
||||
|
||||
bool hasWidget() const override;
|
||||
|
@@ -88,8 +88,9 @@ static inline void moveNodesDown(const QList<QmlDesigner::ModelNode> &nodes)
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
NavigatorView::NavigatorView()
|
||||
: m_blockSelectionChangedSignal(false)
|
||||
NavigatorView::NavigatorView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_blockSelectionChangedSignal(false)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -702,10 +703,8 @@ void NavigatorView::setupWidget()
|
||||
m_widget = new NavigatorWidget(this);
|
||||
m_treeModel = new NavigatorTreeModel(this);
|
||||
|
||||
#ifndef QMLDESIGNER_TEST
|
||||
auto navigatorContext = new Internal::NavigatorContext(m_widget.data());
|
||||
Core::ICore::addContextObject(navigatorContext);
|
||||
#endif
|
||||
|
||||
m_treeModel->setView(this);
|
||||
m_widget->setTreeModel(m_treeModel.data());
|
||||
@@ -722,7 +721,6 @@ void NavigatorView::setupWidget()
|
||||
|
||||
connect(m_widget.data(), &NavigatorWidget::textFilterChanged, this, &NavigatorView::textFilterChanged);
|
||||
|
||||
#ifndef QMLDESIGNER_TEST
|
||||
const QString fontName = "qtds_propertyIconFont.ttf";
|
||||
const QSize size = QSize(28, 28);
|
||||
|
||||
@@ -808,8 +806,6 @@ void NavigatorView::setupWidget()
|
||||
treeWidget()->setItemDelegateForColumn(NavigatorTreeModel::ColumnType::Alias, aliasDelegate);
|
||||
treeWidget()->setItemDelegateForColumn(NavigatorTreeModel::ColumnType::Visibility, visibilityDelegate);
|
||||
treeWidget()->setItemDelegateForColumn(NavigatorTreeModel::ColumnType::Lock, lockDelegate);
|
||||
|
||||
#endif //QMLDESIGNER_TEST
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
@@ -40,7 +40,7 @@ class NavigatorView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
NavigatorView();
|
||||
NavigatorView(ExternalDependenciesInterface &externalDependencies);
|
||||
~NavigatorView() override;
|
||||
|
||||
bool hasWidget() const override;
|
||||
|
@@ -5,17 +5,19 @@
|
||||
#include "navigatorwidget.h"
|
||||
#include "navigatorview.h"
|
||||
|
||||
#include <designeractionmanager.h>
|
||||
#include <designersettings.h>
|
||||
#include <theme.h>
|
||||
#include <qmldesignerconstants.h>
|
||||
#include <qmldesignericons.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
#include <theme.h>
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QBoxLayout>
|
||||
#include <QHeaderView>
|
||||
#include <QMenu>
|
||||
#include <QStackedWidget>
|
||||
#include <QToolBar>
|
||||
#include <QToolButton>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
@@ -56,11 +58,9 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view)
|
||||
|
||||
setWindowTitle(tr("Navigator", "Title of navigator view"));
|
||||
|
||||
#ifndef QMLDESIGNER_TEST
|
||||
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css");
|
||||
sheet += Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css");
|
||||
setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(sheet)));
|
||||
#endif
|
||||
|
||||
QmlDesignerPlugin::trackWidgetFocusTime(this, Constants::EVENT_NAVIGATORVIEW_TIME);
|
||||
}
|
||||
|
@@ -117,8 +117,8 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
PathTool::PathTool()
|
||||
: m_pathToolView(this)
|
||||
PathTool::PathTool(ExternalDependenciesInterface &externalDepoendencies)
|
||||
: m_pathToolView(this, externalDepoendencies)
|
||||
{
|
||||
auto textToolAction = new PathToolAction;
|
||||
QmlDesignerPlugin::instance()->designerActionManager().addDesignerAction(textToolAction);
|
||||
|
@@ -20,7 +20,7 @@ class PathTool : public QObject, public AbstractCustomTool
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PathTool();
|
||||
PathTool(ExternalDependenciesInterface &externalDepoendencies);
|
||||
~PathTool() override;
|
||||
|
||||
void mousePressEvent(const QList<QGraphicsItem*> &itemList,
|
||||
|
@@ -14,8 +14,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
PathToolView::PathToolView(PathTool *pathTool)
|
||||
: m_pathTool(pathTool)
|
||||
PathToolView::PathToolView(PathTool *pathTool, ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_pathTool(pathTool)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -13,7 +13,7 @@ class PathToolView : public AbstractView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PathToolView(PathTool *pathTool);
|
||||
PathToolView(PathTool *pathTool, ExternalDependenciesInterface &externalDependencies);
|
||||
|
||||
void nodeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent, AbstractView::PropertyChangeFlags propertyChange) override;
|
||||
void variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange) override;
|
||||
|
@@ -4,8 +4,8 @@
|
||||
#include "propertyeditorimageprovider.h"
|
||||
#include "assetslibrarymodel.h"
|
||||
|
||||
#include <hdrimage.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <utils/hdrimage.h>
|
||||
#include <utils/stylehelper.h>
|
||||
|
||||
#include <QMetaObject>
|
||||
|
@@ -48,8 +48,9 @@ static bool propertyIsAttachedLayoutProperty(const PropertyName &propertyName)
|
||||
return propertyName.contains("Layout.");
|
||||
}
|
||||
|
||||
PropertyEditorView::PropertyEditorView(AsynchronousImageCache &imageCache)
|
||||
: AbstractView()
|
||||
PropertyEditorView::PropertyEditorView(AsynchronousImageCache &imageCache,
|
||||
ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView(externalDependencies)
|
||||
, m_imageCache(imageCache)
|
||||
, m_updateShortcut(nullptr)
|
||||
, m_timerId(0)
|
||||
|
@@ -29,7 +29,8 @@ class PropertyEditorView: public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PropertyEditorView(class AsynchronousImageCache &imageCache);
|
||||
PropertyEditorView(class AsynchronousImageCache &imageCache,
|
||||
ExternalDependenciesInterface &externalDependencies);
|
||||
~PropertyEditorView() override;
|
||||
|
||||
bool hasWidget() const override;
|
||||
|
@@ -0,0 +1,14 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#if defined(QMLDESIGNERCOMPONENTS_LIBRARY)
|
||||
#define QMLDESIGNERCOMPONENTS_EXPORT Q_DECL_EXPORT
|
||||
#elif defined(QMLDESIGNERCOMPONENTS_STATIC_LIBRARY)
|
||||
#define QMLDESIGNERCOMPONENTS_EXPORT
|
||||
#else
|
||||
#define QMLDESIGNERCOMPONENTS_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "nodemetainfo.h"
|
||||
#include "qmlitemnode.h"
|
||||
#include <designeractionmanager.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
|
||||
#include <abstractaction.h>
|
||||
|
@@ -33,8 +33,9 @@ namespace QmlDesigner {
|
||||
We always have 'one' current state, where we get updates from (see sceneChanged()). In case
|
||||
the current state is the base state, we render the base state + all other states.
|
||||
*/
|
||||
StatesEditorView::StatesEditorView()
|
||||
: m_statesEditorModel(new StatesEditorModel(this))
|
||||
StatesEditorView::StatesEditorView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_statesEditorModel(new StatesEditorModel(this))
|
||||
, m_lastIndex(-1)
|
||||
, m_editor(nullptr)
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@ class StatesEditorView : public AbstractView {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StatesEditorView();
|
||||
explicit StatesEditorView(ExternalDependenciesInterface &externalDependencies);
|
||||
~StatesEditorView() override;
|
||||
|
||||
void renameState(int internalNodeId,const QString &newName);
|
||||
|
@@ -57,10 +57,12 @@ namespace Experimental {
|
||||
We always have 'one' current state, where we get updates from (see sceneChanged()). In case
|
||||
the current state is the base state, we render the base state + all other states.
|
||||
*/
|
||||
StatesEditorView::StatesEditorView() :
|
||||
m_statesEditorModel(new StatesEditorModel(this)),
|
||||
m_lastIndex(-1),
|
||||
m_editor(nullptr)
|
||||
|
||||
StatesEditorView::StatesEditorView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView(externalDependencies)
|
||||
, m_statesEditorModel(new StatesEditorModel(this))
|
||||
, m_lastIndex(-1)
|
||||
, m_editor(nullptr)
|
||||
{
|
||||
Q_ASSERT(m_statesEditorModel);
|
||||
// base state
|
||||
|
@@ -45,7 +45,7 @@ class StatesEditorView : public AbstractView {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StatesEditorView();
|
||||
explicit StatesEditorView(ExternalDependenciesInterface &externalDependencies);
|
||||
~StatesEditorView() override;
|
||||
|
||||
void renameState(int internalNodeId,const QString &newName);
|
||||
|
@@ -42,8 +42,9 @@ namespace QmlDesigner {
|
||||
|
||||
const char TEXTEDITOR_CONTEXT_ID[] = "QmlDesigner.TextEditorContext";
|
||||
|
||||
TextEditorView::TextEditorView()
|
||||
: m_widget(new TextEditorWidget(this))
|
||||
TextEditorView::TextEditorView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_widget(new TextEditorWidget(this))
|
||||
, m_textEditorContext(new Internal::TextEditorContext(m_widget))
|
||||
{
|
||||
Core::ICore::addContextObject(m_textEditorContext);
|
||||
|
@@ -2,9 +2,11 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/icontext.h>
|
||||
|
||||
#include <abstractview.h>
|
||||
#include <qmldesignercomponents_global.h>
|
||||
|
||||
#include <coreplugin/icontext.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -20,12 +22,12 @@ class TextEditorContext;
|
||||
|
||||
class TextEditorWidget;
|
||||
|
||||
class QMLDESIGNERCORE_EXPORT TextEditorView : public AbstractView
|
||||
class QMLDESIGNERCOMPONENTS_EXPORT TextEditorView : public AbstractView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TextEditorView();
|
||||
TextEditorView(ExternalDependenciesInterface &externalDependencies);
|
||||
~TextEditorView() override;
|
||||
|
||||
// AbstractView
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#include <coreplugin/findplaceholder.h>
|
||||
#include <rewriterview.h>
|
||||
|
||||
#include <designeractionmanager.h>
|
||||
#include <qmldesignerconstants.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
|
||||
|
@@ -3,7 +3,9 @@
|
||||
|
||||
#include "textedititem.h"
|
||||
|
||||
#include <externaldependenciesinterface.h>
|
||||
#include <formeditorscene.h>
|
||||
#include <formeditorview.h>
|
||||
#include <model.h>
|
||||
#include <nodemetainfo.h>
|
||||
#include <rewritingexception.h>
|
||||
@@ -32,7 +34,11 @@ void TextEditItem::writeTextToProperty()
|
||||
if (text().isEmpty())
|
||||
m_formEditorItem->qmlItemNode().removeProperty("text");
|
||||
else if (m_formEditorItem->qmlItemNode().isTranslatableText("text"))
|
||||
m_formEditorItem->qmlItemNode().setBindingProperty("text", QmlObjectNode::generateTranslatableText(text()));
|
||||
m_formEditorItem->qmlItemNode().setBindingProperty(
|
||||
"text",
|
||||
QmlObjectNode::generateTranslatableText(
|
||||
text(),
|
||||
m_formEditorItem->formEditorView()->externalDependencies().designerSettings()));
|
||||
else
|
||||
m_formEditorItem->qmlItemNode().setVariantProperty("text", text());
|
||||
}
|
||||
|
@@ -56,19 +56,20 @@ void TimelineActions::copyAllKeyframesForTarget(const ModelNode &targetNode,
|
||||
const QmlTimeline &timeline)
|
||||
{
|
||||
DesignDocumentView::copyModelNodes(Utils::transform(timeline.keyframeGroupsForTarget(targetNode),
|
||||
&QmlTimelineKeyframeGroup::modelNode));
|
||||
&QmlTimelineKeyframeGroup::modelNode),
|
||||
targetNode.view()->externalDependencies());
|
||||
}
|
||||
|
||||
void TimelineActions::pasteKeyframesToTarget(const ModelNode &targetNode,
|
||||
const QmlTimeline &timeline)
|
||||
{
|
||||
if (timeline.isValid()) {
|
||||
auto pasteModel = DesignDocumentView::pasteToModel();
|
||||
auto pasteModel = DesignDocumentView::pasteToModel(targetNode.view()->externalDependencies());
|
||||
|
||||
if (!pasteModel)
|
||||
return;
|
||||
|
||||
DesignDocumentView view;
|
||||
DesignDocumentView view{targetNode.view()->externalDependencies()};
|
||||
pasteModel->attachView(&view);
|
||||
|
||||
if (!view.rootModelNode().isValid())
|
||||
@@ -113,7 +114,8 @@ void TimelineActions::pasteKeyframesToTarget(const ModelNode &targetNode,
|
||||
}
|
||||
}
|
||||
|
||||
void TimelineActions::copyKeyframes(const QList<ModelNode> &keyframes)
|
||||
void TimelineActions::copyKeyframes(const QList<ModelNode> &keyframes,
|
||||
ExternalDependenciesInterface &externalDependencies)
|
||||
{
|
||||
QList<ModelNode> nodes;
|
||||
for (const auto &node : keyframes) {
|
||||
@@ -137,7 +139,7 @@ void TimelineActions::copyKeyframes(const QList<ModelNode> &keyframes)
|
||||
nodes << node;
|
||||
}
|
||||
|
||||
DesignDocumentView::copyModelNodes(nodes);
|
||||
DesignDocumentView::copyModelNodes(nodes, externalDependencies);
|
||||
}
|
||||
|
||||
bool isKeyframe(const ModelNode &node)
|
||||
@@ -238,12 +240,12 @@ std::vector<std::tuple<ModelNode, qreal>> getFramesRelative(const ModelNode &par
|
||||
|
||||
void TimelineActions::pasteKeyframes(AbstractView *timelineView, const QmlTimeline &timeline)
|
||||
{
|
||||
auto pasteModel = DesignDocumentView::pasteToModel();
|
||||
auto pasteModel = DesignDocumentView::pasteToModel(timelineView->externalDependencies());
|
||||
|
||||
if (!pasteModel)
|
||||
return;
|
||||
|
||||
DesignDocumentView view;
|
||||
DesignDocumentView view{timelineView->externalDependencies()};
|
||||
pasteModel->attachView(&view);
|
||||
|
||||
if (!view.rootModelNode().isValid())
|
||||
|
@@ -8,6 +8,8 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class ExternalDependenciesInterface;
|
||||
|
||||
class TimelineActions
|
||||
{
|
||||
public:
|
||||
@@ -18,7 +20,8 @@ public:
|
||||
static void copyAllKeyframesForTarget(const ModelNode &targetNode, const QmlTimeline &timeline);
|
||||
static void pasteKeyframesToTarget(const ModelNode &targetNode, const QmlTimeline &timeline);
|
||||
|
||||
static void copyKeyframes(const QList<ModelNode> &keyframes);
|
||||
static void copyKeyframes(const QList<ModelNode> &keyframes,
|
||||
ExternalDependenciesInterface &externalDependencies);
|
||||
static void pasteKeyframes(AbstractView *timelineView, const QmlTimeline &TimelineActions);
|
||||
|
||||
static bool clipboardContainsKeyframes();
|
||||
|
@@ -62,12 +62,14 @@ QList<QmlTimelineKeyframeGroup> allTimelineFrames(const QmlTimeline &timeline)
|
||||
return returnList;
|
||||
}
|
||||
|
||||
TimelineGraphicsScene::TimelineGraphicsScene(TimelineWidget *parent)
|
||||
TimelineGraphicsScene::TimelineGraphicsScene(TimelineWidget *parent,
|
||||
ExternalDependenciesInterface &m_externalDependencies)
|
||||
: AbstractScrollGraphicsScene(parent)
|
||||
, m_parent(parent)
|
||||
, m_layout(new TimelineGraphicsLayout(this))
|
||||
, m_currentFrameIndicator(new TimelineFrameHandle)
|
||||
, m_tools(this)
|
||||
, m_externalDependencies{m_externalDependencies}
|
||||
{
|
||||
addItem(m_layout);
|
||||
addItem(m_currentFrameIndicator);
|
||||
@@ -735,8 +737,9 @@ void TimelineGraphicsScene::pasteKeyframesToTarget(const ModelNode &targetNode)
|
||||
|
||||
void TimelineGraphicsScene::copySelectedKeyframes()
|
||||
{
|
||||
TimelineActions::copyKeyframes(
|
||||
Utils::transform(selectedKeyframes(), &TimelineKeyframeItem::frameNode));
|
||||
TimelineActions::copyKeyframes(Utils::transform(selectedKeyframes(),
|
||||
&TimelineKeyframeItem::frameNode),
|
||||
m_externalDependencies);
|
||||
}
|
||||
|
||||
void TimelineGraphicsScene::pasteSelectedKeyframes()
|
||||
|
@@ -30,6 +30,7 @@ class TimelineKeyframeItem;
|
||||
class TimelinePlaceholder;
|
||||
class TimelineGraphicsLayout;
|
||||
class TimelineToolBar;
|
||||
class ExternalDependenciesInterface;
|
||||
|
||||
class AbstractScrollGraphicsScene : public QGraphicsScene
|
||||
{
|
||||
@@ -87,7 +88,8 @@ class TimelineGraphicsScene : public AbstractScrollGraphicsScene
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TimelineGraphicsScene(TimelineWidget *parent);
|
||||
explicit TimelineGraphicsScene(TimelineWidget *parent,
|
||||
ExternalDependenciesInterface &m_externalDependencies);
|
||||
|
||||
~TimelineGraphicsScene() override;
|
||||
|
||||
@@ -192,6 +194,8 @@ private:
|
||||
|
||||
TimelineToolDelegate m_tools;
|
||||
|
||||
ExternalDependenciesInterface &m_externalDependencies;
|
||||
|
||||
// sorted, unique cache of keyframes positions, used for snapping
|
||||
QVector<qreal> m_keyframePositionsCache;
|
||||
QElapsedTimer m_usageTimer;
|
||||
|
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <auxiliarydataproperties.h>
|
||||
#include <bindingproperty.h>
|
||||
#include <designeractionmanager.h>
|
||||
#include <exception.h>
|
||||
#include <modelnodecontextmenu_helper.h>
|
||||
#include <nodeabstractproperty.h>
|
||||
@@ -45,8 +46,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
TimelineView::TimelineView()
|
||||
: m_timelineWidget(nullptr)
|
||||
TimelineView::TimelineView(ExternalDependenciesInterface &externalDepoendencies)
|
||||
: AbstractView{externalDepoendencies}
|
||||
, m_timelineWidget(nullptr)
|
||||
{
|
||||
EasingCurve::registerStreamOperators();
|
||||
setEnabled(false);
|
||||
|
@@ -18,7 +18,7 @@ class TimelineView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TimelineView();
|
||||
explicit TimelineView(ExternalDependenciesInterface &externalDepoendencies);
|
||||
~TimelineView() override;
|
||||
//Abstract View
|
||||
WidgetInfo widgetInfo() override;
|
||||
|
@@ -100,7 +100,7 @@ TimelineWidget::TimelineWidget(TimelineView *view)
|
||||
, m_scrollbar(new QScrollBar(this))
|
||||
, m_statusBar(new QLabel(this))
|
||||
, m_timelineView(view)
|
||||
, m_graphicsScene(new TimelineGraphicsScene(this))
|
||||
, m_graphicsScene(new TimelineGraphicsScene(this, view->externalDependencies()))
|
||||
, m_addButton(new QPushButton(this))
|
||||
, m_onboardingContainer(new QWidget(this))
|
||||
, m_loopPlayback(false)
|
||||
|
@@ -40,8 +40,9 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
TransitionEditorView::TransitionEditorView()
|
||||
: m_transitionEditorWidget(nullptr)
|
||||
TransitionEditorView::TransitionEditorView(ExternalDependenciesInterface &externalDependencies)
|
||||
: AbstractView{externalDependencies}
|
||||
, m_transitionEditorWidget(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ class TransitionEditorView : public AbstractView
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TransitionEditorView();
|
||||
explicit TransitionEditorView(ExternalDependenciesInterface &externalDependencies);
|
||||
~TransitionEditorView() override;
|
||||
//Abstract View
|
||||
WidgetInfo widgetInfo() override;
|
||||
|
@@ -7,6 +7,7 @@
|
||||
#include "addtabdesigneraction.h"
|
||||
#include "entertabdesigneraction.h"
|
||||
|
||||
#include <designeractionmanager.h>
|
||||
#include <viewmanager.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
|
||||
|
@@ -41,10 +41,12 @@ QString fileToString(const QString &filename)
|
||||
ImageCacheCollector::ImageCacheCollector(ImageCacheConnectionManager &connectionManager,
|
||||
QSize captureImageMinimumSize,
|
||||
QSize captureImageMaximumSize,
|
||||
ExternalDependenciesInterface &externalDependencies,
|
||||
ImageCacheCollectorNullImageHandling nullImageHandling)
|
||||
: m_connectionManager{connectionManager}
|
||||
, captureImageMinimumSize{captureImageMinimumSize}
|
||||
, captureImageMaximumSize{captureImageMaximumSize}
|
||||
, m_externalDependencies{externalDependencies}
|
||||
, nullImageHandling{nullImageHandling}
|
||||
{}
|
||||
|
||||
@@ -56,8 +58,8 @@ void ImageCacheCollector::start(Utils::SmallStringView name,
|
||||
CaptureCallback captureCallback,
|
||||
AbortCallback abortCallback)
|
||||
{
|
||||
RewriterView rewriterView{RewriterView::Amend};
|
||||
NodeInstanceView nodeInstanceView{m_connectionManager};
|
||||
RewriterView rewriterView{m_externalDependencies, RewriterView::Amend};
|
||||
NodeInstanceView nodeInstanceView{m_connectionManager, m_externalDependencies};
|
||||
nodeInstanceView.setCaptureImageMinimumAndMaximumSize(captureImageMinimumSize,
|
||||
captureImageMaximumSize);
|
||||
|
||||
|
@@ -22,6 +22,7 @@ class NotIndentingTextEditModifier;
|
||||
class ImageCacheConnectionManager;
|
||||
class RewriterView;
|
||||
class NodeInstanceView;
|
||||
class ExternalDependenciesInterface;
|
||||
|
||||
enum class ImageCacheCollectorNullImageHandling { CaptureNullImage, DontCaptureNullImage };
|
||||
|
||||
@@ -31,6 +32,7 @@ public:
|
||||
ImageCacheCollector(ImageCacheConnectionManager &connectionManager,
|
||||
QSize captureImageMinimumSize,
|
||||
QSize captureImageMaximumSize,
|
||||
ExternalDependenciesInterface &externalDependencies,
|
||||
ImageCacheCollectorNullImageHandling nullImageHandling = {});
|
||||
|
||||
~ImageCacheCollector();
|
||||
@@ -57,6 +59,7 @@ private:
|
||||
QPointer<ProjectExplorer::Target> m_target;
|
||||
QSize captureImageMinimumSize;
|
||||
QSize captureImageMaximumSize;
|
||||
ExternalDependenciesInterface &m_externalDependencies;
|
||||
ImageCacheCollectorNullImageHandling nullImageHandling{};
|
||||
};
|
||||
|
||||
|
@@ -3,10 +3,6 @@
|
||||
|
||||
#include "imagecachefontcollector.h"
|
||||
|
||||
#ifndef QMLDESIGNER_TEST // Tests don't care about UI, and can't have theme dependency here
|
||||
#include <theme.h>
|
||||
#endif
|
||||
|
||||
#include <QtGui/qrawfont.h>
|
||||
#include <QtGui/qpainter.h>
|
||||
#include <QtGui/qimage.h>
|
||||
|
@@ -12,14 +12,15 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
MeshImageCacheCollector::MeshImageCacheCollector(
|
||||
ImageCacheConnectionManager &connectionManager,
|
||||
QSize captureImageMinimumSize,
|
||||
QSize captureImageMaximumSize,
|
||||
ImageCacheCollectorNullImageHandling nullImageHandling)
|
||||
MeshImageCacheCollector::MeshImageCacheCollector(ImageCacheConnectionManager &connectionManager,
|
||||
QSize captureImageMinimumSize,
|
||||
QSize captureImageMaximumSize,
|
||||
ExternalDependenciesInterface &externalDependencies,
|
||||
ImageCacheCollectorNullImageHandling nullImageHandling)
|
||||
: m_imageCacheCollector(connectionManager,
|
||||
captureImageMinimumSize,
|
||||
captureImageMaximumSize,
|
||||
externalDependencies,
|
||||
nullImageHandling)
|
||||
{}
|
||||
|
||||
|
@@ -20,6 +20,7 @@ public:
|
||||
MeshImageCacheCollector(ImageCacheConnectionManager &connectionManager,
|
||||
QSize captureImageMinimumSize,
|
||||
QSize captureImageMaximumSize,
|
||||
ExternalDependenciesInterface &externalDependencies,
|
||||
ImageCacheCollectorNullImageHandling nullImageHandling = {});
|
||||
|
||||
~MeshImageCacheCollector();
|
||||
|
@@ -39,6 +39,7 @@ class NodeInstanceView;
|
||||
class RewriterView;
|
||||
class QmlModelState;
|
||||
class QmlTimeline;
|
||||
class ExternalDependenciesInterface;
|
||||
|
||||
enum DesignerWidgetFlags {
|
||||
DisableOnError,
|
||||
@@ -78,7 +79,9 @@ public:
|
||||
EmptyPropertiesRemoved = 0x2
|
||||
};
|
||||
Q_DECLARE_FLAGS(PropertyChangeFlags, PropertyChangeFlag)
|
||||
AbstractView() {}
|
||||
AbstractView(ExternalDependenciesInterface &externalDependencies)
|
||||
: m_externalDependencies{externalDependencies}
|
||||
{}
|
||||
|
||||
~AbstractView() override;
|
||||
|
||||
@@ -259,6 +262,8 @@ public:
|
||||
bool isEnabled() const;
|
||||
void setEnabled(bool b);
|
||||
|
||||
ExternalDependenciesInterface &externalDependencies() const { return m_externalDependencies; }
|
||||
|
||||
bool isBlockingNotifications() const { return m_isBlockingNotifications; }
|
||||
|
||||
class NotificationBlocker
|
||||
@@ -290,6 +295,7 @@ private: //functions
|
||||
|
||||
private:
|
||||
QPointer<Model> m_model;
|
||||
ExternalDependenciesInterface &m_externalDependencies;
|
||||
bool m_enabled = true;
|
||||
bool m_isBlockingNotifications = false;
|
||||
};
|
||||
|
@@ -0,0 +1,42 @@
|
||||
// Copyright (C) 2022 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <instances/puppetstartdata.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
class DesignerSettings;
|
||||
|
||||
class ExternalDependenciesInterface
|
||||
{
|
||||
// Tis class worksaround external dependencies. In the long run the caller should
|
||||
// be refactored and the dependencies cleaned up. Don't use it as a shortcut to provide
|
||||
// functionality!
|
||||
public:
|
||||
ExternalDependenciesInterface() = default;
|
||||
ExternalDependenciesInterface(const ExternalDependenciesInterface &) = delete;
|
||||
ExternalDependenciesInterface &operator=(const ExternalDependenciesInterface &) = delete;
|
||||
|
||||
virtual double formEditorDevicePixelRatio() const = 0;
|
||||
virtual QString defaultPuppetFallbackDirectory() const = 0;
|
||||
virtual QString qmlPuppetFallbackDirectory() const = 0;
|
||||
virtual QString defaultPuppetToplevelBuildDirectory() const = 0;
|
||||
virtual QUrl projectUrl() const = 0;
|
||||
virtual QString currentProjectDirPath() const = 0;
|
||||
virtual QList<QColor> designerSettingsEdit3DViewBackgroundColor() const = 0;
|
||||
virtual QColor designerSettingsEdit3DViewGridColor() const = 0;
|
||||
virtual QUrl currentResourcePath() const = 0;
|
||||
virtual void parseItemLibraryDescriptions() = 0;
|
||||
virtual const DesignerSettings &designerSettings() const = 0;
|
||||
virtual void undoOnCurrentDesignDocument() = 0;
|
||||
virtual bool viewManagerUsesRewriterView(class RewriterView *view) const = 0;
|
||||
virtual void viewManagerDiableWidgets() = 0;
|
||||
virtual QString itemLibraryImportUserComponentsTitle() const = 0;
|
||||
virtual bool isQt6Import() const = 0;
|
||||
virtual bool hasStartupTarget() const = 0;
|
||||
virtual PuppetStartData puppetStartData(const class Model &model) const = 0;
|
||||
};
|
||||
|
||||
} // namespace QmlDesigner
|
@@ -49,6 +49,8 @@ public:
|
||||
|
||||
static void setPluginPaths(const QStringList &paths);
|
||||
|
||||
static void disableParseItemLibraryDescriptionsUgly(); // ugly hack around broken tests
|
||||
|
||||
private:
|
||||
bool isGlobal() const;
|
||||
|
||||
|
@@ -74,7 +74,6 @@ public:
|
||||
}
|
||||
|
||||
QUrl fileUrl() const;
|
||||
QUrl projectUrl() const;
|
||||
void setFileUrl(const QUrl &url);
|
||||
|
||||
const MetaInfo metaInfo() const;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user