forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/8.0'
resolved conflicts: share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp src/plugins/qmldesigner/components/formeditor/formeditorview.cpp src/plugins/qmldesigner/designercore/exceptions/exception.cpp Change-Id: I13a5248415fa1ae03e1c6d0972d9b3bb8c80a3b0
This commit is contained in:
@@ -78,7 +78,13 @@ void Qt5RenderNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
|||||||
m_dirtyInstanceSet.insert(instanceForObject(effectParent));
|
m_dirtyInstanceSet.insert(instanceForObject(effectParent));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (QQuickDesignerSupport::isDirty(item, QQuickDesignerSupport::AllMask)) {
|
} else if (DesignerSupport::isDirty(
|
||||||
|
item,
|
||||||
|
DesignerSupport::DirtyType(
|
||||||
|
DesignerSupport::AllMask
|
||||||
|
| DesignerSupport::ZValue
|
||||||
|
| DesignerSupport::OpacityValue
|
||||||
|
| DesignerSupport::Visible))) {
|
||||||
ServerNodeInstance ancestorInstance = findNodeInstanceForItem(
|
ServerNodeInstance ancestorInstance = findNodeInstanceForItem(
|
||||||
item->parentItem());
|
item->parentItem());
|
||||||
if (ancestorInstance.isValid())
|
if (ancestorInstance.isValid())
|
||||||
|
|||||||
@@ -87,9 +87,7 @@ StudioControls.Menu {
|
|||||||
StudioControls.MenuItem {
|
StudioControls.MenuItem {
|
||||||
enabled: !root.isBaseState && root.hasWhenCondition
|
enabled: !root.isBaseState && root.hasWhenCondition
|
||||||
text: qsTr("Reset when Condition")
|
text: qsTr("Reset when Condition")
|
||||||
onTriggered: {
|
onTriggered: root.resetWhenCondition()
|
||||||
statesEditorModel.resetWhenCondition(internalNodeId)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StudioControls.MenuSeparator {}
|
StudioControls.MenuSeparator {}
|
||||||
|
|||||||
@@ -270,7 +270,6 @@ Item {
|
|||||||
x: scrollView.leftPadding
|
x: scrollView.leftPadding
|
||||||
y: scrollView.height - height
|
y: scrollView.height - height
|
||||||
width: scrollView.availableWidth
|
width: scrollView.availableWidth
|
||||||
active: scrollView.ScrollBar.vertical.active
|
|
||||||
orientation: Qt.Horizontal
|
orientation: Qt.Horizontal
|
||||||
onPressedChanged: root.focusSignal()
|
onPressedChanged: root.focusSignal()
|
||||||
}
|
}
|
||||||
@@ -280,7 +279,6 @@ Item {
|
|||||||
x: scrollView.mirrored ? 0 : scrollView.width - width
|
x: scrollView.mirrored ? 0 : scrollView.width - width
|
||||||
y: scrollView.topPadding
|
y: scrollView.topPadding
|
||||||
height: scrollView.availableHeight
|
height: scrollView.availableHeight
|
||||||
active: scrollView.ScrollBar.horizontal.active
|
|
||||||
orientation: Qt.Vertical
|
orientation: Qt.Vertical
|
||||||
onPressedChanged: root.focusSignal()
|
onPressedChanged: root.focusSignal()
|
||||||
}
|
}
|
||||||
@@ -656,7 +654,12 @@ Item {
|
|||||||
return
|
return
|
||||||
|
|
||||||
whenCondition.previousCondition = whenCondition.text
|
whenCondition.previousCondition = whenCondition.text
|
||||||
|
|
||||||
|
if (whenCondition.text !== "")
|
||||||
root.whenConditionFinished()
|
root.whenConditionFinished()
|
||||||
|
else
|
||||||
|
statesEditorModel.resetWhenCondition(root.internalNodeId)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: whenCondition.previousCondition = whenCondition.text
|
Component.onCompleted: whenCondition.previousCondition = whenCondition.text
|
||||||
@@ -696,6 +699,7 @@ Item {
|
|||||||
onExtend: root.extend()
|
onExtend: root.extend()
|
||||||
onRemove: root.remove()
|
onRemove: root.remove()
|
||||||
onToggle: root.propertyChangesVisible = !root.propertyChangesVisible
|
onToggle: root.propertyChangesVisible = !root.propertyChangesVisible
|
||||||
|
onResetWhenCondition: statesEditorModel.resetWhenCondition(root.internalNodeId)
|
||||||
onEditAnnotation: {
|
onEditAnnotation: {
|
||||||
statesEditorModel.setAnnotation(root.internalNodeId)
|
statesEditorModel.setAnnotation(root.internalNodeId)
|
||||||
stateMenu.hasAnnotation = root.checkAnnotation()
|
stateMenu.hasAnnotation = root.checkAnnotation()
|
||||||
|
|||||||
@@ -480,10 +480,6 @@ Section {
|
|||||||
model: root.propertiesModel
|
model: root.propertiesModel
|
||||||
|
|
||||||
property bool loadActive: true
|
property bool loadActive: true
|
||||||
onCountChanged: {
|
|
||||||
repeater.loadActive = false
|
|
||||||
repeater.loadActive = true
|
|
||||||
}
|
|
||||||
|
|
||||||
SectionLayout {
|
SectionLayout {
|
||||||
DynamicPropertyRow {
|
DynamicPropertyRow {
|
||||||
|
|||||||
@@ -49,125 +49,128 @@ QtObject {
|
|||||||
readonly property string centerHorizontal: "\u0042"
|
readonly property string centerHorizontal: "\u0042"
|
||||||
readonly property string centerVertical: "\u0043"
|
readonly property string centerVertical: "\u0043"
|
||||||
readonly property string closeCross: "\u0044"
|
readonly property string closeCross: "\u0044"
|
||||||
readonly property string colorPopupClose: "\u0045"
|
readonly property string closeLink: "\u0045"
|
||||||
readonly property string columnsAndRows: "\u0046"
|
readonly property string colorPopupClose: "\u0046"
|
||||||
readonly property string copyStyle: "\u0047"
|
readonly property string columnsAndRows: "\u0047"
|
||||||
readonly property string cornerA: "\u0048"
|
readonly property string copyLink: "\u0048"
|
||||||
readonly property string cornerB: "\u0049"
|
readonly property string copyStyle: "\u0049"
|
||||||
readonly property string cornersAll: "\u004A"
|
readonly property string cornerA: "\u004A"
|
||||||
readonly property string curveDesigner: "\u004B"
|
readonly property string cornerB: "\u004B"
|
||||||
readonly property string curveEditor: "\u004C"
|
readonly property string cornersAll: "\u004C"
|
||||||
readonly property string customMaterialEditor: "\u004D"
|
readonly property string curveDesigner: "\u004D"
|
||||||
readonly property string decisionNode: "\u004E"
|
readonly property string curveEditor: "\u004E"
|
||||||
readonly property string deleteColumn: "\u004F"
|
readonly property string customMaterialEditor: "\u004F"
|
||||||
readonly property string deleteMaterial: "\u0050"
|
readonly property string decisionNode: "\u0050"
|
||||||
readonly property string deleteRow: "\u0051"
|
readonly property string deleteColumn: "\u0051"
|
||||||
readonly property string deleteTable: "\u0052"
|
readonly property string deleteMaterial: "\u0052"
|
||||||
readonly property string detach: "\u0053"
|
readonly property string deleteRow: "\u0053"
|
||||||
readonly property string distributeBottom: "\u0054"
|
readonly property string deleteTable: "\u0054"
|
||||||
readonly property string distributeCenterHorizontal: "\u0055"
|
readonly property string detach: "\u0055"
|
||||||
readonly property string distributeCenterVertical: "\u0056"
|
readonly property string distributeBottom: "\u0056"
|
||||||
readonly property string distributeLeft: "\u0057"
|
readonly property string distributeCenterHorizontal: "\u0057"
|
||||||
readonly property string distributeOriginBottomRight: "\u0058"
|
readonly property string distributeCenterVertical: "\u0058"
|
||||||
readonly property string distributeOriginCenter: "\u0059"
|
readonly property string distributeLeft: "\u0059"
|
||||||
readonly property string distributeOriginNone: "\u005A"
|
readonly property string distributeOriginBottomRight: "\u005A"
|
||||||
readonly property string distributeOriginTopLeft: "\u005B"
|
readonly property string distributeOriginCenter: "\u005B"
|
||||||
readonly property string distributeRight: "\u005C"
|
readonly property string distributeOriginNone: "\u005C"
|
||||||
readonly property string distributeSpacingHorizontal: "\u005D"
|
readonly property string distributeOriginTopLeft: "\u005D"
|
||||||
readonly property string distributeSpacingVertical: "\u005E"
|
readonly property string distributeRight: "\u005E"
|
||||||
readonly property string distributeTop: "\u005F"
|
readonly property string distributeSpacingHorizontal: "\u005F"
|
||||||
readonly property string download: "\u0060"
|
readonly property string distributeSpacingVertical: "\u0060"
|
||||||
readonly property string downloadUnavailable: "\u0061"
|
readonly property string distributeTop: "\u0061"
|
||||||
readonly property string downloadUpdate: "\u0062"
|
readonly property string download: "\u0062"
|
||||||
readonly property string downloaded: "\u0063"
|
readonly property string downloadUnavailable: "\u0063"
|
||||||
readonly property string edit: "\u0064"
|
readonly property string downloadUpdate: "\u0064"
|
||||||
readonly property string eyeDropper: "\u0065"
|
readonly property string downloaded: "\u0065"
|
||||||
readonly property string favorite: "\u0066"
|
readonly property string edit: "\u0066"
|
||||||
readonly property string flowAction: "\u0067"
|
readonly property string eyeDropper: "\u0067"
|
||||||
readonly property string flowTransition: "\u0068"
|
readonly property string favorite: "\u0068"
|
||||||
readonly property string fontStyleBold: "\u0069"
|
readonly property string flowAction: "\u0069"
|
||||||
readonly property string fontStyleItalic: "\u006A"
|
readonly property string flowTransition: "\u006A"
|
||||||
readonly property string fontStyleStrikethrough: "\u006B"
|
readonly property string fontStyleBold: "\u006B"
|
||||||
readonly property string fontStyleUnderline: "\u006C"
|
readonly property string fontStyleItalic: "\u006C"
|
||||||
readonly property string gradient: "\u006D"
|
readonly property string fontStyleStrikethrough: "\u006D"
|
||||||
readonly property string gridView: "\u006E"
|
readonly property string fontStyleUnderline: "\u006E"
|
||||||
readonly property string idAliasOff: "\u006F"
|
readonly property string gradient: "\u006F"
|
||||||
readonly property string idAliasOn: "\u0070"
|
readonly property string gridView: "\u0070"
|
||||||
readonly property string infinity: "\u0071"
|
readonly property string idAliasOff: "\u0071"
|
||||||
readonly property string keyframe: "\u0072"
|
readonly property string idAliasOn: "\u0072"
|
||||||
readonly property string linkTriangle: "\u0073"
|
readonly property string infinity: "\u0073"
|
||||||
readonly property string linked: "\u0074"
|
readonly property string keyframe: "\u0074"
|
||||||
readonly property string listView: "\u0075"
|
readonly property string linkTriangle: "\u0075"
|
||||||
readonly property string lockOff: "\u0076"
|
readonly property string linked: "\u0076"
|
||||||
readonly property string lockOn: "\u0077"
|
readonly property string listView: "\u0077"
|
||||||
readonly property string materialPreviewEnvironment: "\u0078"
|
readonly property string lockOff: "\u0078"
|
||||||
readonly property string materialPreviewModel: "\u0079"
|
readonly property string lockOn: "\u0079"
|
||||||
readonly property string mergeCells: "\u007A"
|
readonly property string materialPreviewEnvironment: "\u007A"
|
||||||
readonly property string minus: "\u007B"
|
readonly property string materialPreviewModel: "\u007B"
|
||||||
readonly property string mirror: "\u007C"
|
readonly property string mergeCells: "\u007C"
|
||||||
readonly property string newMaterial: "\u007D"
|
readonly property string minus: "\u007D"
|
||||||
readonly property string openMaterialBrowser: "\u007E"
|
readonly property string mirror: "\u007E"
|
||||||
readonly property string orientation: "\u007F"
|
readonly property string newMaterial: "\u007F"
|
||||||
readonly property string paddingEdge: "\u0080"
|
readonly property string openLink: "\u0080"
|
||||||
readonly property string paddingFrame: "\u0081"
|
readonly property string openMaterialBrowser: "\u0081"
|
||||||
readonly property string pasteStyle: "\u0082"
|
readonly property string orientation: "\u0082"
|
||||||
readonly property string pause: "\u0083"
|
readonly property string paddingEdge: "\u0083"
|
||||||
readonly property string pin: "\u0084"
|
readonly property string paddingFrame: "\u0084"
|
||||||
readonly property string play: "\u0085"
|
readonly property string pasteStyle: "\u0085"
|
||||||
readonly property string plus: "\u0086"
|
readonly property string pause: "\u0086"
|
||||||
readonly property string promote: "\u0087"
|
readonly property string pin: "\u0087"
|
||||||
readonly property string readOnly: "\u0088"
|
readonly property string play: "\u0088"
|
||||||
readonly property string redo: "\u0089"
|
readonly property string plus: "\u0089"
|
||||||
readonly property string rotationFill: "\u008A"
|
readonly property string promote: "\u008A"
|
||||||
readonly property string rotationOutline: "\u008B"
|
readonly property string readOnly: "\u008B"
|
||||||
readonly property string search: "\u008C"
|
readonly property string redo: "\u008C"
|
||||||
readonly property string sectionToggle: "\u008D"
|
readonly property string rotationFill: "\u008D"
|
||||||
readonly property string splitColumns: "\u008E"
|
readonly property string rotationOutline: "\u008E"
|
||||||
readonly property string splitRows: "\u008F"
|
readonly property string search: "\u008F"
|
||||||
readonly property string startNode: "\u0090"
|
readonly property string sectionToggle: "\u0090"
|
||||||
readonly property string testIcon: "\u0091"
|
readonly property string splitColumns: "\u0091"
|
||||||
readonly property string textAlignBottom: "\u0092"
|
readonly property string splitRows: "\u0092"
|
||||||
readonly property string textAlignCenter: "\u0093"
|
readonly property string startNode: "\u0093"
|
||||||
readonly property string textAlignJustified: "\u0094"
|
readonly property string testIcon: "\u0094"
|
||||||
readonly property string textAlignLeft: "\u0095"
|
readonly property string textAlignBottom: "\u0095"
|
||||||
readonly property string textAlignMiddle: "\u0096"
|
readonly property string textAlignCenter: "\u0096"
|
||||||
readonly property string textAlignRight: "\u0097"
|
readonly property string textAlignJustified: "\u0097"
|
||||||
readonly property string textAlignTop: "\u0098"
|
readonly property string textAlignLeft: "\u0098"
|
||||||
readonly property string textBulletList: "\u0099"
|
readonly property string textAlignMiddle: "\u0099"
|
||||||
readonly property string textFullJustification: "\u009A"
|
readonly property string textAlignRight: "\u009A"
|
||||||
readonly property string textNumberedList: "\u009B"
|
readonly property string textAlignTop: "\u009B"
|
||||||
readonly property string tickIcon: "\u009D"
|
readonly property string textBulletList: "\u009D"
|
||||||
readonly property string translationCreateFiles: "\u009E"
|
readonly property string textFullJustification: "\u009E"
|
||||||
readonly property string translationCreateReport: "\u009F"
|
readonly property string textNumberedList: "\u009F"
|
||||||
readonly property string translationExport: "\u00A0"
|
readonly property string tickIcon: "\u00A0"
|
||||||
readonly property string translationImport: "\u00A1"
|
readonly property string translationCreateFiles: "\u00A1"
|
||||||
readonly property string translationSelectLanguages: "\u00A2"
|
readonly property string translationCreateReport: "\u00A2"
|
||||||
readonly property string translationTest: "\u00A3"
|
readonly property string translationExport: "\u00A3"
|
||||||
readonly property string transparent: "\u00A4"
|
readonly property string translationImport: "\u00A4"
|
||||||
readonly property string triState: "\u00A5"
|
readonly property string translationSelectLanguages: "\u00A5"
|
||||||
readonly property string triangleArcA: "\u00A6"
|
readonly property string translationTest: "\u00A6"
|
||||||
readonly property string triangleArcB: "\u00A7"
|
readonly property string transparent: "\u00A7"
|
||||||
readonly property string triangleCornerA: "\u00A8"
|
readonly property string triState: "\u00A8"
|
||||||
readonly property string triangleCornerB: "\u00A9"
|
readonly property string triangleArcA: "\u00A9"
|
||||||
readonly property string unLinked: "\u00AA"
|
readonly property string triangleArcB: "\u00AA"
|
||||||
readonly property string undo: "\u00AB"
|
readonly property string triangleCornerA: "\u00AB"
|
||||||
readonly property string unpin: "\u00AC"
|
readonly property string triangleCornerB: "\u00AC"
|
||||||
readonly property string upDownIcon: "\u00AE"
|
readonly property string unLinked: "\u00AE"
|
||||||
readonly property string upDownSquare2: "\u00AF"
|
readonly property string undo: "\u00AF"
|
||||||
readonly property string visibilityOff: "\u00B0"
|
readonly property string unpin: "\u00B0"
|
||||||
readonly property string visibilityOn: "\u00B1"
|
readonly property string upDownIcon: "\u00B1"
|
||||||
readonly property string wildcard: "\u00B2"
|
readonly property string upDownSquare2: "\u00B2"
|
||||||
readonly property string wizardsAutomotive: "\u00B3"
|
readonly property string visibilityOff: "\u00B3"
|
||||||
readonly property string wizardsDesktop: "\u00B4"
|
readonly property string visibilityOn: "\u00B4"
|
||||||
readonly property string wizardsGeneric: "\u00B5"
|
readonly property string wildcard: "\u00B5"
|
||||||
readonly property string wizardsMcuEmpty: "\u00B6"
|
readonly property string wizardsAutomotive: "\u00B6"
|
||||||
readonly property string wizardsMcuGraph: "\u00B7"
|
readonly property string wizardsDesktop: "\u00B7"
|
||||||
readonly property string wizardsMobile: "\u00B8"
|
readonly property string wizardsGeneric: "\u00B8"
|
||||||
readonly property string wizardsUnknown: "\u00B9"
|
readonly property string wizardsMcuEmpty: "\u00B9"
|
||||||
readonly property string zoomAll: "\u00BA"
|
readonly property string wizardsMcuGraph: "\u00BA"
|
||||||
readonly property string zoomIn: "\u00BB"
|
readonly property string wizardsMobile: "\u00BB"
|
||||||
readonly property string zoomOut: "\u00BC"
|
readonly property string wizardsUnknown: "\u00BC"
|
||||||
readonly property string zoomSelection: "\u00BD"
|
readonly property string zoomAll: "\u00BD"
|
||||||
|
readonly property string zoomIn: "\u00BE"
|
||||||
|
readonly property string zoomOut: "\u00BF"
|
||||||
|
readonly property string zoomSelection: "\u00C0"
|
||||||
|
|
||||||
readonly property font iconFont: Qt.font({
|
readonly property font iconFont: Qt.font({
|
||||||
"family": controlIcons.name,
|
"family": controlIcons.name,
|
||||||
|
|||||||
Binary file not shown.
@@ -87,7 +87,7 @@ void AssetsLibraryModel::toggleExpandAll(bool expand)
|
|||||||
|
|
||||||
void AssetsLibraryModel::deleteFiles(const QStringList &filePaths)
|
void AssetsLibraryModel::deleteFiles(const QStringList &filePaths)
|
||||||
{
|
{
|
||||||
bool askBeforeDelete = DesignerSettings::getValue(
|
bool askBeforeDelete = QmlDesignerPlugin::settings().value(
|
||||||
DesignerSettingsKey::ASK_BEFORE_DELETING_ASSET).toBool();
|
DesignerSettingsKey::ASK_BEFORE_DELETING_ASSET).toBool();
|
||||||
bool assetDelete = true;
|
bool assetDelete = true;
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ void AssetsLibraryModel::deleteFiles(const QStringList &filePaths)
|
|||||||
assetDelete = false;
|
assetDelete = false;
|
||||||
|
|
||||||
if (cb.isChecked())
|
if (cb.isChecked())
|
||||||
DesignerSettings::setValue(DesignerSettingsKey::ASK_BEFORE_DELETING_ASSET, false);
|
QmlDesignerPlugin::settings().insert(DesignerSettingsKey::ASK_BEFORE_DELETING_ASSET, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (assetDelete) {
|
if (assetDelete) {
|
||||||
|
|||||||
@@ -232,6 +232,9 @@ void ActionEditor::prepareConnections()
|
|||||||
QmlJS::ValueOwner *interp = context->valueOwner();
|
QmlJS::ValueOwner *interp = context->valueOwner();
|
||||||
const QmlJS::Value *value = interp->convertToObject(scopeChain.evaluate(expression));
|
const QmlJS::Value *value = interp->convertToObject(scopeChain.evaluate(expression));
|
||||||
|
|
||||||
|
if (value->asNullValue() && !methodBlackList.contains(slotName))
|
||||||
|
connection.methods.append(QString::fromUtf8(slotName));
|
||||||
|
|
||||||
if (const QmlJS::FunctionValue *f = value->asFunctionValue()) {
|
if (const QmlJS::FunctionValue *f = value->asFunctionValue()) {
|
||||||
// Only add slots with zero arguments
|
// Only add slots with zero arguments
|
||||||
if (f->namedArgumentCount() == 0 && !methodBlackList.contains(slotName))
|
if (f->namedArgumentCount() == 0 && !methodBlackList.contains(slotName))
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ Utils::CrumblePath *CrumbleBar::crumblePath()
|
|||||||
bool CrumbleBar::showSaveDialog()
|
bool CrumbleBar::showSaveDialog()
|
||||||
{
|
{
|
||||||
bool canceled = false;
|
bool canceled = false;
|
||||||
bool alwaysSave = DesignerSettings::getValue(DesignerSettingsKey::ALWAYS_SAVE_IN_CRUMBLEBAR).toBool();
|
bool alwaysSave = QmlDesignerPlugin::settings().value(DesignerSettingsKey::ALWAYS_SAVE_IN_CRUMBLEBAR).toBool();
|
||||||
if (alwaysSave) {
|
if (alwaysSave) {
|
||||||
Core::DocumentManager::saveModifiedDocumentSilently(currentDesignDocument()->editor()->document());
|
Core::DocumentManager::saveModifiedDocumentSilently(currentDesignDocument()->editor()->document());
|
||||||
} else {
|
} else {
|
||||||
@@ -133,7 +133,7 @@ bool CrumbleBar::showSaveDialog()
|
|||||||
tr("Always save when leaving subcomponent"),
|
tr("Always save when leaving subcomponent"),
|
||||||
&alwaysSave);
|
&alwaysSave);
|
||||||
|
|
||||||
DesignerSettings::setValue(DesignerSettingsKey::ALWAYS_SAVE_IN_CRUMBLEBAR, alwaysSave);
|
QmlDesignerPlugin::settings().insert(DesignerSettingsKey::ALWAYS_SAVE_IN_CRUMBLEBAR, alwaysSave);
|
||||||
}
|
}
|
||||||
return !canceled;
|
return !canceled;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,10 @@ public:
|
|||||||
centerHorizontal,
|
centerHorizontal,
|
||||||
centerVertical,
|
centerVertical,
|
||||||
closeCross,
|
closeCross,
|
||||||
|
closeLink,
|
||||||
colorPopupClose,
|
colorPopupClose,
|
||||||
columnsAndRows,
|
columnsAndRows,
|
||||||
|
copyLink,
|
||||||
copyStyle,
|
copyStyle,
|
||||||
cornerA,
|
cornerA,
|
||||||
cornerB,
|
cornerB,
|
||||||
@@ -114,6 +116,7 @@ public:
|
|||||||
minus,
|
minus,
|
||||||
mirror,
|
mirror,
|
||||||
newMaterial,
|
newMaterial,
|
||||||
|
openLink,
|
||||||
openMaterialBrowser,
|
openMaterialBrowser,
|
||||||
orientation,
|
orientation,
|
||||||
paddingEdge,
|
paddingEdge,
|
||||||
|
|||||||
@@ -74,8 +74,6 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
|
|||||||
for (auto toolButton : buttons)
|
for (auto toolButton : buttons)
|
||||||
ui->toolBar->addWidget(toolButton);
|
ui->toolBar->addWidget(toolButton);
|
||||||
|
|
||||||
auto settings = QmlDesignerPlugin::instance()->settings();
|
|
||||||
|
|
||||||
if (!QmlProjectManager::QmlProject::isQtDesignStudio())
|
if (!QmlProjectManager::QmlProject::isQtDesignStudio())
|
||||||
ui->tabBar->addTab(tr("Backends", "Title of dynamic properties view"));
|
ui->tabBar->addTab(tr("Backends", "Title of dynamic properties view"));
|
||||||
|
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ const QString lineBreak = QStringLiteral("<br>");
|
|||||||
|
|
||||||
bool isDebugViewEnabled()
|
bool isDebugViewEnabled()
|
||||||
{
|
{
|
||||||
return QmlDesigner::DesignerSettings::getValue(
|
return QmlDesigner::QmlDesignerPlugin::settings().value(
|
||||||
QmlDesigner::DesignerSettingsKey::ENABLE_DEBUGVIEW).toBool();
|
QmlDesigner::DesignerSettingsKey::ENABLE_DEBUGVIEW).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isDebugViewShown()
|
bool isDebugViewShown()
|
||||||
{
|
{
|
||||||
return QmlDesigner::DesignerSettings::getValue(
|
return QmlDesigner::QmlDesignerPlugin::settings().value(
|
||||||
QmlDesigner::DesignerSettingsKey::SHOW_DEBUGVIEW).toBool();
|
QmlDesigner::DesignerSettingsKey::SHOW_DEBUGVIEW).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ void DebugViewWidget::setDebugViewEnabled(bool b)
|
|||||||
|
|
||||||
void DebugViewWidget::enabledCheckBoxToggled(bool b)
|
void DebugViewWidget::enabledCheckBoxToggled(bool b)
|
||||||
{
|
{
|
||||||
DesignerSettings::setValue(DesignerSettingsKey::WARNING_FOR_FEATURES_IN_DESIGNER, b);
|
QmlDesignerPlugin::settings().insert(DesignerSettingsKey::WARNING_FOR_FEATURES_IN_DESIGNER, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
} //namespace Internal
|
} //namespace Internal
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ void Edit3DView::createEdit3DActions()
|
|||||||
m_particlesRestartAction->action()->setEnabled(particlemode);
|
m_particlesRestartAction->action()->setEnabled(particlemode);
|
||||||
if (m_seeker)
|
if (m_seeker)
|
||||||
m_seeker->setEnabled(false);
|
m_seeker->setEnabled(false);
|
||||||
QmlDesigner::DesignerSettings::setValue("particleMode", particlemode);
|
QmlDesignerPlugin::settings().insert("particleMode", particlemode);
|
||||||
setCurrentStateNode(rootModelNode());
|
setCurrentStateNode(rootModelNode());
|
||||||
resetPuppet();
|
resetPuppet();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class Edit3DViewConfig
|
|||||||
public:
|
public:
|
||||||
static QList<QColor> load(const char key[])
|
static QList<QColor> load(const char key[])
|
||||||
{
|
{
|
||||||
QVariant var = DesignerSettings::getValue(key);
|
QVariant var = QmlDesignerPlugin::settings().value(key);
|
||||||
|
|
||||||
if (!var.isValid())
|
if (!var.isValid())
|
||||||
return {};
|
return {};
|
||||||
@@ -65,7 +65,7 @@ private:
|
|||||||
|
|
||||||
static void saveVariant(const QByteArray &key, const QVariant &colorConfig)
|
static void saveVariant(const QByteArray &key, const QVariant &colorConfig)
|
||||||
{
|
{
|
||||||
DesignerSettings::setValue(key, colorConfig);
|
QmlDesignerPlugin::settings().insert(key, colorConfig);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -73,12 +73,12 @@ FormEditorItem* FormEditorScene::itemForQmlItemNode(const QmlItemNode &qmlItemNo
|
|||||||
|
|
||||||
double FormEditorScene::canvasWidth() const
|
double FormEditorScene::canvasWidth() const
|
||||||
{
|
{
|
||||||
return DesignerSettings::getValue(DesignerSettingsKey::CANVASWIDTH).toDouble();
|
return QmlDesignerPlugin::settings().value(DesignerSettingsKey::CANVASWIDTH).toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
double FormEditorScene::canvasHeight() const
|
double FormEditorScene::canvasHeight() const
|
||||||
{
|
{
|
||||||
return DesignerSettings::getValue(DesignerSettingsKey::CANVASHEIGHT).toDouble();
|
return QmlDesignerPlugin::settings().value(DesignerSettingsKey::CANVASHEIGHT).toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<FormEditorItem*> FormEditorScene::itemsForQmlItemNodes(const QList<QmlItemNode> &nodeList) const
|
QList<FormEditorItem*> FormEditorScene::itemsForQmlItemNodes(const QList<QmlItemNode> &nodeList) const
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "abstractcustomtool.h"
|
#include "abstractcustomtool.h"
|
||||||
|
|
||||||
#include <auxiliarydataproperties.h>
|
#include <auxiliarydataproperties.h>
|
||||||
|
#include <qmldesignerplugin.h>
|
||||||
#include <bindingproperty.h>
|
#include <bindingproperty.h>
|
||||||
#include <designersettings.h>
|
#include <designersettings.h>
|
||||||
#include <designmodecontext.h>
|
#include <designmodecontext.h>
|
||||||
@@ -689,8 +690,8 @@ constexpr AuxiliaryDataKeyView autoSizeProperty{AuxiliaryDataType::Temporary, "a
|
|||||||
void FormEditorView::instanceInformationsChanged(const QMultiHash<ModelNode, InformationName> &informationChangedHash)
|
void FormEditorView::instanceInformationsChanged(const QMultiHash<ModelNode, InformationName> &informationChangedHash)
|
||||||
{
|
{
|
||||||
QList<FormEditorItem*> changedItems;
|
QList<FormEditorItem*> changedItems;
|
||||||
const int rootElementInitWidth = DesignerSettings::getValue(DesignerSettingsKey::ROOT_ELEMENT_INIT_WIDTH).toInt();
|
const int rootElementInitWidth = QmlDesignerPlugin::settings().value(DesignerSettingsKey::ROOT_ELEMENT_INIT_WIDTH).toInt();
|
||||||
const int rootElementInitHeight = DesignerSettings::getValue(DesignerSettingsKey::ROOT_ELEMENT_INIT_HEIGHT).toInt();
|
const int rootElementInitHeight = QmlDesignerPlugin::settings().value(DesignerSettingsKey::ROOT_ELEMENT_INIT_HEIGHT).toInt();
|
||||||
|
|
||||||
QList<ModelNode> informationChangedNodes = Utils::filtered(informationChangedHash.keys(), [](const ModelNode &node) {
|
QList<ModelNode> informationChangedNodes = Utils::filtered(informationChangedHash.keys(), [](const ModelNode &node) {
|
||||||
return QmlItemNode::isValidQmlItemNode(node);
|
return QmlItemNode::isValidQmlItemNode(node);
|
||||||
|
|||||||
@@ -469,12 +469,12 @@ ToolBox *FormEditorWidget::toolBox() const
|
|||||||
|
|
||||||
double FormEditorWidget::spacing() const
|
double FormEditorWidget::spacing() const
|
||||||
{
|
{
|
||||||
return DesignerSettings::getValue(DesignerSettingsKey::ITEMSPACING).toDouble();
|
return QmlDesignerPlugin::settings().value(DesignerSettingsKey::ITEMSPACING).toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
double FormEditorWidget::containerPadding() const
|
double FormEditorWidget::containerPadding() const
|
||||||
{
|
{
|
||||||
return DesignerSettings::getValue(DesignerSettingsKey::CONTAINERPADDING).toDouble();
|
return QmlDesignerPlugin::settings().value(DesignerSettingsKey::CONTAINERPADDING).toDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormEditorWidget::contextHelp(const Core::IContext::HelpCallback &callback) const
|
void FormEditorWidget::contextHelp(const Core::IContext::HelpCallback &callback) const
|
||||||
|
|||||||
@@ -263,7 +263,7 @@ void ItemLibraryWidget::goIntoComponent(const QString &source)
|
|||||||
|
|
||||||
void ItemLibraryWidget::delayedUpdateModel()
|
void ItemLibraryWidget::delayedUpdateModel()
|
||||||
{
|
{
|
||||||
static bool disableTimer = DesignerSettings::getValue(DesignerSettingsKey::DISABLE_ITEM_LIBRARY_UPDATE_TIMER).toBool();
|
static bool disableTimer = QmlDesignerPlugin::settings().value(DesignerSettingsKey::DISABLE_ITEM_LIBRARY_UPDATE_TIMER).toBool();
|
||||||
if (disableTimer)
|
if (disableTimer)
|
||||||
updateModel();
|
updateModel();
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -136,10 +136,10 @@ void NavigatorView::modelAttached(Model *model)
|
|||||||
|
|
||||||
QTimer::singleShot(0, this, [this, treeView]() {
|
QTimer::singleShot(0, this, [this, treeView]() {
|
||||||
m_currentModelInterface->setFilter(
|
m_currentModelInterface->setFilter(
|
||||||
DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool());
|
QmlDesignerPlugin::settings().value(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool());
|
||||||
|
|
||||||
m_currentModelInterface->setOrder(
|
m_currentModelInterface->setOrder(
|
||||||
DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool());
|
QmlDesignerPlugin::settings().value(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool());
|
||||||
|
|
||||||
// Expand everything to begin with to ensure model node to index cache is populated
|
// Expand everything to begin with to ensure model node to index cache is populated
|
||||||
treeView->expandAll();
|
treeView->expandAll();
|
||||||
@@ -501,7 +501,7 @@ void NavigatorView::rightButtonClicked()
|
|||||||
return; //Semantics are unclear for multi selection.
|
return; //Semantics are unclear for multi selection.
|
||||||
|
|
||||||
bool blocked = blockSelectionChangedSignal(true);
|
bool blocked = blockSelectionChangedSignal(true);
|
||||||
bool reverse = DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool();
|
bool reverse = QmlDesignerPlugin::settings().value(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool();
|
||||||
|
|
||||||
for (const ModelNode &node : selectedModelNodes()) {
|
for (const ModelNode &node : selectedModelNodes()) {
|
||||||
if (!node.isRootNode() && node.parentProperty().isNodeListProperty() && node.parentProperty().count() > 1) {
|
if (!node.isRootNode() && node.parentProperty().isNodeListProperty() && node.parentProperty().count() > 1) {
|
||||||
@@ -541,7 +541,7 @@ void NavigatorView::rightButtonClicked()
|
|||||||
void NavigatorView::upButtonClicked()
|
void NavigatorView::upButtonClicked()
|
||||||
{
|
{
|
||||||
bool blocked = blockSelectionChangedSignal(true);
|
bool blocked = blockSelectionChangedSignal(true);
|
||||||
bool reverse = DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool();
|
bool reverse = QmlDesignerPlugin::settings().value(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool();
|
||||||
|
|
||||||
if (reverse)
|
if (reverse)
|
||||||
moveNodesDown(selectedModelNodes());
|
moveNodesDown(selectedModelNodes());
|
||||||
@@ -555,7 +555,7 @@ void NavigatorView::upButtonClicked()
|
|||||||
void NavigatorView::downButtonClicked()
|
void NavigatorView::downButtonClicked()
|
||||||
{
|
{
|
||||||
bool blocked = blockSelectionChangedSignal(true);
|
bool blocked = blockSelectionChangedSignal(true);
|
||||||
bool reverse = DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool();
|
bool reverse = QmlDesignerPlugin::settings().value(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool();
|
||||||
|
|
||||||
if (reverse)
|
if (reverse)
|
||||||
moveNodesUp(selectedModelNodes());
|
moveNodesUp(selectedModelNodes());
|
||||||
@@ -570,14 +570,14 @@ void NavigatorView::filterToggled(bool flag)
|
|||||||
{
|
{
|
||||||
m_currentModelInterface->setFilter(flag);
|
m_currentModelInterface->setFilter(flag);
|
||||||
treeWidget()->expandAll();
|
treeWidget()->expandAll();
|
||||||
DesignerSettings::setValue(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS, flag);
|
QmlDesignerPlugin::settings().insert(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigatorView::reverseOrderToggled(bool flag)
|
void NavigatorView::reverseOrderToggled(bool flag)
|
||||||
{
|
{
|
||||||
m_currentModelInterface->setOrder(flag);
|
m_currentModelInterface->setOrder(flag);
|
||||||
treeWidget()->expandAll();
|
treeWidget()->expandAll();
|
||||||
DesignerSettings::setValue(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER, flag);
|
QmlDesignerPlugin::settings().insert(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER, flag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NavigatorView::textFilterChanged(const QString &text)
|
void NavigatorView::textFilterChanged(const QString &text)
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
|
|||||||
auto filterAction = new QAction(tr("Show Only Visible Components"), nullptr);
|
auto filterAction = new QAction(tr("Show Only Visible Components"), nullptr);
|
||||||
filterAction->setCheckable(true);
|
filterAction->setCheckable(true);
|
||||||
|
|
||||||
bool filterFlag = DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool();
|
bool filterFlag = QmlDesignerPlugin::settings().value(DesignerSettingsKey::NAVIGATOR_SHOW_ONLY_VISIBLE_ITEMS).toBool();
|
||||||
filterAction->setChecked(filterFlag);
|
filterAction->setChecked(filterFlag);
|
||||||
|
|
||||||
connect(filterAction, &QAction::toggled, this, &NavigatorWidget::filterToggled);
|
connect(filterAction, &QAction::toggled, this, &NavigatorWidget::filterToggled);
|
||||||
@@ -125,7 +125,7 @@ QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
|
|||||||
auto reverseAction = new QAction(tr("Reverse Component Order"), nullptr);
|
auto reverseAction = new QAction(tr("Reverse Component Order"), nullptr);
|
||||||
reverseAction->setCheckable(true);
|
reverseAction->setCheckable(true);
|
||||||
|
|
||||||
bool reverseFlag = DesignerSettings::getValue(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool();
|
bool reverseFlag = QmlDesignerPlugin::settings().value(DesignerSettingsKey::NAVIGATOR_REVERSE_ITEM_ORDER).toBool();
|
||||||
reverseAction->setChecked(reverseFlag);
|
reverseAction->setChecked(reverseFlag);
|
||||||
|
|
||||||
connect(reverseAction, &QAction::toggled, this, &NavigatorWidget::reverseOrderToggled);
|
connect(reverseAction, &QAction::toggled, this, &NavigatorWidget::reverseOrderToggled);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
#include "designersettings.h"
|
#include "designersettings.h"
|
||||||
|
#include <qmldesignerplugin.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
@@ -37,7 +38,7 @@ struct Palette
|
|||||||
|
|
||||||
bool read()
|
bool read()
|
||||||
{
|
{
|
||||||
QStringList data = QmlDesigner::DesignerSettings::getValue(m_settingsKey).toStringList();
|
QStringList data = QmlDesignerPlugin::settings().value(m_settingsKey).toStringList();
|
||||||
if (data.isEmpty())
|
if (data.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ struct Palette
|
|||||||
|
|
||||||
void write() const
|
void write() const
|
||||||
{
|
{
|
||||||
QmlDesigner::DesignerSettings::setValue(m_settingsKey, m_colors);
|
QmlDesignerPlugin::settings().insert(m_settingsKey, m_colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray m_settingsKey;
|
QByteArray m_settingsKey;
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ void TextEditorView::reformatFile()
|
|||||||
|
|
||||||
// Reformat document if we have a .ui.qml file
|
// Reformat document if we have a .ui.qml file
|
||||||
if (document && document->filePath().toString().endsWith(".ui.qml")
|
if (document && document->filePath().toString().endsWith(".ui.qml")
|
||||||
&& DesignerSettings::getValue(DesignerSettingsKey::REFORMAT_UI_QML_FILES).toBool()) {
|
&& QmlDesignerPlugin::settings().value(DesignerSettingsKey::REFORMAT_UI_QML_FILES).toBool()) {
|
||||||
|
|
||||||
QmlJS::Document::Ptr currentDocument(document->semanticInfo().document);
|
QmlJS::Document::Ptr currentDocument(document->semanticInfo().document);
|
||||||
QmlJS::Snapshot snapshot = QmlJS::ModelManagerInterface::instance()->snapshot();
|
QmlJS::Snapshot snapshot = QmlJS::ModelManagerInterface::instance()->snapshot();
|
||||||
|
|||||||
@@ -28,15 +28,14 @@ void InteractiveConnectionManager::setUp(NodeInstanceServerInterface *nodeInstan
|
|||||||
{
|
{
|
||||||
ConnectionManager::setUp(nodeInstanceServer, qrcMappingString, target, view);
|
ConnectionManager::setUp(nodeInstanceServer, qrcMappingString, target, view);
|
||||||
|
|
||||||
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
|
int timeOutTime = QmlDesignerPlugin::settings()
|
||||||
int timeOutTime = settings.value(DesignerSettingsKey::PUPPET_KILL_TIMEOUT).toInt();
|
.value(DesignerSettingsKey::PUPPET_KILL_TIMEOUT).toInt();
|
||||||
for (Connection &connection : connections()) {
|
for (Connection &connection : connections()) {
|
||||||
connection.timer.reset(new QTimer);
|
connection.timer.reset(new QTimer);
|
||||||
connection.timer->setInterval(timeOutTime);
|
connection.timer->setInterval(timeOutTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QmlDesignerPlugin::instance()
|
if (QmlDesignerPlugin::settings()
|
||||||
->settings()
|
|
||||||
.value(DesignerSettingsKey::DEBUG_PUPPET)
|
.value(DesignerSettingsKey::DEBUG_PUPPET)
|
||||||
.toString()
|
.toString()
|
||||||
.isEmpty()) {
|
.isEmpty()) {
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ bool PuppetCreator::useOnlyFallbackPuppet() const
|
|||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
if (!m_target || !m_target->kit()->isValid())
|
if (!m_target || !m_target->kit()->isValid())
|
||||||
qWarning() << "Invalid kit for QML puppet";
|
qWarning() << "Invalid kit for QML puppet";
|
||||||
return m_designerSettings.value(DesignerSettingsKey::USE_DEFAULT_PUPPET).toBool()
|
return QmlDesignerPlugin::settings().value(DesignerSettingsKey::USE_DEFAULT_PUPPET).toBool()
|
||||||
|| m_target == nullptr || !m_target->kit()->isValid();
|
|| m_target == nullptr || !m_target->kit()->isValid();
|
||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
@@ -166,9 +166,6 @@ PuppetCreator::PuppetCreator(ProjectExplorer::Target *target, const Model *model
|
|||||||
: m_target(target)
|
: m_target(target)
|
||||||
, m_availablePuppetType(FallbackPuppet)
|
, m_availablePuppetType(FallbackPuppet)
|
||||||
, m_model(model)
|
, m_model(model)
|
||||||
#ifndef QMLDESIGNER_TEST
|
|
||||||
, m_designerSettings(QmlDesignerPlugin::instance()->settings())
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,7 +207,7 @@ QProcessUniquePointer PuppetCreator::puppetProcess(
|
|||||||
processFinishCallback);
|
processFinishCallback);
|
||||||
|
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
QString forwardOutput = m_designerSettings.value(DesignerSettingsKey::
|
QString forwardOutput = QmlDesignerPlugin::settings().value(DesignerSettingsKey::
|
||||||
FORWARD_PUPPET_OUTPUT).toString();
|
FORWARD_PUPPET_OUTPUT).toString();
|
||||||
#else
|
#else
|
||||||
QString forwardOutput("all");
|
QString forwardOutput("all");
|
||||||
@@ -243,7 +240,7 @@ QProcessUniquePointer PuppetCreator::puppetProcess(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
QString debugPuppet = m_designerSettings.value(DesignerSettingsKey::
|
QString debugPuppet = QmlDesignerPlugin::settings().value(DesignerSettingsKey::
|
||||||
DEBUG_PUPPET).toString();
|
DEBUG_PUPPET).toString();
|
||||||
#else
|
#else
|
||||||
QString debugPuppet("all");
|
QString debugPuppet("all");
|
||||||
@@ -393,7 +390,7 @@ QString PuppetCreator::defaultPuppetToplevelBuildDirectory()
|
|||||||
QString PuppetCreator::qmlPuppetToplevelBuildDirectory() const
|
QString PuppetCreator::qmlPuppetToplevelBuildDirectory() const
|
||||||
{
|
{
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
QString puppetToplevelBuildDirectory = m_designerSettings.value(
|
QString puppetToplevelBuildDirectory = QmlDesignerPlugin::settings().value(
|
||||||
DesignerSettingsKey::PUPPET_TOPLEVEL_BUILD_DIRECTORY).toString();
|
DesignerSettingsKey::PUPPET_TOPLEVEL_BUILD_DIRECTORY).toString();
|
||||||
if (puppetToplevelBuildDirectory.isEmpty())
|
if (puppetToplevelBuildDirectory.isEmpty())
|
||||||
return defaultPuppetToplevelBuildDirectory();
|
return defaultPuppetToplevelBuildDirectory();
|
||||||
@@ -413,7 +410,7 @@ QString PuppetCreator::qmlPuppetDirectory(PuppetType puppetType) const
|
|||||||
if (puppetType == BinPathPuppet)
|
if (puppetType == BinPathPuppet)
|
||||||
return pathForBinPuppet(m_target).toFileInfo().absoluteDir().canonicalPath();
|
return pathForBinPuppet(m_target).toFileInfo().absoluteDir().canonicalPath();
|
||||||
|
|
||||||
return qmlPuppetFallbackDirectory(m_designerSettings);
|
return qmlPuppetFallbackDirectory(QmlDesignerPlugin::settings());
|
||||||
#else
|
#else
|
||||||
return QString();
|
return QString();
|
||||||
#endif
|
#endif
|
||||||
@@ -475,10 +472,10 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
|
|||||||
environment.set("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
|
environment.set("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
|
||||||
|
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
const QString controlsStyle = m_designerSettings.value(DesignerSettingsKey::
|
const QString controlsStyle = QmlDesignerPlugin::settings().value(DesignerSettingsKey::
|
||||||
CONTROLS_STYLE).toString();
|
CONTROLS_STYLE).toString();
|
||||||
|
|
||||||
const bool smoothRendering = m_designerSettings.value(DesignerSettingsKey::SMOOTH_RENDERING)
|
const bool smoothRendering = QmlDesignerPlugin::settings().value(DesignerSettingsKey::SMOOTH_RENDERING)
|
||||||
.toBool();
|
.toBool();
|
||||||
|
|
||||||
if (smoothRendering)
|
if (smoothRendering)
|
||||||
@@ -525,7 +522,7 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
|
|||||||
environment.set("QMLDESIGNER_FORCE_QAPPLICATION", "true");
|
environment.set("QMLDESIGNER_FORCE_QAPPLICATION", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool particlemode = QmlDesigner::DesignerSettings::getValue("particleMode").toBool();
|
bool particlemode = QmlDesigner::QmlDesignerPlugin::settings().value("particleMode").toBool();
|
||||||
if (!particlemode)
|
if (!particlemode)
|
||||||
environment.set("QT_QUICK3D_DISABLE_PARTICLE_SYSTEMS", "1");
|
environment.set("QT_QUICK3D_DISABLE_PARTICLE_SYSTEMS", "1");
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -86,9 +86,6 @@ private:
|
|||||||
PuppetType m_availablePuppetType;
|
PuppetType m_availablePuppetType;
|
||||||
static QHash<Utils::Id, PuppetType> m_qml2PuppetForKitPuppetHash;
|
static QHash<Utils::Id, PuppetType> m_qml2PuppetForKitPuppetHash;
|
||||||
const Model *m_model = nullptr;
|
const Model *m_model = nullptr;
|
||||||
#ifndef QMLDESIGNER_TEST
|
|
||||||
const DesignerSettings m_designerSettings;
|
|
||||||
#endif
|
|
||||||
QString m_qrcMapping;
|
QString m_qrcMapping;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1367,12 +1367,22 @@ WriteLocker::WriteLocker(Model *model)
|
|||||||
WriteLocker::~WriteLocker()
|
WriteLocker::~WriteLocker()
|
||||||
{
|
{
|
||||||
if (!m_model->m_writeLock)
|
if (!m_model->m_writeLock)
|
||||||
qWarning() << "QmlDesigner: Misbehaving view calls back to model!!!";
|
qWarning() << "QmlDesigner: WriterLocker out of sync!!!";
|
||||||
// FIXME: Enable it again
|
// FIXME: Enable it again
|
||||||
Q_ASSERT(m_model->m_writeLock);
|
Q_ASSERT(m_model->m_writeLock);
|
||||||
m_model->m_writeLock = false;
|
m_model->m_writeLock = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WriteLocker::unlock(Model *model)
|
||||||
|
{
|
||||||
|
model->d->m_writeLock = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteLocker::lock(Model *model)
|
||||||
|
{
|
||||||
|
model->d->m_writeLock = true;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
Model::Model(ProjectStorage<Sqlite::Database> &projectStorage,
|
Model::Model(ProjectStorage<Sqlite::Database> &projectStorage,
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ public:
|
|||||||
WriteLocker(ModelPrivate *model);
|
WriteLocker(ModelPrivate *model);
|
||||||
~WriteLocker();
|
~WriteLocker();
|
||||||
|
|
||||||
|
static void unlock(Model *model);
|
||||||
|
static void lock(Model *model);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<ModelPrivate> m_model;
|
QPointer<ModelPrivate> m_model;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -662,10 +662,10 @@ QString QmlObjectNode::generateTranslatableText([[maybe_unused]] const QString &
|
|||||||
{
|
{
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
|
|
||||||
if (QmlDesignerPlugin::instance()->settings().value(
|
if (QmlDesignerPlugin::settings().value(
|
||||||
DesignerSettingsKey::TYPE_OF_QSTR_FUNCTION).toInt())
|
DesignerSettingsKey::TYPE_OF_QSTR_FUNCTION).toInt())
|
||||||
|
|
||||||
switch (QmlDesignerPlugin::instance()->settings().value(
|
switch (QmlDesignerPlugin::settings().value(
|
||||||
DesignerSettingsKey::TYPE_OF_QSTR_FUNCTION).toInt()) {
|
DesignerSettingsKey::TYPE_OF_QSTR_FUNCTION).toInt()) {
|
||||||
case 0: return QString(QStringLiteral("qsTr(\"%1\")")).arg(text);
|
case 0: return QString(QStringLiteral("qsTr(\"%1\")")).arg(text);
|
||||||
case 1: return QString(QStringLiteral("qsTrId(\"%1\")")).arg(text);
|
case 1: return QString(QStringLiteral("qsTrId(\"%1\")")).arg(text);
|
||||||
|
|||||||
@@ -6,17 +6,18 @@
|
|||||||
#include "texttomodelmerger.h"
|
#include "texttomodelmerger.h"
|
||||||
#include "modeltotextmerger.h"
|
#include "modeltotextmerger.h"
|
||||||
|
|
||||||
#include <variantproperty.h>
|
|
||||||
#include <bindingproperty.h>
|
#include <bindingproperty.h>
|
||||||
|
#include <customnotifications.h>
|
||||||
|
#include <filemanager/astobjecttextextractor.h>
|
||||||
|
#include <filemanager/firstdefinitionfinder.h>
|
||||||
|
#include <filemanager/objectlengthcalculator.h>
|
||||||
|
#include <model_p.h>
|
||||||
|
#include <modelnode.h>
|
||||||
|
#include <modelnodepositionstorage.h>
|
||||||
|
#include <nodeproperty.h>
|
||||||
#include <rewritingexception.h>
|
#include <rewritingexception.h>
|
||||||
#include <signalhandlerproperty.h>
|
#include <signalhandlerproperty.h>
|
||||||
#include <filemanager/astobjecttextextractor.h>
|
#include <variantproperty.h>
|
||||||
#include <filemanager/objectlengthcalculator.h>
|
|
||||||
#include <filemanager/firstdefinitionfinder.h>
|
|
||||||
#include <customnotifications.h>
|
|
||||||
#include <modelnodepositionstorage.h>
|
|
||||||
#include <modelnode.h>
|
|
||||||
#include <nodeproperty.h>
|
|
||||||
#include <qmlobjectnode.h>
|
#include <qmlobjectnode.h>
|
||||||
#include <qmltimelinekeyframegroup.h>
|
#include <qmltimelinekeyframegroup.h>
|
||||||
|
|
||||||
@@ -755,7 +756,9 @@ void RewriterView::resetToLastCorrectQml()
|
|||||||
m_textModifier->textDocument()->undo();
|
m_textModifier->textDocument()->undo();
|
||||||
m_textModifier->textDocument()->clearUndoRedoStacks(QTextDocument::RedoStack);
|
m_textModifier->textDocument()->clearUndoRedoStacks(QTextDocument::RedoStack);
|
||||||
ModelAmender differenceHandler(m_textToModelMerger.data());
|
ModelAmender differenceHandler(m_textToModelMerger.data());
|
||||||
|
Internal::WriteLocker::unlock(model());
|
||||||
m_textToModelMerger->load(m_textModifier->text(), differenceHandler);
|
m_textToModelMerger->load(m_textModifier->text(), differenceHandler);
|
||||||
|
Internal::WriteLocker::lock(model());
|
||||||
|
|
||||||
leaveErrorState();
|
leaveErrorState();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
|
|
||||||
#include "designersettings.h"
|
#include "designersettings.h"
|
||||||
|
|
||||||
#include <qmldesignerplugin.h>
|
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
@@ -14,11 +12,35 @@ namespace DesignerSettingsGroupKey {
|
|||||||
const char QML_DESIGNER_SETTINGS_GROUP[] = "Designer";
|
const char QML_DESIGNER_SETTINGS_GROUP[] = "Designer";
|
||||||
}
|
}
|
||||||
|
|
||||||
DesignerSettings::DesignerSettings() = default;
|
DesignerSettings::DesignerSettings(QSettings *settings) :
|
||||||
|
m_settings(settings)
|
||||||
|
{
|
||||||
|
fromSettings(settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DesignerSettings::insert(const QByteArray &key, const QVariant &value)
|
||||||
|
{
|
||||||
|
QMutexLocker locker(&m_mutex);
|
||||||
|
m_cache.insert(key, value);
|
||||||
|
toSettings(m_settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DesignerSettings::insert(const QHash<QByteArray, QVariant> &settingsHash)
|
||||||
|
{
|
||||||
|
QMutexLocker locker(&m_mutex);
|
||||||
|
m_cache.insert(settingsHash);
|
||||||
|
toSettings(m_settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant DesignerSettings::value(const QByteArray &key, const QVariant &defaultValue) const
|
||||||
|
{
|
||||||
|
QMutexLocker locker(&m_mutex);
|
||||||
|
return m_cache.value(key);
|
||||||
|
}
|
||||||
|
|
||||||
void DesignerSettings::restoreValue(QSettings *settings, const QByteArray &key, const QVariant &defaultValue)
|
void DesignerSettings::restoreValue(QSettings *settings, const QByteArray &key, const QVariant &defaultValue)
|
||||||
{
|
{
|
||||||
insert(key, settings->value(QString::fromLatin1(key), defaultValue));
|
m_cache.insert(key, settings->value(QString::fromLatin1(key), defaultValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DesignerSettings::fromSettings(QSettings *settings)
|
void DesignerSettings::fromSettings(QSettings *settings)
|
||||||
@@ -58,8 +80,8 @@ void DesignerSettings::fromSettings(QSettings *settings)
|
|||||||
restoreValue(settings, DesignerSettingsKey::ALWAYS_DESIGN_MODE, true);
|
restoreValue(settings, DesignerSettingsKey::ALWAYS_DESIGN_MODE, true);
|
||||||
restoreValue(settings, DesignerSettingsKey::DISABLE_ITEM_LIBRARY_UPDATE_TIMER, false);
|
restoreValue(settings, DesignerSettingsKey::DISABLE_ITEM_LIBRARY_UPDATE_TIMER, false);
|
||||||
restoreValue(settings, DesignerSettingsKey::ASK_BEFORE_DELETING_ASSET, true);
|
restoreValue(settings, DesignerSettingsKey::ASK_BEFORE_DELETING_ASSET, true);
|
||||||
const QStringList defaultValue = QStringList() << "#222222" << "#999999";
|
restoreValue(settings, DesignerSettingsKey::EDIT3DVIEW_BACKGROUND_COLOR,
|
||||||
restoreValue(settings, DesignerSettingsKey::EDIT3DVIEW_BACKGROUND_COLOR, defaultValue);
|
QStringList{"#222222", "#999999"});
|
||||||
restoreValue(settings, DesignerSettingsKey::EDIT3DVIEW_GRID_COLOR, "#aaaaaa");
|
restoreValue(settings, DesignerSettingsKey::EDIT3DVIEW_GRID_COLOR, "#aaaaaa");
|
||||||
restoreValue(settings, DesignerSettingsKey::SMOOTH_RENDERING, false);
|
restoreValue(settings, DesignerSettingsKey::SMOOTH_RENDERING, false);
|
||||||
restoreValue(settings, DesignerSettingsKey::SHOW_DEBUG_SETTINGS, false);
|
restoreValue(settings, DesignerSettingsKey::SHOW_DEBUG_SETTINGS, false);
|
||||||
@@ -81,8 +103,8 @@ void DesignerSettings::toSettings(QSettings *settings) const
|
|||||||
settings->beginGroup(QLatin1String(DesignerSettingsGroupKey::QML_SETTINGS_GROUP));
|
settings->beginGroup(QLatin1String(DesignerSettingsGroupKey::QML_SETTINGS_GROUP));
|
||||||
settings->beginGroup(QLatin1String(DesignerSettingsGroupKey::QML_DESIGNER_SETTINGS_GROUP));
|
settings->beginGroup(QLatin1String(DesignerSettingsGroupKey::QML_DESIGNER_SETTINGS_GROUP));
|
||||||
|
|
||||||
QHash<QByteArray, QVariant>::const_iterator i = constBegin();
|
QHash<QByteArray, QVariant>::const_iterator i = m_cache.constBegin();
|
||||||
while (i != constEnd()) {
|
while (i != m_cache.constEnd()) {
|
||||||
storeValue(settings, i.key(), i.value());
|
storeValue(settings, i.key(), i.value());
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
@@ -91,17 +113,4 @@ void DesignerSettings::toSettings(QSettings *settings) const
|
|||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariant DesignerSettings::getValue(const QByteArray &key)
|
|
||||||
{
|
|
||||||
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
|
|
||||||
return settings.value(key);
|
|
||||||
}
|
|
||||||
|
|
||||||
void DesignerSettings::setValue(const QByteArray &key, const QVariant &value)
|
|
||||||
{
|
|
||||||
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
|
|
||||||
settings.insert(key, value);
|
|
||||||
QmlDesignerPlugin::instance()->setSettings(settings);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
#include <QMutex>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QSettings;
|
class QSettings;
|
||||||
@@ -55,19 +56,25 @@ const char SMOOTH_RENDERING[] = "SmoothRendering";
|
|||||||
const char OLD_STATES_EDITOR[] = "OldStatesEditor";
|
const char OLD_STATES_EDITOR[] = "OldStatesEditor";
|
||||||
}
|
}
|
||||||
|
|
||||||
class QMLDESIGNERCORE_EXPORT DesignerSettings : public QHash<QByteArray, QVariant>
|
class QMLDESIGNERCORE_EXPORT DesignerSettings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DesignerSettings();
|
DesignerSettings(QSettings *settings);
|
||||||
|
|
||||||
|
void insert(const QByteArray &key, const QVariant &value);
|
||||||
|
void insert(const QHash<QByteArray, QVariant> &settingsHash);
|
||||||
|
QVariant value(const QByteArray &key, const QVariant &defaultValue = {}) const;
|
||||||
|
|
||||||
|
private:
|
||||||
void fromSettings(QSettings *);
|
void fromSettings(QSettings *);
|
||||||
void toSettings(QSettings *) const;
|
void toSettings(QSettings *) const;
|
||||||
static QVariant getValue(const QByteArray &key);
|
|
||||||
static void setValue(const QByteArray &key, const QVariant &value);
|
|
||||||
private:
|
|
||||||
void restoreValue(QSettings *settings, const QByteArray &key,
|
void restoreValue(QSettings *settings, const QByteArray &key,
|
||||||
const QVariant &defaultValue = QVariant());
|
const QVariant &defaultValue = QVariant());
|
||||||
void storeValue(QSettings *settings, const QByteArray &key, const QVariant &value) const;
|
void storeValue(QSettings *settings, const QByteArray &key, const QVariant &value) const;
|
||||||
|
|
||||||
|
QSettings *m_settings;
|
||||||
|
QHash<QByteArray, QVariant> m_cache;
|
||||||
|
mutable QMutex m_mutex;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
|||||||
@@ -178,12 +178,12 @@ void DocumentWarningWidget::emitGotoCodeClicked(const DocumentMessage &message)
|
|||||||
|
|
||||||
bool DocumentWarningWidget::warningsEnabled() const
|
bool DocumentWarningWidget::warningsEnabled() const
|
||||||
{
|
{
|
||||||
return DesignerSettings::getValue(DesignerSettingsKey::WARNING_FOR_FEATURES_IN_DESIGNER).toBool();
|
return QmlDesignerPlugin::settings().value(DesignerSettingsKey::WARNING_FOR_FEATURES_IN_DESIGNER).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentWarningWidget::ignoreCheckBoxToggled(bool b)
|
void DocumentWarningWidget::ignoreCheckBoxToggled(bool b)
|
||||||
{
|
{
|
||||||
DesignerSettings::setValue(DesignerSettingsKey::WARNING_FOR_FEATURES_IN_DESIGNER, !b);
|
QmlDesignerPlugin::settings().value(DesignerSettingsKey::WARNING_FOR_FEATURES_IN_DESIGNER, !b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocumentWarningWidget::setErrors(const QList<DocumentMessage> &errors)
|
void DocumentWarningWidget::setErrors(const QList<DocumentMessage> &errors)
|
||||||
|
|||||||
@@ -33,9 +33,8 @@ OpenUiQmlFileDialog::OpenUiQmlFileDialog(QWidget *parent) :
|
|||||||
close();
|
close();
|
||||||
});
|
});
|
||||||
connect(ui->checkBox, &QCheckBox::toggled, this, [](bool b){
|
connect(ui->checkBox, &QCheckBox::toggled, this, [](bool b){
|
||||||
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
|
QmlDesignerPlugin::settings().insert(
|
||||||
settings.insert(DesignerSettingsKey::WARNING_FOR_QML_FILES_INSTEAD_OF_UIQML_FILES, !b);
|
DesignerSettingsKey::WARNING_FOR_QML_FILES_INSTEAD_OF_UIQML_FILES, !b);
|
||||||
QmlDesignerPlugin::instance()->setSettings(settings);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ QtQuickDesignerFactory::QtQuickDesignerFactory()
|
|||||||
setDocumentCreator([this]() {
|
setDocumentCreator([this]() {
|
||||||
auto document = new QmlJSEditor::QmlJSEditorDocument(id());
|
auto document = new QmlJSEditor::QmlJSEditorDocument(id());
|
||||||
document->setIsDesignModePreferred(
|
document->setIsDesignModePreferred(
|
||||||
QmlDesigner::DesignerSettings::getValue(
|
QmlDesigner::QmlDesignerPlugin::settings().value(
|
||||||
QmlDesigner::DesignerSettingsKey::ALWAYS_DESIGN_MODE).toBool());
|
QmlDesigner::DesignerSettingsKey::ALWAYS_DESIGN_MODE).toBool());
|
||||||
return document;
|
return document;
|
||||||
});
|
});
|
||||||
@@ -113,13 +113,13 @@ QtQuickDesignerFactory::QtQuickDesignerFactory()
|
|||||||
class QmlDesignerPluginPrivate
|
class QmlDesignerPluginPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
DesignerSettings settings{Core::ICore::instance()->settings()};
|
||||||
QmlDesignerProjectManager projectManager;
|
QmlDesignerProjectManager projectManager;
|
||||||
ViewManager viewManager{projectManager.asynchronousImageCache()};
|
ViewManager viewManager{projectManager.asynchronousImageCache()};
|
||||||
DocumentManager documentManager{projectManager};
|
DocumentManager documentManager{projectManager};
|
||||||
ShortCutManager shortCutManager;
|
ShortCutManager shortCutManager;
|
||||||
SettingsPage settingsPage;
|
SettingsPage settingsPage;
|
||||||
DesignModeWidget mainWidget;
|
DesignModeWidget mainWidget;
|
||||||
DesignerSettings settings;
|
|
||||||
QtQuickDesignerFactory m_qtQuickDesignerFactory;
|
QtQuickDesignerFactory m_qtQuickDesignerFactory;
|
||||||
bool blockEditorChange = false;
|
bool blockEditorChange = false;
|
||||||
};
|
};
|
||||||
@@ -174,7 +174,7 @@ static bool shouldAssertInException()
|
|||||||
|
|
||||||
static bool warningsForQmlFilesInsteadOfUiQmlEnabled()
|
static bool warningsForQmlFilesInsteadOfUiQmlEnabled()
|
||||||
{
|
{
|
||||||
return DesignerSettings::getValue(DesignerSettingsKey::WARNING_FOR_QML_FILES_INSTEAD_OF_UIQML_FILES).toBool();
|
return QmlDesignerPlugin::settings().value(DesignerSettingsKey::WARNING_FOR_QML_FILES_INSTEAD_OF_UIQML_FILES).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlDesignerPlugin::QmlDesignerPlugin()
|
QmlDesignerPlugin::QmlDesignerPlugin()
|
||||||
@@ -281,8 +281,6 @@ bool QmlDesignerPlugin::delayedInitialize()
|
|||||||
});
|
});
|
||||||
MetaInfo::setPluginPaths(pluginPaths);
|
MetaInfo::setPluginPaths(pluginPaths);
|
||||||
|
|
||||||
d->settings.fromSettings(Core::ICore::settings());
|
|
||||||
|
|
||||||
d->viewManager.registerView(std::make_unique<QmlDesigner::Internal::ConnectionView>());
|
d->viewManager.registerView(std::make_unique<QmlDesigner::Internal::ConnectionView>());
|
||||||
|
|
||||||
auto timelineView = d->viewManager.registerView(std::make_unique<QmlDesigner::TimelineView>());
|
auto timelineView = d->viewManager.registerView(std::make_unique<QmlDesigner::TimelineView>());
|
||||||
@@ -629,7 +627,7 @@ void QmlDesignerPlugin::emitCurrentTextEditorChanged(Core::IEditor *editor)
|
|||||||
|
|
||||||
double QmlDesignerPlugin::formEditorDevicePixelRatio()
|
double QmlDesignerPlugin::formEditorDevicePixelRatio()
|
||||||
{
|
{
|
||||||
if (DesignerSettings::getValue(DesignerSettingsKey::IGNORE_DEVICE_PIXEL_RATIO).toBool())
|
if (QmlDesignerPlugin::settings().value(DesignerSettingsKey::IGNORE_DEVICE_PIXEL_RATIO).toBool())
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
const QList<QWindow *> topLevelWindows = QApplication::topLevelWindows();
|
const QList<QWindow *> topLevelWindows = QApplication::topLevelWindows();
|
||||||
@@ -737,18 +735,9 @@ const DesignerActionManager &QmlDesignerPlugin::designerActionManager() const
|
|||||||
return d->viewManager.designerActionManager();
|
return d->viewManager.designerActionManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
DesignerSettings QmlDesignerPlugin::settings()
|
DesignerSettings& QmlDesignerPlugin::settings()
|
||||||
{
|
{
|
||||||
d->settings.fromSettings(Core::ICore::settings());
|
return instance()->d->settings;
|
||||||
return d->settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlDesignerPlugin::setSettings(const DesignerSettings &s)
|
|
||||||
{
|
|
||||||
if (s != d->settings) {
|
|
||||||
d->settings = s;
|
|
||||||
d->settings.toSettings(Core::ICore::settings());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ public:
|
|||||||
DesignerActionManager &designerActionManager();
|
DesignerActionManager &designerActionManager();
|
||||||
const DesignerActionManager &designerActionManager() const;
|
const DesignerActionManager &designerActionManager() const;
|
||||||
|
|
||||||
DesignerSettings settings();
|
static DesignerSettings& settings();
|
||||||
void setSettings(const DesignerSettings &s);
|
|
||||||
|
|
||||||
DesignDocument *currentDesignDocument() const;
|
DesignDocument *currentDesignDocument() const;
|
||||||
Internal::DesignModeWidget *mainWidget() const;
|
Internal::DesignModeWidget *mainWidget() const;
|
||||||
|
|||||||
@@ -828,18 +828,26 @@ Project {
|
|||||||
"stateseditor/stateseditorview.h",
|
"stateseditor/stateseditorview.h",
|
||||||
"stateseditor/stateseditorwidget.cpp",
|
"stateseditor/stateseditorwidget.cpp",
|
||||||
"stateseditor/stateseditorwidget.h",
|
"stateseditor/stateseditorwidget.h",
|
||||||
"stateseditornew/propertychangesmodel.cpp",
|
]
|
||||||
"stateseditornew/propertychangesmodel.h",
|
}
|
||||||
"stateseditornew/propertymodel.cpp",
|
|
||||||
"stateseditornew/propertymodel.h",
|
Group {
|
||||||
"stateseditornew/stateseditorimageprovider.cpp",
|
name: "new states editor"
|
||||||
"stateseditornew/stateseditorimageprovider.h",
|
prefix: "components/stateseditornew/"
|
||||||
"stateseditornew/stateseditormodel.cpp",
|
Qt.core.generatedHeadersDir: product.buildDirectory + "/qt.headers/stateseditornew"
|
||||||
"stateseditornew/stateseditormodel.h",
|
files: [
|
||||||
"stateseditornew/stateseditorview.cpp",
|
"propertychangesmodel.cpp",
|
||||||
"stateseditornew/stateseditorview.h",
|
"propertychangesmodel.h",
|
||||||
"stateseditornew/stateseditorwidget.cpp",
|
"propertymodel.cpp",
|
||||||
"stateseditornew/stateseditorwidget.h",
|
"propertymodel.h",
|
||||||
|
"stateseditorimageprovider.cpp",
|
||||||
|
"stateseditorimageprovider.h",
|
||||||
|
"stateseditormodel.cpp",
|
||||||
|
"stateseditormodel.h",
|
||||||
|
"stateseditorview.cpp",
|
||||||
|
"stateseditorview.h",
|
||||||
|
"stateseditorwidget.cpp",
|
||||||
|
"stateseditorwidget.h",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
|
|
||||||
void apply() final;
|
void apply() final;
|
||||||
|
|
||||||
DesignerSettings settings() const;
|
QHash<QByteArray, QVariant> newSettings() const;
|
||||||
void setSettings(const DesignerSettings &settings);
|
void setSettings(const DesignerSettings &settings);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -86,9 +86,9 @@ SettingsPageWidget::SettingsPageWidget()
|
|||||||
setSettings(QmlDesignerPlugin::instance()->settings());
|
setSettings(QmlDesignerPlugin::instance()->settings());
|
||||||
}
|
}
|
||||||
|
|
||||||
DesignerSettings SettingsPageWidget::settings() const
|
QHash<QByteArray, QVariant> SettingsPageWidget::newSettings() const
|
||||||
{
|
{
|
||||||
DesignerSettings settings = QmlDesignerPlugin::instance()->settings();
|
QHash<QByteArray, QVariant> settings;
|
||||||
settings.insert(DesignerSettingsKey::ITEMSPACING, m_ui.spinItemSpacing->value());
|
settings.insert(DesignerSettingsKey::ITEMSPACING, m_ui.spinItemSpacing->value());
|
||||||
settings.insert(DesignerSettingsKey::CONTAINERPADDING, m_ui.spinSnapMargin->value());
|
settings.insert(DesignerSettingsKey::CONTAINERPADDING, m_ui.spinSnapMargin->value());
|
||||||
settings.insert(DesignerSettingsKey::CANVASWIDTH, m_ui.spinCanvasWidth->value());
|
settings.insert(DesignerSettingsKey::CANVASWIDTH, m_ui.spinCanvasWidth->value());
|
||||||
@@ -132,7 +132,8 @@ DesignerSettings SettingsPageWidget::settings() const
|
|||||||
m_ui.fallbackPuppetPathLineEdit->lineEdit()->placeholderText());
|
m_ui.fallbackPuppetPathLineEdit->lineEdit()->placeholderText());
|
||||||
if (newFallbackPuppetPath.isEmpty())
|
if (newFallbackPuppetPath.isEmpty())
|
||||||
newFallbackPuppetPath = m_ui.fallbackPuppetPathLineEdit->lineEdit()->placeholderText();
|
newFallbackPuppetPath = m_ui.fallbackPuppetPathLineEdit->lineEdit()->placeholderText();
|
||||||
QString oldFallbackPuppetPath = PuppetCreator::qmlPuppetFallbackDirectory(settings);
|
|
||||||
|
QString oldFallbackPuppetPath = PuppetCreator::qmlPuppetFallbackDirectory(QmlDesignerPlugin::settings());
|
||||||
|
|
||||||
if (oldFallbackPuppetPath != newFallbackPuppetPath && QFileInfo::exists(newFallbackPuppetPath)) {
|
if (oldFallbackPuppetPath != newFallbackPuppetPath && QFileInfo::exists(newFallbackPuppetPath)) {
|
||||||
if (newFallbackPuppetPath == PuppetCreator::defaultPuppetFallbackDirectory())
|
if (newFallbackPuppetPath == PuppetCreator::defaultPuppetFallbackDirectory())
|
||||||
@@ -248,8 +249,7 @@ void SettingsPageWidget::setSettings(const DesignerSettings &settings)
|
|||||||
|
|
||||||
void SettingsPageWidget::apply()
|
void SettingsPageWidget::apply()
|
||||||
{
|
{
|
||||||
DesignerSettings currentSettings(QmlDesignerPlugin::instance()->settings());
|
auto settings = newSettings();
|
||||||
DesignerSettings newSettings = settings();
|
|
||||||
|
|
||||||
const auto restartNecessaryKeys = {
|
const auto restartNecessaryKeys = {
|
||||||
DesignerSettingsKey::PUPPET_DEFAULT_DIRECTORY,
|
DesignerSettingsKey::PUPPET_DEFAULT_DIRECTORY,
|
||||||
@@ -263,7 +263,7 @@ void SettingsPageWidget::apply()
|
|||||||
};
|
};
|
||||||
|
|
||||||
for (const char * const key : restartNecessaryKeys) {
|
for (const char * const key : restartNecessaryKeys) {
|
||||||
if (currentSettings.value(key) != newSettings.value(key)) {
|
if (QmlDesignerPlugin::settings().value(key) != settings.value(key)) {
|
||||||
QMessageBox::information(Core::ICore::dialogParent(), tr("Restart Required"),
|
QMessageBox::information(Core::ICore::dialogParent(), tr("Restart Required"),
|
||||||
tr("The made changes will take effect after a "
|
tr("The made changes will take effect after a "
|
||||||
"restart of the QML Emulation layer or %1.")
|
"restart of the QML Emulation layer or %1.")
|
||||||
@@ -272,7 +272,7 @@ void SettingsPageWidget::apply()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QmlDesignerPlugin::instance()->setSettings(newSettings);
|
QmlDesignerPlugin::settings().insert(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsPage::SettingsPage()
|
SettingsPage::SettingsPage()
|
||||||
|
|||||||
@@ -232,56 +232,6 @@ Rectangle {
|
|||||||
"https://www.qt.io/terms-conditions/telemetry-privacy")
|
"https://www.qt.io/terms-conditions/telemetry-privacy")
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
|
||||||
y: 690
|
|
||||||
visible: false
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: 20
|
|
||||||
layoutDirection: Qt.LeftToRight
|
|
||||||
|
|
||||||
CheckBox {
|
|
||||||
visible: true
|
|
||||||
id: usageStatisticCheckBox
|
|
||||||
text: qsTr("Send Usage Statistics")
|
|
||||||
checked: usageStatisticModel.usageStatisticEnabled
|
|
||||||
padding: 0
|
|
||||||
spacing: 12
|
|
||||||
|
|
||||||
onCheckedChanged: usageStatisticModel.setTelemetryEnabled(
|
|
||||||
usageStatisticCheckBox.checked)
|
|
||||||
|
|
||||||
contentItem: Text {
|
|
||||||
text: usageStatisticCheckBox.text
|
|
||||||
color: "#ffffff"
|
|
||||||
leftPadding: usageStatisticCheckBox.indicator.width + usageStatisticCheckBox.spacing
|
|
||||||
font.pixelSize: 12
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CheckBox {
|
|
||||||
visible: true
|
|
||||||
id: crashReportCheckBox
|
|
||||||
text: qsTr("Send Crash Reports")
|
|
||||||
spacing: 12
|
|
||||||
checked: usageStatisticModel.crashReporterEnabled
|
|
||||||
|
|
||||||
onCheckedChanged: {
|
|
||||||
usageStatisticModel.setCrashReporterEnabled(
|
|
||||||
crashReportCheckBox.checked)
|
|
||||||
welcome_splash.onPluginInitialized(true,
|
|
||||||
crashReportCheckBox.checked)
|
|
||||||
}
|
|
||||||
|
|
||||||
contentItem: Text {
|
|
||||||
color: "#ffffff"
|
|
||||||
text: crashReportCheckBox.text
|
|
||||||
leftPadding: crashReportCheckBox.indicator.width + crashReportCheckBox.spacing
|
|
||||||
font.pixelSize: 12
|
|
||||||
}
|
|
||||||
padding: 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: designStudioVersion
|
id: designStudioVersion
|
||||||
anchors.top: logo.bottom
|
anchors.top: logo.bottom
|
||||||
|
|||||||
@@ -5,6 +5,14 @@ import QtQuick 2.0
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
focus: true
|
||||||
|
Keys.onPressed: (event)=> {
|
||||||
|
if (event.key == Qt.Key_Escape)
|
||||||
|
root.doNotShowAgain = false
|
||||||
|
root.closeClicked()
|
||||||
|
}
|
||||||
|
|
||||||
width: 600 * root.mainScale
|
width: 600 * root.mainScale
|
||||||
height: 720 * root.mainScale
|
height: 720 * root.mainScale
|
||||||
|
|
||||||
|
|||||||
@@ -557,6 +557,7 @@ void StudioWelcomePlugin::extensionsInitialized()
|
|||||||
|
|
||||||
s_view->show();
|
s_view->show();
|
||||||
s_view->raise();
|
s_view->raise();
|
||||||
|
s_view->setFocus();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user