Commit 0df73628 authored by Juraj Oravec's avatar Juraj Oravec

filetemplates: load and show tooltip for custom options

Signed-off-by: Juraj Oravec's avatarJuraj Oravec <sgd.orava@gmail.com>
parent fe516fa3
......@@ -63,9 +63,17 @@ ConfigOption SourceFileTemplatePrivate::readEntry(const QDomElement& element,
if (tag == QLatin1String("label")) {
entry.label = e.text();
} else if (tag == QLatin1String("tooltip")) {
entry.label = e.text();
if (entry.label.isEmpty()) {
entry.label = e.text();
}
entry.context = e.text();
} else if (tag == QLatin1String("whatsthis")) {
entry.label = e.text();
if (entry.label.isEmpty()) {
entry.label = e.text();
}
if (entry.context.isEmpty()) {
entry.context = e.text();
}
} else if (tag == QLatin1String("min")) {
entry.minValue = e.text();
} else if (tag == QLatin1String("max")) {
......
......@@ -136,6 +136,10 @@ void TemplateOptionsPage::load(const SourceFileTemplate& fileTemplate, TemplateR
{
const QString entryLabelText = i18n("%1:", entry.label);
QLabel* label = new QLabel(entryLabelText, box);
if (!entry.context.isEmpty()) {
label->setToolTip(entry.context);
control->setToolTip(entry.context);
}
formLayout->addRow(label, control);
d->controls.insert(entry.name, control);
if (d->firstEditWidget == nullptr) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment