Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
736963a4
Commit
736963a4
authored
Mar 08, 2010
by
Lasse Holmstedt
Browse files
Context Help support for Bauhaus
Task-number: BAUHAUS-451 Reviewed-by: kkoehne
parent
1b5bc656
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp
View file @
736963a4
...
...
@@ -416,7 +416,7 @@ void DesignDocumentController::loadCurrentModel()
m_d
->
model
->
attachView
(
m_d
->
navigator
.
data
());
m_d
->
itemLibrary
->
setMetaInfo
(
m_d
->
model
->
metaInfo
());
if
(
m_d
->
formEditorView
.
isNull
())
{
if
(
m_d
->
formEditorView
.
isNull
())
{
m_d
->
formEditorView
=
new
FormEditorView
(
this
);
m_d
->
stackedWidget
->
addWidget
(
m_d
->
formEditorView
->
widget
());
ComponentAction
*
componentAction
=
new
ComponentAction
(
m_d
->
formEditorView
->
widget
());
...
...
@@ -857,4 +857,19 @@ bool DesignDocumentController::save(QIODevice *device, QString * /*errorMessage*
}
}
QString
DesignDocumentController
::
contextHelpId
()
const
{
DesignDocumentControllerView
view
;
m_d
->
model
->
attachView
(
&
view
);
QList
<
ModelNode
>
nodes
=
view
.
selectedModelNodes
();
QString
helpId
;
if
(
!
nodes
.
isEmpty
())
{
helpId
=
nodes
.
first
().
type
();
helpId
.
replace
(
"Qt/"
,
"QML."
);
}
return
helpId
;
}
}
// namespace QmlDesigner
src/plugins/qmldesigner/components/integration/designdocumentcontroller.h
View file @
736963a4
...
...
@@ -90,6 +90,7 @@ public:
bool
isModelSyncBlocked
()
const
;
void
blockModelSync
(
bool
block
);
QString
contextHelpId
()
const
;
QList
<
RewriterView
::
Error
>
qmlErrors
()
const
;
signals:
...
...
src/plugins/qmldesigner/designmodecontext.cpp
View file @
736963a4
...
...
@@ -29,13 +29,14 @@
#include "designmodecontext.h"
#include "qmldesignerconstants.h"
#include "designmodewidget.h"
#include <coreplugin/uniqueidmanager.h>
#include <QWidget>
namespace
QmlDesigner
{
namespace
Internal
{
DesignModeContext
::
DesignModeContext
(
Q
Widget
*
widget
)
:
IContext
(
widget
),
DesignModeContext
::
DesignModeContext
(
DesignMode
Widget
*
widget
)
:
IContext
(
widget
),
m_widget
(
widget
)
{
m_context
<<
Core
::
UniqueIDManager
::
instance
()
->
uniqueIdentifier
(
Constants
::
C_FORMEDITOR
);
...
...
@@ -56,6 +57,11 @@ QWidget *DesignModeContext::widget()
return
m_widget
;
}
QString
DesignModeContext
::
contextHelpId
()
const
{
return
m_widget
->
contextHelpId
();
}
}
}
src/plugins/qmldesigner/designmodecontext.h
View file @
736963a4
...
...
@@ -40,20 +40,25 @@ QT_END_NAMESPACE
namespace
QmlDesigner
{
namespace
Internal
{
class
DesignModeWidget
;
/**
* Bauhaus Design mode context object
*/
class
DesignModeContext
:
public
Core
::
IContext
{
public:
DesignModeContext
(
Q
Widget
*
widget
);
DesignModeContext
(
DesignMode
Widget
*
widget
);
~
DesignModeContext
();
QList
<
int
>
context
()
const
;
QWidget
*
widget
();
QString
contextHelpId
()
const
;
private:
QList
<
int
>
m_context
;
Q
Widget
*
m_widget
;
DesignMode
Widget
*
m_widget
;
};
}
...
...
src/plugins/qmldesigner/designmodewidget.cpp
View file @
736963a4
...
...
@@ -688,5 +688,12 @@ void DesignModeWidget::setCurrentDocumentWidget(DocumentWidget *newDocumentWidge
}
}
QString
DesignModeWidget
::
contextHelpId
()
const
{
if
(
m_currentDocumentWidget
)
return
m_currentDocumentWidget
->
document
()
->
contextHelpId
();
return
QString
();
}
}
// namespace Internal
}
// namespace Designer
src/plugins/qmldesigner/designmodewidget.h
View file @
736963a4
...
...
@@ -165,8 +165,10 @@ public:
~
DesignModeWidget
();
// void syncWithTextEdit(bool sync);
void
showEditor
(
Core
::
IEditor
*
editor
);
void
closeEditors
(
const
QList
<
Core
::
IEditor
*>
editors
);
QString
contextHelpId
()
const
;
QAction
*
undoAction
()
const
;
QAction
*
redoAction
()
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment