Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SDK
Umbrello
Commits
345fb25b
Commit
345fb25b
authored
Nov 27, 2019
by
Ralf Habacker
Browse files
Let class SelectDiagramWidget use ComboBoxWidgetBase as base class
Fixup of commit
f0b38d10
.
parent
1e4efa2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
umbrello/dialogs/widgets/selectdiagramwidget.cpp
View file @
345fb25b
...
...
@@ -27,18 +27,8 @@
* @param parent parent widget
*/
SelectDiagramWidget
::
SelectDiagramWidget
(
const
QString
&
title
,
QWidget
*
parent
)
:
QWidget
(
parent
)
:
ComboBoxWidgetBase
(
title
,
QString
(),
parent
)
{
QHBoxLayout
*
layout
=
new
QHBoxLayout
;
layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_label
=
new
QLabel
(
title
,
this
);
layout
->
addWidget
(
m_label
);
m_editField
=
new
KComboBox
(
this
);
m_editField
->
setEditable
(
true
);
layout
->
addWidget
(
m_editField
,
2
);
setLayout
(
layout
);
}
/**
...
...
@@ -71,17 +61,6 @@ void SelectDiagramWidget::setupWidget(Uml::DiagramType::Enum type, const QString
m_editField
->
setCurrentIndex
(
currentIndex
);
}
}
/**
* Add this widget to a given grid layout. Umbrello dialogs places labels in column 0
* and the editable field in column 1.
* @param layout The layout to which the widget should be added
* @param row The row in the grid layout where the widget should be placed
*/
void
SelectDiagramWidget
::
addToLayout
(
QGridLayout
*
layout
,
int
row
)
{
layout
->
addWidget
(
m_label
,
row
,
0
);
layout
->
addWidget
(
m_editField
,
row
,
1
);
}
/**
* Return current text
...
...
umbrello/dialogs/widgets/selectdiagramwidget.h
View file @
345fb25b
...
...
@@ -13,31 +13,21 @@
#include
"basictypes.h"
#include
<QWidget>
class
KComboBox
;
class
QGridLayout
;
class
QLabel
;
#include
"comboboxwidgetbase.h"
/**
* This widget provides selecting a diagram from the list of currently available diagrams
* @author Ralf Habacker
*/
class
SelectDiagramWidget
:
public
Q
Widget
class
SelectDiagramWidget
:
public
ComboBox
Widget
Base
{
Q_OBJECT
public:
explicit
SelectDiagramWidget
(
const
QString
&
title
,
QWidget
*
parent
=
nullptr
);
void
setupWidget
(
Uml
::
DiagramType
::
Enum
type
,
const
QString
&
currentName
,
const
QString
&
excludeName
,
bool
withNewEntry
=
true
);
void
addToLayout
(
QGridLayout
*
layout
,
int
row
);
QString
currentText
();
Uml
::
ID
::
Type
currentID
();
protected:
QLabel
*
m_label
;
KComboBox
*
m_editField
;
};
#endif // SELECTDIAGRAMWIDGET_H
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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