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
b9eba8ae
Commit
b9eba8ae
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
rename class and sources GUI/View/Tool/ItemDelegateForHTML -> GUI/View/Tool/ListItemDelegate
parent
a4e33ec1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!2359
Use same tree view with delegate for datafiles, samples, and instruments. Also move some code between GUI/View directories. Restore Py wrappers lost in previous MR.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
GUI/View/Sample/SamplesQListView.cpp
+5
-5
5 additions, 5 deletions
GUI/View/Sample/SamplesQListView.cpp
GUI/View/Tool/ListItemDelegate.cpp
+7
-8
7 additions, 8 deletions
GUI/View/Tool/ListItemDelegate.cpp
GUI/View/Tool/ListItemDelegate.h
+7
-7
7 additions, 7 deletions
GUI/View/Tool/ListItemDelegate.h
with
19 additions
and
20 deletions
GUI/View/Sample/SamplesQListView.cpp
+
5
−
5
View file @
b9eba8ae
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#include
"GUI/Model/Sample/SamplesSet.h"
#include
"GUI/Model/Sample/SamplesSet.h"
#include
"GUI/View/Layout/ApplicationSettings.h"
#include
"GUI/View/Layout/ApplicationSettings.h"
#include
"GUI/View/Sample/SamplesQModel.h"
#include
"GUI/View/Sample/SamplesQModel.h"
#include
"GUI/View/Tool/ItemDelegate
ForHTML
.h"
#include
"GUI/View/Tool/
List
ItemDelegate.h"
#include
"GUI/View/Widget/ItemViewOverlayButtons.h"
#include
"GUI/View/Widget/ItemViewOverlayButtons.h"
#include
<QAction>
#include
<QAction>
#include
<QMenu>
#include
<QMenu>
...
@@ -28,10 +28,10 @@
...
@@ -28,10 +28,10 @@
namespace
{
namespace
{
class
ItemDelegateForSampleTree
:
public
ItemDelegate
ForHTML
{
class
ItemDelegateForSampleTree
:
public
List
ItemDelegate
{
public:
public:
ItemDelegateForSampleTree
(
QObject
*
parent
)
ItemDelegateForSampleTree
(
QObject
*
parent
)
:
ItemDelegate
ForHTML
(
parent
)
:
List
ItemDelegate
(
parent
)
{
{
}
}
...
@@ -39,7 +39,7 @@ protected:
...
@@ -39,7 +39,7 @@ protected:
void
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
void
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
override
const
QModelIndex
&
index
)
const
override
{
{
ItemDelegate
ForHTML
::
paint
(
painter
,
option
,
index
);
List
ItemDelegate
::
paint
(
painter
,
option
,
index
);
QStyleOptionViewItem
options
=
option
;
QStyleOptionViewItem
options
=
option
;
initStyleOption
(
&
options
,
index
);
initStyleOption
(
&
options
,
index
);
...
@@ -54,7 +54,7 @@ protected:
...
@@ -54,7 +54,7 @@ protected:
QSize
sizeHint
(
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
override
QSize
sizeHint
(
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
override
{
{
auto
s
=
ItemDelegate
ForHTML
::
sizeHint
(
option
,
index
);
auto
s
=
List
ItemDelegate
::
sizeHint
(
option
,
index
);
s
.
setHeight
(
std
::
max
(
s
.
height
(),
32
));
s
.
setHeight
(
std
::
max
(
s
.
height
(),
32
));
return
s
;
return
s
;
}
}
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Tool/ItemDelegate
ForHTML
.cpp
→
GUI/View/Tool/
List
ItemDelegate.cpp
+
7
−
8
View file @
b9eba8ae
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
//
//
// BornAgain: simulate and fit reflection and scattering
// BornAgain: simulate and fit reflection and scattering
//
//
//! @file GUI/View/Tool/ItemDelegate
ForHTML
.cpp
//! @file GUI/View/Tool/
List
ItemDelegate.cpp
//! @brief Implements class ItemDelegate
ForHTML
.
//! @brief Implements class
List
ItemDelegate.
//!
//!
//! @homepage http://www.bornagainproject.org
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @license GNU General Public License v3 or higher (see COPYING)
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
//
//
// ************************************************************************************************
// ************************************************************************************************
#include
"GUI/View/Tool/ItemDelegate
ForHTML
.h"
#include
"GUI/View/Tool/
List
ItemDelegate.h"
#include
<QAbstractItemView>
#include
<QAbstractItemView>
#include
<QAbstractTextDocumentLayout>
#include
<QAbstractTextDocumentLayout>
#include
<QApplication>
#include
<QApplication>
...
@@ -33,13 +33,13 @@ QSize mySizeHint(const QString& text)
...
@@ -33,13 +33,13 @@ QSize mySizeHint(const QString& text)
}
// namespace
}
// namespace
ItemDelegate
ForHTML
::
ItemDelegate
ForHTML
(
QObject
*
parent
)
List
ItemDelegate
::
List
ItemDelegate
(
QObject
*
parent
)
:
QStyledItemDelegate
(
parent
)
:
QStyledItemDelegate
(
parent
)
{
{
}
}
void
ItemDelegate
ForHTML
::
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
void
List
ItemDelegate
::
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
const
QModelIndex
&
index
)
const
{
{
QStyleOptionViewItem
options
=
option
;
QStyleOptionViewItem
options
=
option
;
initStyleOption
(
&
options
,
index
);
initStyleOption
(
&
options
,
index
);
...
@@ -47,8 +47,7 @@ void ItemDelegateForHTML::paint(QPainter* painter, const QStyleOptionViewItem& o
...
@@ -47,8 +47,7 @@ void ItemDelegateForHTML::paint(QPainter* painter, const QStyleOptionViewItem& o
QStyledItemDelegate
::
paint
(
painter
,
option
,
index
);
QStyledItemDelegate
::
paint
(
painter
,
option
,
index
);
}
}
QSize
ItemDelegateForHTML
::
sizeHint
(
const
QStyleOptionViewItem
&
option
,
QSize
ListItemDelegate
::
sizeHint
(
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
const
QModelIndex
&
index
)
const
{
{
QSize
s
=
QStyledItemDelegate
::
sizeHint
(
option
,
index
);
QSize
s
=
QStyledItemDelegate
::
sizeHint
(
option
,
index
);
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Tool/ItemDelegate
ForHTML
.h
→
GUI/View/Tool/
List
ItemDelegate.h
+
7
−
7
View file @
b9eba8ae
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
//
//
// BornAgain: simulate and fit reflection and scattering
// BornAgain: simulate and fit reflection and scattering
//
//
//! @file GUI/View/Tool/ItemDelegate
ForHTML
.h
//! @file GUI/View/Tool/
List
ItemDelegate.h
//! @brief Defines class ItemDelegate
ForHTML
.
//! @brief Defines class
List
ItemDelegate.
//!
//!
//! @homepage http://www.bornagainproject.org
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @license GNU General Public License v3 or higher (see COPYING)
...
@@ -12,16 +12,16 @@
...
@@ -12,16 +12,16 @@
//
//
// ************************************************************************************************
// ************************************************************************************************
#ifndef BORNAGAIN_GUI_VIEW_TOOL_ITEMDELEGATE
FORHTML
_H
#ifndef BORNAGAIN_GUI_VIEW_TOOL_
LIST
ITEMDELEGATE_H
#define BORNAGAIN_GUI_VIEW_TOOL_ITEMDELEGATE
FORHTML
_H
#define BORNAGAIN_GUI_VIEW_TOOL_
LIST
ITEMDELEGATE_H
#include
<QStyledItemDelegate>
#include
<QStyledItemDelegate>
//! For representing HTML text in an item */
//! For representing HTML text in an item */
class
ItemDelegate
ForHTML
:
public
QStyledItemDelegate
{
class
List
ItemDelegate
:
public
QStyledItemDelegate
{
Q_OBJECT
Q_OBJECT
public:
public:
ItemDelegate
ForHTML
(
QObject
*
parent
);
List
ItemDelegate
(
QObject
*
parent
);
protected:
protected:
void
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
void
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
...
@@ -30,4 +30,4 @@ protected:
...
@@ -30,4 +30,4 @@ protected:
};
};
#endif // BORNAGAIN_GUI_VIEW_TOOL_ITEMDELEGATE
FORHTML
_H
#endif // BORNAGAIN_GUI_VIEW_TOOL_
LIST
ITEMDELEGATE_H
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