forked from qt-creator/qt-creator
ModelEditor: Improve documentation.
Change-Id: I3c91ad77b6142bcca858dbeae3b36dc640f0f537 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
@@ -87,6 +87,9 @@
|
|||||||
the editor to copy all elements to the clipboard by using 300 dpi. Then
|
the editor to copy all elements to the clipboard by using 300 dpi. Then
|
||||||
paste the diagram to an application that can print images.
|
paste the diagram to an application that can print images.
|
||||||
|
|
||||||
|
If you copy a selection of elements in the editor, only those elements and
|
||||||
|
their relations will be copied to the clipboard as an image.
|
||||||
|
|
||||||
To save diagrams as images, select \uicontrol Tools >
|
To save diagrams as images, select \uicontrol Tools >
|
||||||
\uicontrol {Model Editor} > \uicontrol {Export Diagram}.
|
\uicontrol {Model Editor} > \uicontrol {Export Diagram}.
|
||||||
|
|
||||||
@@ -179,12 +182,21 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
\li To move the end of a relation to a different element, grab the
|
||||||
|
end point and drop it over another element that accepts relations
|
||||||
|
of that type. For example, only classes accept inheritances and
|
||||||
|
associations.
|
||||||
|
|
||||||
\li To create \e {sampling points} that divide a relation into two
|
\li To create \e {sampling points} that divide a relation into two
|
||||||
connected lines, select a relation and press \key Shift+Click.
|
connected lines, select a relation and press \key Shift and click
|
||||||
If possible, the end point of a relation is moved automatically to
|
on the relation line.
|
||||||
draw the line to the next sampling point either vertically or
|
|
||||||
horizontally. To remove the selected sampling point, press
|
If possible, the end point of a relation is moved automatically
|
||||||
\key Ctrl+Click.
|
to draw the line to the next sampling point either vertically or
|
||||||
|
horizontally.
|
||||||
|
|
||||||
|
\li To remove a sampling point, press \key Ctrl and click the sampling
|
||||||
|
point.
|
||||||
|
|
||||||
\li To group elements, drag and drop a \uicontrol Boundary element to
|
\li To group elements, drag and drop a \uicontrol Boundary element to
|
||||||
the editor and resize it to enclose the elements in the group.
|
the editor and resize it to enclose the elements in the group.
|
||||||
@@ -240,14 +252,7 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\li In the \uicontrol Members field, specify members for the
|
\li In the \uicontrol Members field, specify members for the
|
||||||
class. Enter each member on a separate line using a C++
|
class, as described in \l {Specifying Members}.
|
||||||
like syntax. For example, the following lines define the
|
|
||||||
method \c m that is private, virtual, and constant:
|
|
||||||
|
|
||||||
\code
|
|
||||||
private:
|
|
||||||
virtual int m(string a) const;
|
|
||||||
\endcode
|
|
||||||
|
|
||||||
\li Select \uicontrol {Clean Up} to format the contents of
|
\li Select \uicontrol {Clean Up} to format the contents of
|
||||||
the \uicontrol Members field depending on their visibility
|
the \uicontrol Members field depending on their visibility
|
||||||
@@ -273,13 +278,60 @@
|
|||||||
and relationship.
|
and relationship.
|
||||||
|
|
||||||
To create self-relations, start creating a new association and press
|
To create self-relations, start creating a new association and press
|
||||||
\key Shift to create a new \e {intermediate point} while dragging the
|
\key Shift to create a new \e {sampling point} while dragging the
|
||||||
association. Create another intermediate point and drop the association
|
association. Create another sampling point and drop the association
|
||||||
at the same class.
|
at the same class.
|
||||||
|
|
||||||
To add more points, press \key Shift and click a relation. To delete a
|
To add more points, press \key Shift and click a relation. To delete a
|
||||||
point, press \key Ctrl and click a point.
|
point, press \key Ctrl and click a point.
|
||||||
|
|
||||||
|
\section2 Specifying Members
|
||||||
|
|
||||||
|
To specify members for the class, enter each member on a separate line
|
||||||
|
using a C++ like syntax. For example, the following lines define the
|
||||||
|
method \c m that is private, virtual, and constant:
|
||||||
|
|
||||||
|
\code
|
||||||
|
private:
|
||||||
|
virtual int m(string a) const;
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
You may group members:
|
||||||
|
|
||||||
|
\code
|
||||||
|
[Geometry]
|
||||||
|
QPointF position;
|
||||||
|
QSizeF size;
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
You may add stereotypes to members:
|
||||||
|
|
||||||
|
\code
|
||||||
|
<<setter>> setPosition(const QPointF &pos);
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
There are some limitations of the parser:
|
||||||
|
|
||||||
|
\list
|
||||||
|
|
||||||
|
\li Multi-line declarations work only if lines are wrapped
|
||||||
|
within nested brackets:
|
||||||
|
|
||||||
|
\code
|
||||||
|
void setSize(int width,
|
||||||
|
int height);
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
\li Preprocessor macros will not be translated. Some Qt
|
||||||
|
keywords are recognized (for example Q_SLOT).
|
||||||
|
|
||||||
|
\li Function pointer declarations are interpreted as methods.
|
||||||
|
|
||||||
|
\li \c throw() and \c noexpect() specifiers are not ignored
|
||||||
|
but will make the declaration a method.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
\section1 Creating Component Diagrams
|
\section1 Creating Component Diagrams
|
||||||
|
|
||||||
You can add source code components, such as libraries, databases, programs,
|
You can add source code components, such as libraries, databases, programs,
|
||||||
@@ -314,17 +366,19 @@
|
|||||||
adds the \c UseCase custom element:
|
adds the \c UseCase custom element:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
Icon UseCase
|
Icon {
|
||||||
Title: "Use-Case"
|
id: UseCase
|
||||||
Elements: item
|
title: "Use-Case"
|
||||||
Stereotype: 'usecase'
|
elements: item
|
||||||
Display: icon
|
stereotype: 'usecase'
|
||||||
Width: 40
|
display: icon
|
||||||
Height: 20
|
width: 40
|
||||||
BaseColor: #5fb4f0
|
height: 20
|
||||||
Begin
|
baseColor: #5fb4f0
|
||||||
Ellipse 20, 10, 20, 10
|
Shape {
|
||||||
End
|
Ellipse { x: 20, y: 10, radiusX: 20, radiusY: 10 }
|
||||||
|
}
|
||||||
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
For more information about the available options, see \e standard.def
|
For more information about the available options, see \e standard.def
|
||||||
@@ -333,5 +387,9 @@
|
|||||||
|
|
||||||
You can add your own definition file and save it with the file extension
|
You can add your own definition file and save it with the file extension
|
||||||
\e .def to add custom colors and icons for stereotypes, elements, or tool
|
\e .def to add custom colors and icons for stereotypes, elements, or tool
|
||||||
bars.
|
bars. Either store this file in the the same directory as the
|
||||||
|
\e standard.def file or select the root element of a model and apply your
|
||||||
|
\e .def file to the property \uicontrol {Config path}.
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user