Commit 29d1f2ad authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Canvas setting now reflected

Task-number: QTCREATORBUG-4317
Reviewed-by: Thomas Hartmann
parent 443ff278
......@@ -95,6 +95,8 @@ void FormEditorScene::resetScene()
{
foreach(QGraphicsItem *item, m_manipulatorLayerItem->childItems())
removeItem(item);
setSceneRect(-canvasWidth()/2., -canvasHeight()/2., canvasWidth(), canvasHeight());
}
FormEditorItem* FormEditorScene::itemForQmlItemNode(const QmlItemNode &qmlItemNode) const
......
......@@ -53,6 +53,8 @@ DesignerSettings SettingsPageWidget::settings() const
DesignerSettings ds;
ds.itemSpacing = m_ui.spinItemSpacing->value();
ds.snapMargin = m_ui.spinSnapMargin->value();
ds.canvasWidth = m_ui.spinCanvasWidth->value();
ds.canvasHeight = m_ui.spinCanvasHeight->value();
return ds;
}
......@@ -60,6 +62,8 @@ void SettingsPageWidget::setSettings(const DesignerSettings &s)
{
m_ui.spinItemSpacing->setValue(s.itemSpacing);
m_ui.spinSnapMargin->setValue(s.snapMargin);
m_ui.spinCanvasWidth->setValue(s.canvasWidth);
m_ui.spinCanvasHeight->setValue(s.canvasHeight);
}
QString SettingsPageWidget::searchKeywords() const
......@@ -67,7 +71,9 @@ QString SettingsPageWidget::searchKeywords() const
QString rc;
QTextStream(&rc)
<< ' ' << m_ui.snapMarginLabel->text()
<< ' ' << m_ui.itemSpacingLabel->text();
<< ' ' << m_ui.itemSpacingLabel->text()
<< ' ' << m_ui.canvasWidthLabel->text()
<< ' ' << m_ui.canvasHeightLabel->text();
rc.remove(QLatin1Char('&'));
return rc;
}
......
......@@ -76,14 +76,14 @@
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="canvasWidth">
<widget class="QLabel" name="canvasWidthLabel">
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBox">
<widget class="QSpinBox" name="spinCanvasWidth">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -102,14 +102,14 @@
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="canvasHeight">
<widget class="QLabel" name="canvasHeightLabel">
<property name="text">
<string>Height</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_2">
<widget class="QSpinBox" name="spinCanvasHeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment