use table in snippets popup
This commit is contained in:
parent
7a3cfa6c77
commit
4681ce672a
1 changed files with 8 additions and 4 deletions
|
@ -71,25 +71,29 @@ void SnippetsW::init()
|
||||||
"<html><head>"
|
"<html><head>"
|
||||||
"<meta http-equiv=\"content-type\" "
|
"<meta http-equiv=\"content-type\" "
|
||||||
"content=\"text/html; charset=utf-8\"></head>"
|
"content=\"text/html; charset=utf-8\"></head>"
|
||||||
"<body style='overflow-x: scroll; white-space: nowrap'>");
|
"<body style='overflow-x: scroll; white-space: nowrap'>"
|
||||||
|
"<table>"
|
||||||
|
);
|
||||||
|
|
||||||
g_hiliter.set_inputhtml(false);
|
g_hiliter.set_inputhtml(false);
|
||||||
|
|
||||||
for (vector<pair<int, string> >::const_iterator it = vpabs.begin();
|
for (vector<pair<int, string> >::const_iterator it = vpabs.begin();
|
||||||
it != vpabs.end(); it++) {
|
it != vpabs.end(); it++) {
|
||||||
|
html += "<tr><td>";
|
||||||
if (it->first > 0) {
|
if (it->first > 0) {
|
||||||
char buf[100];
|
char buf[100];
|
||||||
sprintf(buf, "P. %d", it->first);
|
sprintf(buf, "P. %d", it->first);
|
||||||
html += "<a href=\"";
|
html += "<a href=\"";
|
||||||
html += buf;
|
html += buf;
|
||||||
html += "\">";
|
html += "\">";
|
||||||
html += buf;
|
html += buf;
|
||||||
html += "</a> ";
|
html += "</a>";
|
||||||
}
|
}
|
||||||
|
html += "</td><td>";
|
||||||
list<string> lr;
|
list<string> lr;
|
||||||
g_hiliter.plaintorich(it->second, lr, hdata);
|
g_hiliter.plaintorich(it->second, lr, hdata);
|
||||||
html.append(QString::fromUtf8(lr.front().c_str()));
|
html.append(QString::fromUtf8(lr.front().c_str()));
|
||||||
html.append("<br>\n");
|
html.append("</td></tr>\n");
|
||||||
}
|
}
|
||||||
html.append("</body></html>");
|
html.append("</body></html>");
|
||||||
webView->setHtml(html);
|
webView->setHtml(html);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue