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
c485b193
Commit
c485b193
authored
2 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
ditto
parent
c972c83e
No related branches found
No related tags found
1 merge request
!1450
mv some member fcts to local namespace
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Fit/Minimizer/MinimizerOptions.cpp
+3
-1
3 additions, 1 deletion
Fit/Minimizer/MinimizerOptions.cpp
GUI/View/Tool/ItemDelegateForHTML.cpp
+10
-10
10 additions, 10 deletions
GUI/View/Tool/ItemDelegateForHTML.cpp
GUI/View/Tool/ItemDelegateForHTML.h
+1
-4
1 addition, 4 deletions
GUI/View/Tool/ItemDelegateForHTML.h
with
14 additions
and
15 deletions
Fit/Minimizer/MinimizerOptions.cpp
+
3
−
1
View file @
c485b193
...
...
@@ -21,7 +21,9 @@
namespace
{
const
std
::
string
delimeter
=
";"
;
}
}
// namespace
std
::
string
MinimizerOptions
::
toOptionString
()
const
{
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Tool/ItemDelegateForHTML.cpp
+
10
−
10
View file @
c485b193
...
...
@@ -26,6 +26,15 @@ bool hasHtml(const QString& t)
return
t
.
contains
(
"<"
)
&&
t
.
contains
(
">"
);
}
QSize
mySizeHint
(
const
QString
&
text
)
{
QTextDocument
doc
;
doc
.
setHtml
(
text
);
doc
.
setTextWidth
(
10000
/*options.rect.width()*/
);
QSize
size
=
QSize
(
doc
.
idealWidth
(),
doc
.
size
().
height
());
return
size
;
}
}
// namespace
...
...
@@ -86,22 +95,13 @@ QSize ItemDelegateForHTML::sizeHint(const QStyleOptionViewItem& option,
QStyleOptionViewItem
options
=
option
;
initStyleOption
(
&
options
,
index
);
auto
s2
=
s
izeHint
(
options
.
text
);
auto
s2
=
myS
izeHint
(
options
.
text
);
s
.
setHeight
(
std
::
max
(
s
.
height
(),
s2
.
height
()
+
10
));
s
.
setWidth
(
s2
.
width
()
+
h
);
// +h: icon
return
s
;
}
QSize
ItemDelegateForHTML
::
sizeHint
(
const
QString
&
text
)
{
QTextDocument
doc
;
doc
.
setHtml
(
text
);
doc
.
setTextWidth
(
10000
/*options.rect.width()*/
);
QSize
size
=
QSize
(
doc
.
idealWidth
(),
doc
.
size
().
height
());
return
size
;
}
QString
ItemDelegateForHTML
::
anchorAtGlobalPos
(
QAbstractItemView
*
view
,
const
QModelIndex
&
index
,
const
QPoint
&
globalPos
)
const
{
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Tool/ItemDelegateForHTML.h
+
1
−
4
View file @
c485b193
...
...
@@ -29,10 +29,7 @@ protected:
void
paint
(
QPainter
*
painter
,
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
override
;
QSize
sizeHint
(
const
QStyleOptionViewItem
&
option
,
const
QModelIndex
&
index
)
const
override
;
private:
static
QSize
sizeHint
(
const
QString
&
text
);
};
#endif // BORNAGAIN_GUI_VIEW_TOOL_ITEMDELEGATEFORHTML_H
\ No newline at end of file
#endif // BORNAGAIN_GUI_VIEW_TOOL_ITEMDELEGATEFORHTML_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