fix CLineEdit read-only button

PIValueTreeEdit support PIValueTree::Attribute::toolTip
This commit is contained in:
2023-09-13 10:33:52 +03:00
parent c23c8703a4
commit 1a2f5ceefc
5 changed files with 41 additions and 13 deletions

View File

@@ -88,6 +88,7 @@ bool PIValueTreeEditParameters::showFor(PIValueTree & vt) {
checkLabel->setChecked(vt.attribute(Attribute::isLabel, false).toBool());
checkLabel->blockSignals(false);
lineComment->setText(PI2QString(vt.comment()));
lineToolTip->setText(PI2QString(vt.attribute(Attribute::toolTip).toString()));
createAttributes(ve_attr, layoutAttributes, vt.attributes());
if (exec() != QDialog::Accepted) return false;
@@ -109,8 +110,13 @@ void PIValueTreeEditParameters::createAttributes(QList<PIVariantEdit *> & list,
QFormLayout * lay,
const PIVariantMap & attr,
bool inv_filter) {
static PIStringList hidden(
{"type", Attribute::hidden, Attribute::readOnly, Attribute::isLabel, Attribute::arrayType, Attribute::expression});
static PIStringList hidden({"type",
Attribute::hidden,
Attribute::readOnly,
Attribute::toolTip,
Attribute::isLabel,
Attribute::arrayType,
Attribute::expression});
static PIStringList filter({Attribute::arrayMinCount, Attribute::arrayMaxCount, Attribute::arrayReorder, Attribute::arrayResize});
list.clear();
while (lay->rowCount() > 0)
@@ -163,6 +169,7 @@ void PIValueTreeEditParameters::applyAttributes(PIValueTree & vt) {
vt.setAttribute(Attribute::hidden, checkHidden->isChecked());
vt.setAttribute(Attribute::readOnly, checkReadOnly->isChecked());
vt.setAttribute(Attribute::isLabel, checkLabel->isChecked());
vt.setAttribute(Attribute::toolTip, Q2PIString(lineToolTip->text()));
}