Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
27bdfe51
Commit
27bdfe51
authored
Jun 08, 2010
by
dt
Browse files
Make the TaskView 10% faster by caching how wide "8888" is.
parent
769e67c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/taskwindow.cpp
View file @
27bdfe51
...
...
@@ -142,6 +142,7 @@ private:
const
QIcon
m_warningIcon
;
int
m_taskCount
;
int
m_errorTaskCount
;
int
m_sizeOfLineNumber
;
};
class
TaskFilterModel
:
public
QSortFilterProxyModel
...
...
@@ -221,7 +222,8 @@ TaskModel::TaskModel() :
m_errorIcon
(
QLatin1String
(
":/projectexplorer/images/compile_error.png"
)),
m_warningIcon
(
QLatin1String
(
":/projectexplorer/images/compile_warning.png"
)),
m_taskCount
(
0
),
m_errorTaskCount
(
0
)
m_errorTaskCount
(
0
),
m_sizeOfLineNumber
(
0
)
{
}
...
...
@@ -422,9 +424,12 @@ int TaskModel::sizeOfFile()
int
TaskModel
::
sizeOfLineNumber
()
{
QFont
font
;
QFontMetrics
fm
(
font
);
return
fm
.
width
(
"8888"
);
if
(
m_sizeOfLineNumber
==
0
)
{
QFont
font
;
QFontMetrics
fm
(
font
);
m_sizeOfLineNumber
=
fm
.
width
(
"8888"
);
}
return
m_sizeOfLineNumber
;
}
void
TaskModel
::
setFileNotFound
(
const
QModelIndex
&
idx
,
bool
b
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment