-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tooltips for each of the models. #41
Conversation
src/models/callercalleemodel.cpp
Outdated
case Binary: | ||
return tr("The name of the executable the symbol resides in. May be empty when debug information is missing."); | ||
case SelfCost: | ||
return tr("The number of CPU cycles directly used by this symbol while inside the function."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number of samples directly attributed to this symbol.
src/models/callercalleemodel.cpp
Outdated
case SelfCost: | ||
return tr("The number of CPU cycles directly used by this symbol while inside the function."); | ||
case InclusiveCost: | ||
return tr("The number of CPU cycles used by this symbol both directly and indirectly. The inclusive cost includes the costs of all functions called by this symbol plus it's self cost."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The number of samples attributed to this symbol, both directly and indirectly. This includes the costs of all functions called by this symbol plus its self cost.
src/models/callercalleemodel.cpp
Outdated
case InclusiveCost: | ||
return tr("The number of CPU cycles used by this symbol both directly and indirectly. The inclusive cost includes the costs of all functions called by this symbol plus it's self cost."); | ||
case Callers: | ||
return tr("Callers Tooltip"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the "Tooltip" here and below
src/models/callercalleemodel.cpp
Outdated
@@ -107,10 +124,13 @@ QVariant CallerCalleeModel::cell(Columns column, int role, const Data::Symbol& s | |||
return QVariant::fromValue(entry.callers); | |||
} else if (role == SourceMapRole) { | |||
return QVariant::fromValue(entry.sourceMap); | |||
} else if (role == Qt::ToolTipRole) { | |||
QString toolTip = formatSymbolBinaryString(symbol.symbol, symbol.binary) + QLatin1String("\n") + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use a template enclosed in tr here, i.e. something like:
tr("%1\ninclusive cost: %2\nself cost: %3").arg(...).arg(...);
src/models/callercalleemodel.h
Outdated
case Binary: | ||
return QObject::tr("The name of the executable the symbol resides in. May be empty when debug information is missing."); | ||
case Cost: | ||
return QObject::tr("The number of CPU cycles used by this symbol."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...of samples...
src/models/treemodel.cpp
Outdated
@@ -41,6 +41,25 @@ BottomUpModel::BottomUpModel(QObject* parent) | |||
|
|||
BottomUpModel::~BottomUpModel() = default; | |||
|
|||
namespace { | |||
QString formatSymbolBinaryString(const QString& symbol, const QString& binary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above, don't duplicate this, share it in a header
src/models/treemodel.cpp
Outdated
case Binary: | ||
return tr("The name of the executable the symbol resides in. May be empty when debug information is missing."); | ||
case Cost: | ||
return tr("The number of CPU cycles used by this symbol."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
samples
src/models/treemodel.cpp
Outdated
@@ -69,6 +102,13 @@ QVariant BottomUpModel::displayData(const Data::BottomUp* row, Columns column) | |||
return {}; | |||
} | |||
|
|||
QVariant BottomUpModel::displayToolTip(const Data::BottomUp* row, quint64 sampleCount) | |||
{ | |||
QString toolTip = formatSymbolBinaryString(row->symbol.symbol, row->symbol.binary) + QLatin1String("\n") + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tr() template
src/models/treemodel.cpp
Outdated
case Binary: | ||
return tr("The name of the executable the symbol resides in. May be empty when debug information is missing."); | ||
case InclusiveCost: | ||
return tr("The number of CPU cycles used by this symbol both directly and indirectly. The inclusive cost includes the costs of all functions called by this symbol plus it's self cost."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
samples
src/models/treemodel.cpp
Outdated
case InclusiveCost: | ||
return tr("The number of CPU cycles used by this symbol both directly and indirectly. The inclusive cost includes the costs of all functions called by this symbol plus it's self cost."); | ||
case SelfCost: | ||
return tr("The number of CPU cycles directly used by this symbol while inside the function."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
samples
6cdaea7
to
ed0cea5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some little nitpicks, otherwise lgtm
src/models/callercalleemodel.h
Outdated
case Binary: | ||
return QObject::tr("The name of the executable the symbol resides in. May be empty when debug information is missing."); | ||
case Cost: | ||
return QObject::tr("The number of CPU samples used by this symbol."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the same string as above/below, i.e. no CPU, and "attributed to"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also mention that this is inclusive cost here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this sound good: "The number of samples attributed to this symbol, both directly and indirectly. This is the symbols inclusive cost."?
src/models/treemodel.cpp
Outdated
case Binary: | ||
return tr("The name of the executable the symbol resides in. May be empty when debug information is missing."); | ||
case Cost: | ||
return tr("The number of CPU samples used by this symbol."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito, no CPU, use "attributed to"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also mention that this is inclusive cost
src/models/callercalleemodel.h
Outdated
case Location: | ||
return QObject::tr("The source file name and line number where the cost was measured. May be empty when debug information is missing."); | ||
case Cost: | ||
return QObject::tr("The number of samples attributed to this code location."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this "...directly attributed to"
ping? |
ed0cea5
to
0de9bdf
Compare
} else if (role == Qt::ToolTipRole) { | ||
switch (column) { | ||
case Symbol: | ||
return tr("The symbol's function name. May be empty when debug information is missing."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are the native speaker, but isn't it "The symbols function name", i.e. without the apostroph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The symbol's function name." is correct. The apostrophe is used to show possession. i.e. "This is the function name of the symbol." is equal to "The symbol's function name."
{ | ||
switch (column) { | ||
case Symbol: | ||
return tr("The symbol's function name. May be empty when debug information is missing."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here again: apostrophe or not?
{ | ||
switch (column) { | ||
case Symbol: | ||
return tr("The symbol's function name. May be empty when debug information is missing."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apostrophe or not?
src/models/treemodel.cpp
Outdated
case Binary: | ||
return tr("The name of the executable the symbol resides in. May be empty when debug information is missing."); | ||
case Cost: | ||
return tr("The symbols inclusive cost, i.e. the number of samples attributed to this symbol, both directly and indirectly."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note how there's no apostrophe here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be "The symbol's inclusive cost"
Tooltips include one for each column header and one for each row of data. Fixes: KDAB#29
0de9bdf
to
d8b9a36
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
Tooltips include one for each column header and one for each row of
data.
Fixes: #29