Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SDK
Umbrello
Commits
bd7859a0
Commit
bd7859a0
authored
Jun 19, 2017
by
Ralf Habacker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor class AssociationGeneralPage to use class DocumentationWidget.
CCBUG:381391
parent
d6da482b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
18 deletions
+11
-18
umbrello/dialogs/pages/associationgeneralpage.cpp
umbrello/dialogs/pages/associationgeneralpage.cpp
+5
-12
umbrello/dialogs/pages/associationgeneralpage.h
umbrello/dialogs/pages/associationgeneralpage.h
+2
-2
umbrello/dialogs/widgets/documentationwidget.cpp
umbrello/dialogs/widgets/documentationwidget.cpp
+1
-1
umbrello/dialogs/widgets/documentationwidget.h
umbrello/dialogs/widgets/documentationwidget.h
+3
-3
No files found.
umbrello/dialogs/pages/associationgeneralpage.cpp
View file @
bd7859a0
...
...
@@ -16,6 +16,7 @@
#include "assocrules.h"
#include "debug_utils.h"
#include "dialog_utils.h"
#include "documentationwidget.h"
#include "objectwidget.h"
#include "umldoc.h"
#include "umlobject.h"
...
...
@@ -77,11 +78,8 @@ void AssociationGeneralPage::constructWidget()
// group boxes for name+type, documentation properties
QGroupBox
*
nameAndTypeGB
=
new
QGroupBox
(
this
);
QGroupBox
*
docGB
=
new
QGroupBox
(
this
);
nameAndTypeGB
->
setTitle
(
i18n
(
"Properties"
));
docGB
->
setTitle
(
i18n
(
"Documentation"
));
topLayout
->
addWidget
(
nameAndTypeGB
);
topLayout
->
addWidget
(
docGB
);
m_pNameAndTypeLayout
=
new
QGridLayout
(
nameAndTypeGB
);
m_pNameAndTypeLayout
->
setSpacing
(
6
);
...
...
@@ -182,14 +180,9 @@ void AssociationGeneralPage::constructWidget()
#endif
m_pNameAndTypeLayout
->
addWidget
(
m_pTypeCB
,
1
,
1
);
// document
QHBoxLayout
*
docLayout
=
new
QHBoxLayout
(
docGB
);
docLayout
->
setMargin
(
margin
);
m_doc
=
new
KTextEdit
(
docGB
);
docLayout
->
addWidget
(
m_doc
);
m_doc
->
setText
(
m_pAssociationWidget
->
documentation
());
m_doc
->
setWordWrapMode
(
QTextOption
::
WordWrap
);
// documentation
m_docWidget
=
new
DocumentationWidget
(
m_pAssociationWidget
,
this
);
topLayout
->
addWidget
(
m_docWidget
);
}
void
AssociationGeneralPage
::
slotStereoCheckboxChanged
(
int
state
)
...
...
@@ -222,7 +215,7 @@ void AssociationGeneralPage::apply()
int
comboBoxItem
=
m_pTypeCB
->
currentIndex
();
Uml
::
AssociationType
::
Enum
newType
=
m_AssocTypes
[
comboBoxItem
];
m_pAssociationWidget
->
setAssociationType
(
newType
);
m_
pAssociationWidget
->
setDocumentation
(
m_doc
->
toPlainText
()
);
m_
docWidget
->
apply
(
);
if
(
m_pStereoChkB
&&
m_pStereoChkB
->
isChecked
())
{
QString
stereo
=
m_pAssocNameComB
->
currentText
();
// keep the order
...
...
umbrello/dialogs/pages/associationgeneralpage.h
View file @
bd7859a0
...
...
@@ -18,12 +18,12 @@
#include <QWidget>
class
AssociationWidget
;
class
DocumentationWidget
;
class
QCheckBox
;
class
QGridLayout
;
class
QLabel
;
class
KComboBox
;
class
KLineEdit
;
class
KTextEdit
;
class
ObjectWidget
;
class
UMLDoc
;
class
UMLObject
;
...
...
@@ -57,7 +57,7 @@ private:
so we can translate both ways */
QList
<
Uml
::
AssociationType
::
Enum
>
m_AssocTypes
;
QStringList
m_AssocTypeStrings
;
KTextEdi
t
*
m_doc
;
DocumentationWidge
t
*
m_doc
Widget
;
AssociationWidget
*
m_pAssociationWidget
;
ObjectWidget
*
m_pWidget
;
...
...
umbrello/dialogs/widgets/documentationwidget.cpp
View file @
bd7859a0
...
...
@@ -36,7 +36,7 @@ DocumentationWidget::DocumentationWidget(UMLObject *o, QWidget *parent) :
init
(
o
->
doc
());
}
DocumentationWidget
::
DocumentationWidget
(
UML
Widget
*
w
,
QWidget
*
parent
)
:
DocumentationWidget
::
DocumentationWidget
(
Widget
Base
*
w
,
QWidget
*
parent
)
:
QWidget
(
parent
),
m_object
(
0
),
m_widget
(
w
)
...
...
umbrello/dialogs/widgets/documentationwidget.h
View file @
bd7859a0
...
...
@@ -15,7 +15,7 @@
class
CodeTextEdit
;
class
UMLObject
;
class
UML
Widget
;
class
Widget
Base
;
class
KTextEdit
;
...
...
@@ -27,7 +27,7 @@ class DocumentationWidget : public QWidget
Q_OBJECT
public:
explicit
DocumentationWidget
(
UMLObject
*
o
,
QWidget
*
parent
=
0
);
explicit
DocumentationWidget
(
UML
Widget
*
w
,
QWidget
*
parent
=
0
);
explicit
DocumentationWidget
(
Widget
Base
*
w
,
QWidget
*
parent
=
0
);
~
DocumentationWidget
();
void
apply
();
...
...
@@ -37,7 +37,7 @@ protected:
KTextEdit
*
m_editField
;
CodeTextEdit
*
m_codeEditField
;
UMLObject
*
m_object
;
UML
Widget
*
m_widget
;
Widget
Base
*
m_widget
;
void
init
(
const
QString
&
text
);
};
...
...
Write
Preview
Markdown
is supported
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