summaryrefslogtreecommitdiff
path: root/tools/designer/src
diff options
context:
space:
mode:
Diffstat (limited to 'tools/designer/src')
-rw-r--r--tools/designer/src/components/formeditor/qdesigner_resource.cpp1
-rw-r--r--tools/designer/src/components/propertyeditor/propertyeditor.cpp4
-rw-r--r--tools/designer/src/components/signalsloteditor/signalslot_utils.cpp7
-rw-r--r--tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp8
-rw-r--r--tools/designer/src/components/taskmenu/button_taskmenu.cpp2
-rw-r--r--tools/designer/src/designer/qdesigner_formwindow.cpp1
-rw-r--r--tools/designer/src/designer/qdesigner_workbench.cpp4
-rw-r--r--tools/designer/src/lib/shared/grid.cpp20
8 files changed, 36 insertions, 11 deletions
diff --git a/tools/designer/src/components/formeditor/qdesigner_resource.cpp b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
index 0426b8ceb9..714a556a98 100644
--- a/tools/designer/src/components/formeditor/qdesigner_resource.cpp
+++ b/tools/designer/src/components/formeditor/qdesigner_resource.cpp
@@ -2278,6 +2278,7 @@ void QDesignerResource::createResources(DomResources *resources)
path = core()->dialogGui()->getOpenFileName(dialogParent, fileDialogTitle, fi.absolutePath(), fileDialogPattern);
if (path.isEmpty())
break;
+ m_formWindow->setProperty("_q_resourcepathchanged", QVariant(true));
} else {
break;
}
diff --git a/tools/designer/src/components/propertyeditor/propertyeditor.cpp b/tools/designer/src/components/propertyeditor/propertyeditor.cpp
index 521b5cb552..9f298d0a4c 100644
--- a/tools/designer/src/components/propertyeditor/propertyeditor.cpp
+++ b/tools/designer/src/components/propertyeditor/propertyeditor.cpp
@@ -91,6 +91,7 @@ static const char *ViewKeyC = "View";
static const char *ColorKeyC = "Colored";
static const char *SortedKeyC = "Sorted";
static const char *ExpansionKeyC = "ExpandedItems";
+static const char *SplitterPositionKeyC = "SplitterPosition";
enum SettingsView { TreeView, ButtonView };
@@ -365,10 +366,12 @@ PropertyEditor::PropertyEditor(QDesignerFormEditorInterface *core, QWidget *pare
m_sorting = settings->value(QLatin1String(SortedKeyC), false).toBool();
m_coloring = settings->value(QLatin1String(ColorKeyC), true).toBool();
const QVariantMap expansionState = settings->value(QLatin1String(ExpansionKeyC), QVariantMap()).toMap();
+ const int splitterPosition = settings->value(QLatin1String(SplitterPositionKeyC), 150).toInt();
settings->endGroup();
// Apply settings
m_sortingAction->setChecked(m_sorting);
m_coloringAction->setChecked(m_coloring);
+ m_treeBrowser->setSplitterPosition(splitterPosition);
#if QT_VERSION >= 0x040500
switch (view) {
case TreeView:
@@ -415,6 +418,7 @@ void PropertyEditor::saveSettings() const
expansionState.insert(it.key(), QVariant(it.value()));
}
settings->setValue(QLatin1String(ExpansionKeyC), expansionState);
+ settings->setValue(QLatin1String(SplitterPositionKeyC), m_treeBrowser->splitterPosition());
settings->endGroup();
}
diff --git a/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp b/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp
index 3ac0167204..ac1fe1cbfd 100644
--- a/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp
+++ b/tools/designer/src/components/signalsloteditor/signalslot_utils.cpp
@@ -244,7 +244,12 @@ namespace qdesigner_internal {
ClassesMemberFunctions reverseClassesMemberFunctions(const QString &obj_name, MemberType member_type,
const QString &peer, QDesignerFormWindowInterface *form)
{
- QObject *object = form->mainContainer()->findChild<QObject*>(obj_name);
+ QObject *object = 0;
+ if (obj_name == form->mainContainer()->objectName()) {
+ object = form->mainContainer();
+ } else {
+ object = form->mainContainer()->findChild<QObject*>(obj_name);
+ }
if (!object)
return ClassesMemberFunctions();
QDesignerFormEditorInterface *core = form->core();
diff --git a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
index 86ce67406a..b06a66f2c1 100644
--- a/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
+++ b/tools/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
@@ -658,8 +658,12 @@ QWidget *ConnectionDelegate::createEditor(QWidget *parent,
const qdesigner_internal::ClassesMemberFunctions class_list = qdesigner_internal::reverseClassesMemberFunctions(obj_name, type, peer, m_form);
- QObject *object = m_form->mainContainer()->findChild<QObject*>(obj_name);
-
+ QObject *object = 0;
+ if (obj_name == m_form->mainContainer()->objectName()) {
+ object = m_form->mainContainer();
+ } else {
+ object = m_form->mainContainer()->findChild<QObject*>(obj_name);
+ }
inline_editor->addText(type == qdesigner_internal::SignalMember ? tr("<signal>") : tr("<slot>"));
foreach (const qdesigner_internal::ClassMemberFunctions &class_info, class_list) {
if (class_info.m_className.isEmpty() || class_info.m_memberList.isEmpty())
diff --git a/tools/designer/src/components/taskmenu/button_taskmenu.cpp b/tools/designer/src/components/taskmenu/button_taskmenu.cpp
index b0b7d4a470..953996b8c6 100644
--- a/tools/designer/src/components/taskmenu/button_taskmenu.cpp
+++ b/tools/designer/src/components/taskmenu/button_taskmenu.cpp
@@ -528,7 +528,7 @@ bool ButtonTaskMenu::refreshAssignMenu(const QDesignerFormWindowInterface *fw, i
QList<QAction*> ButtonTaskMenu::taskActions() const
{
ButtonTaskMenu *ncThis = const_cast<ButtonTaskMenu*>(this);
- QButtonGroup *buttonGroup;
+ QButtonGroup *buttonGroup = 0;
QDesignerFormWindowInterface *fw = formWindow();
const SelectionType st = selectionType(fw->cursor(), &buttonGroup);
diff --git a/tools/designer/src/designer/qdesigner_formwindow.cpp b/tools/designer/src/designer/qdesigner_formwindow.cpp
index 1fbdcec03d..4770d2a58b 100644
--- a/tools/designer/src/designer/qdesigner_formwindow.cpp
+++ b/tools/designer/src/designer/qdesigner_formwindow.cpp
@@ -159,6 +159,7 @@ void QDesignerFormWindow::firstShow()
if (m_editor) {
connect(m_editor, SIGNAL(fileNameChanged(QString)), this, SLOT(updateWindowTitle(QString)));
updateWindowTitle(m_editor->fileName());
+ updateChanged();
}
}
show();
diff --git a/tools/designer/src/designer/qdesigner_workbench.cpp b/tools/designer/src/designer/qdesigner_workbench.cpp
index 836feb75f0..840667afe1 100644
--- a/tools/designer/src/designer/qdesigner_workbench.cpp
+++ b/tools/designer/src/designer/qdesigner_workbench.cpp
@@ -966,7 +966,9 @@ QDesignerFormWindow * QDesignerWorkbench::loadForm(const QString &fileName,
return 0;
}
*uic3Converted = editor->fileName().isEmpty();
- editor->setDirty(false);
+ // Did user specify another (missing) resource path -> set dirty.
+ const bool dirty = editor->property("_q_resourcepathchanged").toBool();
+ editor->setDirty(dirty);
resizeForm(formWindow, editor->mainContainer());
formWindowManager->setActiveFormWindow(editor);
return formWindow;
diff --git a/tools/designer/src/lib/shared/grid.cpp b/tools/designer/src/lib/shared/grid.cpp
index 6add8bd2d8..ba991c782d 100644
--- a/tools/designer/src/lib/shared/grid.cpp
+++ b/tools/designer/src/lib/shared/grid.cpp
@@ -89,12 +89,20 @@ Grid::Grid() :
bool Grid::fromVariantMap(const QVariantMap& vm)
{
- *this = Grid();
- valueFromVariantMap(vm, QLatin1String(KEY_VISIBLE), m_visible);
- valueFromVariantMap(vm, QLatin1String(KEY_SNAPX), m_snapX);
- valueFromVariantMap(vm, QLatin1String(KEY_SNAPY), m_snapY);
- valueFromVariantMap(vm, QLatin1String(KEY_DELTAX), m_deltaX);
- return valueFromVariantMap(vm, QLatin1String(KEY_DELTAY), m_deltaY);
+ Grid grid;
+ bool anyData = valueFromVariantMap(vm, QLatin1String(KEY_VISIBLE), grid.m_visible);
+ anyData |= valueFromVariantMap(vm, QLatin1String(KEY_SNAPX), grid.m_snapX);
+ anyData |= valueFromVariantMap(vm, QLatin1String(KEY_SNAPY), grid.m_snapY);
+ anyData |= valueFromVariantMap(vm, QLatin1String(KEY_DELTAX), grid.m_deltaX);
+ anyData |= valueFromVariantMap(vm, QLatin1String(KEY_DELTAY), grid.m_deltaY);
+ if (!anyData)
+ return false;
+ if (grid.m_deltaX == 0 || grid.m_deltaY == 0) {
+ qWarning("Attempt to set invalid grid with a spacing of 0.");
+ return false;
+ }
+ *this = grid;
+ return true;
}
QVariantMap Grid::toVariantMap(bool forceKeys) const