Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
77bbb641
Commit
77bbb641
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
SelectionProperty rename member -> m_item
parent
98fc42e8
No related branches found
No related tags found
1 merge request
!2364
rename SelectionProperty -> PolyItem
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/Model/Descriptor/SelectionProperty.h
+15
-15
15 additions, 15 deletions
GUI/Model/Descriptor/SelectionProperty.h
with
15 additions
and
15 deletions
GUI/Model/Descriptor/SelectionProperty.h
+
15
−
15
View file @
77bbb641
...
@@ -80,21 +80,21 @@ public:
...
@@ -80,21 +80,21 @@ public:
}
}
//! Direct access to the stored pointer
//! Direct access to the stored pointer
CatalogedType
*
operator
->
()
const
{
return
m_
p
.
get
();
}
CatalogedType
*
operator
->
()
const
{
return
m_
item
.
get
();
}
//! Direct access to the stored pointer
//! Direct access to the stored pointer
CatalogedType
*
certainItem
()
const
{
return
m_
p
.
get
();
}
CatalogedType
*
certainItem
()
const
{
return
m_
item
.
get
();
}
//! Directly set the new item.
//! Directly set the new item.
void
setCertainItem
(
CatalogedType
*
t
)
{
m_
p
.
reset
(
t
);
}
void
setCertainItem
(
CatalogedType
*
t
)
{
m_
item
.
reset
(
t
);
}
//! Directly set the new item.
//! Directly set the new item.
template
<
typename
S
>
S
*
setCertainItem
()
template
<
typename
S
>
S
*
setCertainItem
()
{
{
auto
*
s
=
new
S
();
auto
*
s
=
new
S
();
if
(
s
!=
nullptr
&&
m_initializer
)
if
(
s
!=
nullptr
&&
m_initializer
)
m_initializer
(
s
,
m_
p
.
get
());
m_initializer
(
s
,
m_
item
.
get
());
m_
p
.
reset
(
s
);
m_
item
.
reset
(
s
);
return
s
;
return
s
;
}
}
...
@@ -102,14 +102,14 @@ public:
...
@@ -102,14 +102,14 @@ public:
//! main serialization method of the selected class.
//! main serialization method of the selected class.
void
writeTo
(
QXmlStreamWriter
*
w
)
const
void
writeTo
(
QXmlStreamWriter
*
w
)
const
{
{
const
uint
typeIndex
=
static_cast
<
uint
>
(
Catalog
::
type
(
m_
p
.
get
()));
const
uint
typeIndex
=
static_cast
<
uint
>
(
Catalog
::
type
(
m_
item
.
get
()));
XML
::
writeAttribute
(
w
,
XML
::
Attrib
::
type
,
typeIndex
);
XML
::
writeAttribute
(
w
,
XML
::
Attrib
::
type
,
typeIndex
);
// The next line allows to see the name of item type in XML. May be skipped while reading.
// The next line allows to see the name of item type in XML. May be skipped while reading.
XML
::
writeAttribute
(
w
,
XML
::
Attrib
::
name
,
XML
::
writeAttribute
(
w
,
XML
::
Attrib
::
name
,
Catalog
::
uiInfo
(
Catalog
::
type
(
m_
p
.
get
())).
menuEntry
);
Catalog
::
uiInfo
(
Catalog
::
type
(
m_
item
.
get
())).
menuEntry
);
XML
::
writeAttribute
(
w
,
XML
::
Attrib
::
selection_version
,
uint
(
1
));
XML
::
writeAttribute
(
w
,
XML
::
Attrib
::
selection_version
,
uint
(
1
));
if
(
m_
p
)
if
(
m_
item
)
m_
p
->
writeTo
(
w
);
m_
item
->
writeTo
(
w
);
}
}
//! Deserializes the catalog index of the currently selected type, creates a new
//! Deserializes the catalog index of the currently selected type, creates a new
...
@@ -124,10 +124,10 @@ public:
...
@@ -124,10 +124,10 @@ public:
auto
*
p
=
Catalog
::
create
(
type
,
args
...);
auto
*
p
=
Catalog
::
create
(
type
,
args
...);
if
(
p
)
{
if
(
p
)
{
if
(
m_initializer
)
if
(
m_initializer
)
m_initializer
(
p
,
m_
p
.
get
());
m_initializer
(
p
,
m_
item
.
get
());
p
->
readFrom
(
r
);
p
->
readFrom
(
r
);
}
}
m_
p
.
reset
(
p
);
m_
item
.
reset
(
p
);
}
}
QString
label
()
const
{
return
m_label
;
}
QString
label
()
const
{
return
m_label
;
}
...
@@ -135,7 +135,7 @@ public:
...
@@ -135,7 +135,7 @@ public:
QStringList
options
()
const
{
return
m_options
;
}
QStringList
options
()
const
{
return
m_options
;
}
void
setCurrentIndex
(
int
newIndex
)
{
currentIndexSetter
(
newIndex
);
}
void
setCurrentIndex
(
int
newIndex
)
{
currentIndexSetter
(
newIndex
);
}
int
currentIndex
()
const
{
return
m_types
.
indexOf
(
Catalog
::
type
(
m_
p
.
get
()));
}
int
currentIndex
()
const
{
return
m_types
.
indexOf
(
Catalog
::
type
(
m_
item
.
get
()));
}
private
:
private
:
template
<
typename
...
Args
>
template
<
typename
...
Args
>
...
@@ -150,12 +150,12 @@ private:
...
@@ -150,12 +150,12 @@ private:
currentIndexSetter
=
[
this
,
args
...](
int
current
)
{
currentIndexSetter
=
[
this
,
args
...](
int
current
)
{
auto
*
p
=
Catalog
::
create
(
m_types
[
current
],
args
...);
auto
*
p
=
Catalog
::
create
(
m_types
[
current
],
args
...);
if
(
m_initializer
)
if
(
m_initializer
)
m_initializer
(
p
,
m_
p
.
get
());
m_initializer
(
p
,
m_
item
.
get
());
m_
p
.
reset
(
p
);
m_
item
.
reset
(
p
);
};
};
}
}
std
::
unique_ptr
<
CatalogedType
>
m_
p
;
//!< Current selection
std
::
unique_ptr
<
CatalogedType
>
m_
item
;
//!< Current selection
QString
m_label
;
//!< A label text (short, no trailing colon)
QString
m_label
;
//!< A label text (short, no trailing colon)
QString
m_tooltip
;
//!< Tooltip text
QString
m_tooltip
;
//!< Tooltip text
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment