summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-02-13 09:55:21 +0100
committerFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-02-13 09:55:21 +0100
commit79a99acd1bef2587b2a393390301f3184e635c2e (patch)
tree8f7494ddef00d6257e05a3d5fcc7157645a524ae /src
parentc29a2429b92f12960d025d5e01b5be6e5dff8700 (diff)
downloadqt-creator-79a99acd1bef2587b2a393390301f3184e635c2e.tar.gz
Fixes: Context help in Designer
Task: 235520 Details: Display help of current property editor object
Diffstat (limited to 'src')
-rw-r--r--src/plugins/designer/formwindoweditor.cpp24
-rw-r--r--src/plugins/designer/formwindoweditor.h6
2 files changed, 27 insertions, 3 deletions
diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp
index a683dccd86..869443a9aa 100644
--- a/src/plugins/designer/formwindoweditor.cpp
+++ b/src/plugins/designer/formwindoweditor.cpp
@@ -45,6 +45,8 @@
#include <QtDesigner/QDesignerFormWindowInterface>
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtDesigner/QDesignerFormWindowManagerInterface>
+#include <QtDesigner/QDesignerPropertyEditorInterface>
+#include <QtDesigner/QDesignerWidgetDataBaseInterface>
#include <qt_private/formwindowbase_p.h>
#include <qt_private/qtresourcemodel_p.h>
@@ -325,3 +327,25 @@ void FormWindowEditor::activate()
{
m_editorWidget->activate();
}
+
+QString FormWindowEditor::contextHelpId() const
+{
+ // TODO [13.2.09]: Replace this by QDesignerIntegrations context help Id
+ // in the upcoming version of Qt
+ QDesignerFormEditorInterface *core = FormEditorW::instance()->designerEditor();
+ QObject *o = core->propertyEditor()->object();
+ if (!o)
+ return QString();
+ const QDesignerWidgetDataBaseInterface *db = core->widgetDataBase();
+ const int dbIndex = db->indexOfObject(o, true);
+ if (dbIndex == -1)
+ return QString();
+ QString className = db->item(dbIndex)->name();
+ if (className == QLatin1String("Line"))
+ className = QLatin1String("QFrame");
+ else if (className == QLatin1String("Spacer"))
+ className = QLatin1String("QSpacerItem");
+ else if (className == QLatin1String("QLayoutWidget"))
+ className = QLatin1String("QLayout");
+ return className;
+}
diff --git a/src/plugins/designer/formwindoweditor.h b/src/plugins/designer/formwindoweditor.h
index e854ccac91..bce29c2f5a 100644
--- a/src/plugins/designer/formwindoweditor.h
+++ b/src/plugins/designer/formwindoweditor.h
@@ -63,7 +63,6 @@ class EditorWidget;
class FormWindowEditor : public Core::IEditor
{
Q_OBJECT
-
public:
FormWindowEditor(const QList<int> &context,
QDesignerFormWindowInterface *form,
@@ -84,8 +83,9 @@ public:
bool restoreState(const QByteArray &state);
// ContextInterface
- QList<int> context() const;
- QWidget *widget();
+ virtual QList<int> context() const;
+ virtual QWidget *widget();
+ virtual QString contextHelpId() const;
QDesignerFormWindowInterface *formWindow() const;
QWidget *integrationContainer();