Hint for "anonymous" login

* utility function for hyperlink
* info about login
This commit is contained in:
Klaus Basan
2019-02-13 00:27:20 +01:00
committed by Mat Sutcliffe
parent 731d39d783
commit dc84c9b334
5 changed files with 27 additions and 13 deletions

View File

@@ -39,4 +39,11 @@ namespace BlackMisc
return u"<p style='white-space:pre'>" % text % u"</p>";
}
QString asHyperlink(const QString &url, const QString &text)
{
return text.isEmpty() ?
u"<a href=\"" % url % u"\">" % url % u"</a>" :
u"<a href=\"" % url % u"\">" % text % u"</a>";
}
} // ns

View File

@@ -12,8 +12,8 @@
#ifndef BLACKMISC_HTMLUTILS_H
#define BLACKMISC_HTMLUTILS_H
#include "blackmisc/blackmiscexport.h"
#include "blackmisc/propertyindexlist.h"
#include "blackmisc/blackmiscexport.h"
#include <QStringBuilder>
//! Free functions in BlackMisc
@@ -42,6 +42,9 @@ namespace BlackMisc
//! As white space preformatted
BLACKMISC_EXPORT QString unwrappedTooltip(const QString &text);
//! As hyperlink
BLACKMISC_EXPORT QString asHyperlink(const QString &url, const QString &text = "");
} // ns
#endif // guard