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
7cece7ab
Commit
7cece7ab
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
rm selection support from InstrumentsQListView
parent
162ad0b6
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
GUI/View/List/InstrumentsQListView.cpp
+0
-29
0 additions, 29 deletions
GUI/View/List/InstrumentsQListView.cpp
GUI/View/List/InstrumentsQListView.h
+0
-2
0 additions, 2 deletions
GUI/View/List/InstrumentsQListView.h
with
0 additions
and
31 deletions
GUI/View/List/InstrumentsQListView.cpp
+
0
−
29
View file @
7cece7ab
...
@@ -63,10 +63,6 @@ InstrumentsQListView::InstrumentsQListView()
...
@@ -63,10 +63,6 @@ InstrumentsQListView::InstrumentsQListView()
setContextMenuPolicy
(
Qt
::
ActionsContextMenu
);
setContextMenuPolicy
(
Qt
::
ActionsContextMenu
);
updateActions
();
updateActions
();
restoreSelection
();
connect
(
selectionModel
(),
&
QItemSelectionModel
::
selectionChanged
,
this
,
&
InstrumentsQListView
::
onItemSelectionChanged
);
}
}
QSize
InstrumentsQListView
::
sizeHint
()
const
QSize
InstrumentsQListView
::
sizeHint
()
const
...
@@ -79,19 +75,6 @@ QSize InstrumentsQListView::minimumSizeHint() const
...
@@ -79,19 +75,6 @@ QSize InstrumentsQListView::minimumSizeHint() const
return
{
96
,
200
};
return
{
96
,
200
};
}
}
void
InstrumentsQListView
::
onItemSelectionChanged
()
{
updateActions
();
QModelIndexList
indexes
=
selectionModel
()
->
selectedIndexes
();
if
(
!
indexes
.
empty
())
{
QModelIndex
current
=
indexes
.
front
();
gDoc
->
instrumentsModifier
()
->
setCurrentIndex
(
current
.
row
());
emit
instrumentSelected
(
m_model
->
instrumentItemForIndex
(
current
));
}
else
emit
instrumentSelected
(
nullptr
);
}
void
InstrumentsQListView
::
onNewGisas
()
void
InstrumentsQListView
::
onNewGisas
()
{
{
QModelIndex
idx
=
m_model
->
addNewGISASInstrument
();
QModelIndex
idx
=
m_model
->
addNewGISASInstrument
();
...
@@ -192,15 +175,3 @@ void InstrumentsQListView::ensureItemSelected()
...
@@ -192,15 +175,3 @@ void InstrumentsQListView::ensureItemSelected()
selectionModel
()
->
select
(
last
,
QItemSelectionModel
::
ClearAndSelect
);
selectionModel
()
->
select
(
last
,
QItemSelectionModel
::
ClearAndSelect
);
}
}
}
}
void
InstrumentsQListView
::
restoreSelection
()
{
int
lastUsed
=
gDoc
->
instruments
()
->
currentIndex
();
if
(
lastUsed
>=
0
&&
lastUsed
<
m_model
->
rowCount
())
{
QModelIndex
lastUsedIndex
=
m_model
->
index
(
lastUsed
,
0
,
QModelIndex
());
selectionModel
()
->
select
(
lastUsedIndex
,
QItemSelectionModel
::
ClearAndSelect
);
}
else
ensureItemSelected
();
updateActions
();
}
This diff is collapsed.
Click to expand it.
GUI/View/List/InstrumentsQListView.h
+
0
−
2
View file @
7cece7ab
...
@@ -34,7 +34,6 @@ signals:
...
@@ -34,7 +34,6 @@ signals:
void
instrumentSelected
(
InstrumentItem
*
instrument
);
void
instrumentSelected
(
InstrumentItem
*
instrument
);
private
slots
:
private
slots
:
void
onItemSelectionChanged
();
void
onNewGisas
();
void
onNewGisas
();
void
onNewOffspec
();
void
onNewOffspec
();
void
onNewSpecular
();
void
onNewSpecular
();
...
@@ -49,7 +48,6 @@ private slots:
...
@@ -49,7 +48,6 @@ private slots:
private:
private:
void
updateActions
();
void
updateActions
();
void
ensureItemSelected
();
void
ensureItemSelected
();
void
restoreSelection
();
InstrumentsQModel
*
m_model
;
InstrumentsQModel
*
m_model
;
};
};
...
...
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