mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-04-26 23:29:59 +02:00
Xref item: item position can be set under the texte field "label" of master element.
Double clic in xref open the properties dialog of master. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3183 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -910,18 +910,28 @@ void CustomElement::setPainterStyle(QDomElement &e, QPainter &qp) {
|
||||
/**
|
||||
* @brief CustomElement::setTaggedText
|
||||
* Set text @newstr to the text tagged with @tagg.
|
||||
* If tagg is found return the text item, else return 0.
|
||||
* If tagg is found return the text item, else return NULL.
|
||||
* @param tagg required tagg
|
||||
* @param newstr new label
|
||||
* @param noeditable set editable or not (by default, set editable)
|
||||
*/
|
||||
ElementTextItem* CustomElement::setTaggedText(const QString &tagg, const QString &newstr, const bool noeditable) {
|
||||
foreach (ElementTextItem *eti, list_texts_) {
|
||||
if (eti -> tagg() == tagg) {
|
||||
eti -> setPlainText(newstr);
|
||||
eti -> setNoEditable(noeditable);
|
||||
return eti;
|
||||
}
|
||||
ElementTextItem *eti = taggedText(tagg);
|
||||
if (eti) {
|
||||
eti -> setPlainText(newstr);
|
||||
eti -> setNoEditable(noeditable);
|
||||
}
|
||||
return 0;
|
||||
return eti;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CustomElement::taggedText
|
||||
* return the text field tagged with @tagg or NULL if text field isn't found
|
||||
* @param tagg
|
||||
*/
|
||||
ElementTextItem* CustomElement::taggedText(const QString &tagg) const {
|
||||
foreach (ElementTextItem *eti, list_texts_) {
|
||||
if (eti -> tagg() == tagg) return eti;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user