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
13deb78a
Commit
13deb78a
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
DfQMod + std fcts
parent
4537edb2
No related branches found
No related tags found
1 merge request
!2391
revise DfItem ctd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/Model/Files/DatafilesSet.h
+4
-0
4 additions, 0 deletions
GUI/Model/Files/DatafilesSet.h
GUI/View/Data/DatafilesQModel.cpp
+25
-0
25 additions, 0 deletions
GUI/View/Data/DatafilesQModel.cpp
GUI/View/Data/DatafilesQModel.h
+3
-4
3 additions, 4 deletions
GUI/View/Data/DatafilesQModel.h
with
32 additions
and
4 deletions
GUI/Model/Files/DatafilesSet.h
+
4
−
0
View file @
13deb78a
...
...
@@ -38,6 +38,10 @@ public:
void
writeTo
(
QXmlStreamWriter
*
w
)
const
;
void
writeDatafiles
(
const
QString
&
projectDir
)
const
;
signals:
void
setChanged
()
const
;
void
currentModified
()
const
;
private:
QVector
<
DataItem
*>
dataItems
()
const
;
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Data/DatafilesQModel.cpp
+
25
−
0
View file @
13deb78a
...
...
@@ -59,6 +59,31 @@ QVariant DatafilesQModel::data(const QModelIndex& index, int role) const
}
}
void
DatafilesQModel
::
deleteItem
()
{
const
size_t
row
=
set
()
->
currentIndex
();
ASSERT
(
row
!=
size_t
(
-
1
));
beginRemoveRows
({},
row
,
row
);
set
()
->
delete_current
();
endRemoveRows
();
emit
set
()
->
setChanged
();
}
QModelIndex
DatafilesQModel
::
pushItem
(
DatafileItem
*
t
)
{
if
(
!
t
)
return
{};
const
size_t
row
=
set
()
->
size
();
beginInsertRows
({},
row
,
row
);
set
()
->
push_back
(
t
);
endInsertRows
();
emit
set
()
->
setChanged
();
return
createIndex
(
row
,
0
);
}
void
DatafilesQModel
::
injectDatafileItem
(
DatafileItem
*
t
)
{
const
int
row
=
set
()
->
size
();
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Data/DatafilesQModel.h
+
3
−
4
View file @
13deb78a
...
...
@@ -32,15 +32,14 @@ public:
int
rowCount
(
const
QModelIndex
&
parent
=
{})
const
override
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
=
Qt
::
DisplayRole
)
const
override
;
void
deleteItem
();
QModelIndex
pushItem
(
DatafileItem
*
);
DatafileItem
*
itemForIndex
(
const
QModelIndex
&
index
);
QModelIndex
indexForItem
(
const
DatafileItem
*
item
)
const
;
const
DatafileItem
*
topMostItem
()
const
;
//!< The topmost visible item. Can be null.
bool
isHeadline
(
const
QModelIndex
&
)
const
{
return
false
;
}
void
deleteItem
();
QModelIndex
cloneItem
();
QModelIndex
pushItem
(
DatafileItem
*
);
private
:
DatafilesSet
*
set
();
const
DatafilesSet
*
set
()
const
;
...
...
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