Commit 524afb00 authored by Daniel Teske's avatar Daniel Teske

MiniProjectTargetSelector: Take fullName width into account

Change-Id: I37a967f955dd1b5fa1cbf83c9ea518b95cda4be9
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent ba1d5f2c
......@@ -275,7 +275,7 @@ void ProjectListWidget::addProject(Project *project)
}
QFontMetrics fn(font());
int width = fn.width(project->displayName()) + padding();
int width = fn.width(displayName) + padding();
if (width > optimalWidth())
setOptimalWidth(width);
......@@ -309,10 +309,8 @@ void ProjectListWidget::removeProject(Project *project)
// recheck optimal width
int width = 0;
for (int i = 0; i < count(); ++i) {
Project *p = item(i)->data(Qt::UserRole).value<Project *>();
width = qMax(fn.width(p->displayName()) + padding(), width);
}
for (int i = 0; i < count(); ++i)
width = qMax(fn.width(item(i)->text()) + padding(), width);
setOptimalWidth(width);
m_ignoreIndexChange = false;
......@@ -355,10 +353,8 @@ void ProjectListWidget::projectDisplayNameChanged(Project *project)
// recheck optimal width
QFontMetrics fn(font());
int width = 0;
for (int i = 0; i < count(); ++i) {
Project *p = item(i)->data(Qt::UserRole).value<Project *>();
width = qMax(fn.width(p->displayName()) + padding(), width);
}
for (int i = 0; i < count(); ++i)
width = qMax(fn.width(item(i)->text()) + padding(), width);
setOptimalWidth(width);
m_ignoreIndexChange = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment