Link single element widget, set live edit enable.

In properties dock widget, no need to click on apply button, change are apply immediately.


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3992 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-05-27 07:22:50 +00:00
parent c3ab81e9c3
commit 2242ebd16a
12 changed files with 199 additions and 95 deletions

View File

@@ -50,9 +50,11 @@ SlaveElement::~SlaveElement() {
* For this class element must be a master
* @param elmt
*/
void SlaveElement::linkToElement(Element *elmt) {
// check if element is master and if isn't already linked
if (elmt->linkType() == Master && !connected_elements.contains(elmt)) {
void SlaveElement::linkToElement(Element *elmt)
{
// check if element is master and if isn't already linked
if (elmt->linkType() == Master && !connected_elements.contains(elmt))
{
if(!isFree()) unlinkAllElements();
connected_elements << elmt;
@@ -64,6 +66,7 @@ void SlaveElement::linkToElement(Element *elmt) {
updateLabel();
elmt -> linkToElement(this);
emit linkedElementChanged();
}
}
@@ -71,12 +74,14 @@ void SlaveElement::linkToElement(Element *elmt) {
* @brief SlaveElement::unlinkAllElements
* Unlink all of the element in the QList connected_elements
*/
void SlaveElement::unlinkAllElements() {
// if this element is free no need to do something
if (!isFree()) {
foreach(Element *elmt, connected_elements) {
void SlaveElement::unlinkAllElements()
{
// if this element is free no need to do something
if (!isFree())
{
foreach(Element *elmt, connected_elements)
unlinkElement(elmt);
}
emit linkedElementChanged();
}
}
@@ -103,6 +108,7 @@ void SlaveElement::unlinkElement(Element *elmt)
updateLabel();
elmt -> unlinkElement (this) ;
elmt -> setHighlighted (false);
emit linkedElementChanged();
}
}