diff --git a/plugins/dockers/layerdocker/NodeToolTip.cpp b/plugins/dockers/layerdocker/NodeToolTip.cpp index 9a3e3c58ad..fae4f200c8 100644 --- a/plugins/dockers/layerdocker/NodeToolTip.cpp +++ b/plugins/dockers/layerdocker/NodeToolTip.cpp @@ -1,75 +1,75 @@ /* Copyright (c) 2006 Gábor Lehel This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "NodeToolTip.h" #include "kis_node_model.h" #include #include #include #include #include #include NodeToolTip::NodeToolTip() { } NodeToolTip::~NodeToolTip() { } QTextDocument *NodeToolTip::createDocument(const QModelIndex &index) { QTextDocument *doc = new QTextDocument(this); QImage thumb = index.data(int(KisNodeModel::BeginThumbnailRole) + 250).value(); doc->addResource(QTextDocument::ImageResource, QUrl("data:thumbnail"), thumb); QString name = index.data(Qt::DisplayRole).toString(); KisBaseNode::PropertyList properties = index.data(KisNodeModel::PropertiesRole).value(); QString rows; - const QString row = QString("%1:%2"); + const QString row = QString("%1:%2"); QString value; for(int i = 0, n = properties.count(); i < n; ++i) { if (properties[i].isMutable) value = properties[i].state.toBool() ? i18n("Yes") : i18n("No"); else value = properties[i].state.toString(); rows.append(row.arg(properties[i].name).arg(value)); } rows = QString("%1
").arg(rows); const QString image = QString("
"); const QString body = QString("

%1

").arg(name) + QString("

%1%2

").arg(image).arg(rows); const QString html = QString("%1").arg(body); doc->setHtml(html); const int margin = 16; doc->setTextWidth(qMin(doc->size().width() + 2 * margin, qreal(500.0))); doc->setDocumentMargin(margin); doc->setUseDesignMetrics(true); return doc; }