mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
Function QStringList -> HTML table
This commit is contained in:
@@ -12,10 +12,10 @@
|
||||
#ifndef BLACKMISC_HTMLUTILS_H
|
||||
#define BLACKMISC_HTMLUTILS_H
|
||||
|
||||
#include <QStringBuilder>
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
#include "blackmisc/propertyindexlist.h"
|
||||
|
||||
|
||||
//! Free functions in BlackMisc
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -29,12 +29,16 @@ namespace BlackMisc
|
||||
QString rowHtml;
|
||||
for (const CPropertyIndex &index : indexes)
|
||||
{
|
||||
rowHtml += "<td>" + obj.propertyByIndex(index).toQString(true) + "</td>";
|
||||
rowHtml += QStringLiteral("<td>") % obj.propertyByIndex(index).toQString(true) % QStringLiteral("</td>");
|
||||
}
|
||||
html += "<tr>" + rowHtml + "</tr>";
|
||||
html += QStringLiteral("<tr>") % rowHtml % QStringLiteral("</tr>");
|
||||
}
|
||||
return "<table>" + html + "</table>";
|
||||
return QStringLiteral("<table>") % html % QStringLiteral("</table>");
|
||||
}
|
||||
|
||||
//! Values as HTML table
|
||||
BLACKMISC_EXPORT QString toHtmTable(const QStringList &values, int columns);
|
||||
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user