From 2391d242ed9f2e0b7dac9f99ff441a482d4c4f71 Mon Sep 17 00:00:00 2001 From: Mat Sutcliffe Date: Fri, 28 Aug 2020 18:05:34 +0100 Subject: [PATCH] Issue #77 Break dependency of htmlutils on propertyindexlist --- src/blackmisc/htmlutils.cpp | 6 +----- src/blackmisc/htmlutils.h | 21 --------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/src/blackmisc/htmlutils.cpp b/src/blackmisc/htmlutils.cpp index b86f7223c..d7f5577f1 100644 --- a/src/blackmisc/htmlutils.cpp +++ b/src/blackmisc/htmlutils.cpp @@ -8,6 +8,7 @@ #include "blackmisc/htmlutils.h" #include +#include namespace BlackMisc { @@ -33,11 +34,6 @@ namespace BlackMisc return u"" % html % u"
"; } - QString unwrappedTooltip(const QString &text) - { - return u"

" % text % u"

"; - } - QString asHyperlink(const QString &url, const QString &text) { return text.isEmpty() ? diff --git a/src/blackmisc/htmlutils.h b/src/blackmisc/htmlutils.h index 257127b6d..fe82e73f2 100644 --- a/src/blackmisc/htmlutils.h +++ b/src/blackmisc/htmlutils.h @@ -11,36 +11,15 @@ #ifndef BLACKMISC_HTMLUTILS_H #define BLACKMISC_HTMLUTILS_H -#include "blackmisc/propertyindexlist.h" #include "blackmisc/blackmiscexport.h" #include //! Free functions in BlackMisc namespace BlackMisc { - //! Container to standard HTML table - template QString toHtmlTable(const CPropertyIndexList &indexes, const Container &container) - { - if (indexes.isEmpty() || container.isEmpty()) { return {}; } - QString html; - for (const Obj &obj : container) - { - QString rowHtml; - for (const CPropertyIndex &index : indexes) - { - rowHtml += u"" % obj.propertyByIndex(index).toQString(true) % u""; - } - html += u"" % rowHtml % u""; - } - return u"" % html % u"
"; - } - //! Values as HTML table BLACKMISC_EXPORT QString toHtmTable(const QStringList &values, int columns); - //! As white space preformatted - BLACKMISC_EXPORT QString unwrappedTooltip(const QString &text); - //! As hyperlink BLACKMISC_EXPORT QString asHyperlink(const QString &url, const QString &text = "");