forked from qt-creator/qt-creator
Fixes: Context help in Designer
Task: 235520 Details: Display help of current property editor object
This commit is contained in:
@@ -45,6 +45,8 @@
|
|||||||
#include <QtDesigner/QDesignerFormWindowInterface>
|
#include <QtDesigner/QDesignerFormWindowInterface>
|
||||||
#include <QtDesigner/QDesignerFormEditorInterface>
|
#include <QtDesigner/QDesignerFormEditorInterface>
|
||||||
#include <QtDesigner/QDesignerFormWindowManagerInterface>
|
#include <QtDesigner/QDesignerFormWindowManagerInterface>
|
||||||
|
#include <QtDesigner/QDesignerPropertyEditorInterface>
|
||||||
|
#include <QtDesigner/QDesignerWidgetDataBaseInterface>
|
||||||
#include <qt_private/formwindowbase_p.h>
|
#include <qt_private/formwindowbase_p.h>
|
||||||
#include <qt_private/qtresourcemodel_p.h>
|
#include <qt_private/qtresourcemodel_p.h>
|
||||||
|
|
||||||
@@ -325,3 +327,25 @@ void FormWindowEditor::activate()
|
|||||||
{
|
{
|
||||||
m_editorWidget->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;
|
||||||
|
}
|
||||||
|
@@ -63,7 +63,6 @@ class EditorWidget;
|
|||||||
class FormWindowEditor : public Core::IEditor
|
class FormWindowEditor : public Core::IEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FormWindowEditor(const QList<int> &context,
|
FormWindowEditor(const QList<int> &context,
|
||||||
QDesignerFormWindowInterface *form,
|
QDesignerFormWindowInterface *form,
|
||||||
@@ -84,8 +83,9 @@ public:
|
|||||||
bool restoreState(const QByteArray &state);
|
bool restoreState(const QByteArray &state);
|
||||||
|
|
||||||
// ContextInterface
|
// ContextInterface
|
||||||
QList<int> context() const;
|
virtual QList<int> context() const;
|
||||||
QWidget *widget();
|
virtual QWidget *widget();
|
||||||
|
virtual QString contextHelpId() const;
|
||||||
|
|
||||||
QDesignerFormWindowInterface *formWindow() const;
|
QDesignerFormWindowInterface *formWindow() const;
|
||||||
QWidget *integrationContainer();
|
QWidget *integrationContainer();
|
||||||
|
Reference in New Issue
Block a user