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
f50d6cb0
Commit
f50d6cb0
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
+ VectorWC::delete_current, simplify instrs model code
rename member var
parent
71ef98c5
No related branches found
No related tags found
1 merge request
!2387
unify code for list views
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Base/Types/VectorWC.h
+6
-0
6 additions, 0 deletions
Base/Types/VectorWC.h
GUI/View/List/InstrumentsQModel.cpp
+4
-5
4 additions, 5 deletions
GUI/View/List/InstrumentsQModel.cpp
with
10 additions
and
5 deletions
Base/Types/VectorWC.h
+
6
−
0
View file @
f50d6cb0
...
@@ -52,6 +52,12 @@ public:
...
@@ -52,6 +52,12 @@ public:
super
::
delete_at
(
i
);
super
::
delete_at
(
i
);
update_current
();
update_current
();
}
}
void
delete_current
()
{
ASSERT
(
m_current_index
!=
size_t
(
-
1
));
super
::
delete_at
(
m_current_index
);
update_current
();
}
T
*
release_at
(
size_t
i
)
T
*
release_at
(
size_t
i
)
{
{
super
::
release_at
(
i
);
super
::
release_at
(
i
);
...
...
This diff is collapsed.
Click to expand it.
GUI/View/List/InstrumentsQModel.cpp
+
4
−
5
View file @
f50d6cb0
...
@@ -58,11 +58,10 @@ QVariant InstrumentsQModel::data(const QModelIndex& index, int role) const
...
@@ -58,11 +58,10 @@ QVariant InstrumentsQModel::data(const QModelIndex& index, int role) const
void
InstrumentsQModel
::
removeInstrument
()
void
InstrumentsQModel
::
removeInstrument
()
{
{
const
InstrumentItem
*
t
=
set
()
->
currentItem
();
const
size_t
row
=
set
()
->
currentIndex
();
ASSERT
(
row
!=
size_t
(
-
1
));
const
int
row
=
set
()
->
index_of
(
t
);
beginRemoveRows
({},
row
,
row
);
beginRemoveRows
({},
row
,
row
);
set
()
->
delete_
elem
ent
(
t
);
set
()
->
delete_
curr
ent
();
endRemoveRows
();
endRemoveRows
();
emit
set
()
->
setChanged
();
emit
set
()
->
setChanged
();
...
@@ -78,7 +77,7 @@ QModelIndex InstrumentsQModel::copyInstrument()
...
@@ -78,7 +77,7 @@ QModelIndex InstrumentsQModel::copyInstrument()
QModelIndex
InstrumentsQModel
::
pushInstrument
(
InstrumentItem
*
t
)
QModelIndex
InstrumentsQModel
::
pushInstrument
(
InstrumentItem
*
t
)
{
{
const
in
t
row
=
set
()
->
instrumentItems
().
size
();
const
size_
t
row
=
set
()
->
size
();
beginInsertRows
({},
row
,
row
);
beginInsertRows
({},
row
,
row
);
set
()
->
push_back
(
t
);
set
()
->
push_back
(
t
);
endInsertRows
();
endInsertRows
();
...
...
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