GUI: Add tooltips for error items.

This commit is contained in:
Kimmo Varis 2010-11-19 22:54:40 +02:00
parent 66c2825b23
commit a0a1ad806a
2 changed files with 10 additions and 9 deletions

View File

@ -74,9 +74,10 @@ void ResultsTree::Initialize(QSettings *settings, ApplicationList *list)
}
QStandardItem *ResultsTree::CreateItem(const QString &name)
QStandardItem *ResultsTree::CreateNormalItem(const QString &name)
{
QStandardItem *item = new QStandardItem(name);
item->setData(name, Qt::ToolTipRole);
item->setEditable(false);
return item;
}
@ -174,13 +175,13 @@ QStandardItem *ResultsTree::AddBacktraceFiles(QStandardItem *parent,
QList<QStandardItem*> list;
// Ensure shown path is with native separators
const QString file = QDir::toNativeSeparators(item.file);
list << CreateItem(file);
list << CreateItem(tr(item.severity.toLatin1()));
list << CreateItem(QString("%1").arg(item.line));
list << CreateNormalItem(file);
list << CreateNormalItem(tr(item.severity.toLatin1()));
list << CreateNormalItem(QString("%1").arg(item.line));
//TODO message has parameter names so we'll need changes to the core
//cppcheck so we can get proper translations
list << CreateItem(tr(item.summary.toLatin1()));
list << CreateItem(tr(item.message.toLatin1()));
list << CreateNormalItem(tr(item.summary.toLatin1()));
list << CreateNormalItem(tr(item.message.toLatin1()));
// Check for duplicate rows and don't add them if found
for (int i = 0; i < parent->rowCount(); i++)
@ -376,7 +377,7 @@ QStandardItem *ResultsTree::EnsureFileItem(const QString &fullpath, bool hide)
// Ensure shown path is with native separators
name = QDir::toNativeSeparators(name);
item = CreateItem(name);
item = CreateNormalItem(name);
item->setIcon(QIcon(":images/text-x-generic.png"));
//Add user data to that item

View File

@ -270,12 +270,12 @@ protected:
QString AskFileDir(const QString &file);
/**
* @brief Create a new QStandardItem
* @brief Create new normal item.
*
* @param name name for the item
* @return new QStandardItem
*/
QStandardItem *CreateItem(const QString &name);
QStandardItem *CreateNormalItem(const QString &name);
/**
* @brief Finds a file item