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
6ba46a1f
Commit
6ba46a1f
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
class out of class
parent
7337ba1d
No related branches found
No related tags found
1 merge request
!2261
merge local class TreeModel into parent class
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Instrument/InstrumentLibraryEditor.cpp
+3
-3
3 additions, 3 deletions
GUI/View/Instrument/InstrumentLibraryEditor.cpp
GUI/View/Instrument/InstrumentLibraryEditor.h
+17
-16
17 additions, 16 deletions
GUI/View/Instrument/InstrumentLibraryEditor.h
with
20 additions
and
19 deletions
GUI/View/Instrument/InstrumentLibraryEditor.cpp
+
3
−
3
View file @
6ba46a1f
...
...
@@ -298,17 +298,17 @@ void InstrumentLibraryEditor::onInstrumentChangedByEditor()
/*********************************************************************************************/
InstrumentLibraryEditor
::
TreeModel
::
TreeModel
(
QObject
*
parent
,
InstrumentModel
*
model
)
TreeModel
::
TreeModel
(
QObject
*
parent
,
InstrumentModel
*
model
)
:
InstrumentsTreeModel
(
parent
,
model
)
{
}
void
InstrumentLibraryEditor
::
TreeModel
::
setNewInstrument
(
InstrumentItem
*
addedInstrument
)
void
TreeModel
::
setNewInstrument
(
InstrumentItem
*
addedInstrument
)
{
m_newInstrument
=
addedInstrument
;
}
QVariant
InstrumentLibraryEditor
::
TreeModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
QVariant
TreeModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
{
if
(
isHeadline
(
index
))
return
InstrumentsTreeModel
::
data
(
index
,
role
);
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Instrument/InstrumentLibraryEditor.h
+
17
−
16
View file @
6ba46a1f
...
...
@@ -25,6 +25,23 @@
class
InstrumentItem
;
class
InstrumentLibrary
;
//! A model extension for InstrumentsTreeModel which
//! * shows a "NEW" sign in the icon of a newly added instrument.
//! * creates a HTML text for the Display role
class
TreeModel
:
public
InstrumentsTreeModel
{
public:
TreeModel
(
QObject
*
parent
,
InstrumentModel
*
model
);
//! Set the instrument which shall have a "NEW" sign in its icon
void
setNewInstrument
(
InstrumentItem
*
addedInstrument
);
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
override
;
private:
InstrumentItem
*
m_newInstrument
=
nullptr
;
};
class
InstrumentLibraryEditor
:
public
QDialog
{
Q_OBJECT
public:
...
...
@@ -51,22 +68,6 @@ private:
void
applySplitterPos
();
void
saveSplitterPos
();
//! A model extension for InstrumentsTreeModel which
//! * shows a "NEW" sign in the icon of a newly added instrument.
//! * creates a HTML text for the Display role
class
TreeModel
:
public
InstrumentsTreeModel
{
public:
TreeModel
(
QObject
*
parent
,
InstrumentModel
*
model
);
//! Set the instrument which shall have a "NEW" sign in its icon
void
setNewInstrument
(
InstrumentItem
*
addedInstrument
);
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
override
;
private:
InstrumentItem
*
m_newInstrument
=
nullptr
;
};
InstrumentLibrary
*
m_instrumentLibrary
;
TreeModel
*
m_treeModel
;
InstrumentItem
*
m_chosenItem
;
...
...
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