33 setTextFormat(Qt::RichText);
36 connect(
this, SIGNAL(linkActivated(
const QString&)),
this, SLOT(labelActionLink(
const QString&)));
45 if (i >= 0 && i <
pItems.size())
52 if (i >= 0 && i <
pItems.size())
61 for (k = 0; k <
pItems.size(); ++k)
69 for (k = 0; k <
pItems.size(); ++k)
77 i = simple_wrapped_item_index(i);
78 if (i < 0 || i >=
pItems.size())
87 i = simple_wrapped_item_index(i);
97 for (k = 0; k < slist.
size(); ++k) {
99 if (k < datalist.size())
103 if (k < datalist.size()) {
104 qWarning()<<
KLF_FUNC_NAME<<
": Ignoring superfluous elements in data QVariantList";
113 t =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" 114 "<html><head><meta name=\"qrichtext\" content=\"1\" />\n" 115 "<style type=\"text/css\">\n" 116 ".item { white-space: nowrap }\n" 117 "a.itemtext { color: black; text-decoration: underline; }\n" 118 "a.actionlink { color: blue; text-decoration: none; font-weight: bold; }\n" 119 "</style></head><body>\n" 122 for (k = 0; k <
pItems.size(); ++k) {
123 t +=
"<span class=\"item\"><a class=\"itemtext\" href=\"klfenumlistwidgetaction:/itemClick?i=" 125 t +=
"<a class=\"actionlink\" href=\"klfenumlistwidgetaction:/removeAt?i="+
QString::number(k)+
"\">[-]</a>" 126 +
" </span> ";
128 t +=
"</p>" "</body></html>";
133 void KLFEnumListWidget::labelActionLink(
const QString& link)
137 klfDbg(
"link clicked="<<link<<
" scheme="<<url.
scheme()<<
", path="<<url.
path()) ;
139 if (url.
scheme() ==
"klfenumlistwidgetaction") {
141 if (url.
path() ==
"/removeAt") {
146 if (url.
path() ==
"/itemClick") {
154 klfDbg(
"don't know what to do with link: "<<link<<
" ...") ;
QString queryItemValue(const QString &key, QUrl::ComponentFormattingOptions encoding) const
#define klfDbg(streamableItems)
print debug stream items
QString number(int n, int base)
int toInt(bool *ok, int base) const
QString path(ComponentFormattingOptions options) const
QByteArray toLatin1() const
QUrl fromEncoded(const QByteArray &input, ParsingMode parsingMode)