mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-04-12 02:10:04 +02:00
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:
@@ -120,6 +120,7 @@ class Element : public QetGraphicsItem {
|
||||
kind link_type_;
|
||||
|
||||
signals:
|
||||
void linkedElementChanged(); //This signal is emtied when the linked elements with this element change
|
||||
void elementInfoChange(DiagramContext old_info, DiagramContext new_info);
|
||||
|
||||
//METHODS related to information
|
||||
|
||||
@@ -49,9 +49,11 @@ MasterElement::~MasterElement() {
|
||||
* For this class element must be a slave
|
||||
* @param elmt
|
||||
*/
|
||||
void MasterElement::linkToElement(Element *elmt) {
|
||||
// check if element is slave and if isn't already linked
|
||||
if (elmt->linkType() == Slave && !connected_elements.contains(elmt)) {
|
||||
void MasterElement::linkToElement(Element *elmt)
|
||||
{
|
||||
// check if element is slave and if isn't already linked
|
||||
if (elmt->linkType() == Slave && !connected_elements.contains(elmt))
|
||||
{
|
||||
connected_elements << elmt;
|
||||
elmt->linkToElement(this);
|
||||
|
||||
@@ -60,6 +62,7 @@ void MasterElement::linkToElement(Element *elmt) {
|
||||
connect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));
|
||||
connect(elmt, SIGNAL(yChanged()), cri_, SLOT(updateLabel()));
|
||||
cri_ -> updateLabel();
|
||||
emit linkedElementChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,12 +70,14 @@ void MasterElement::linkToElement(Element *elmt) {
|
||||
* @brief MasterElement::unlinkAllElements
|
||||
* Unlink all of the element in the QList connected_elements
|
||||
*/
|
||||
void MasterElement::unlinkAllElements() {
|
||||
// if this element is free no need to do something
|
||||
if (!isFree()) {
|
||||
foreach(Element *elmt, connected_elements) {
|
||||
void MasterElement::unlinkAllElements()
|
||||
{
|
||||
// if this element is free no need to do something
|
||||
if (!isFree())
|
||||
{
|
||||
foreach(Element *elmt, connected_elements)
|
||||
unlinkElement(elmt);
|
||||
}
|
||||
emit linkedElementChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +101,7 @@ void MasterElement::unlinkElement(Element *elmt)
|
||||
|
||||
cri_ -> updateLabel();
|
||||
aboutDeleteXref();
|
||||
emit linkedElementChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ void ReportElement::linkToElement(Element * elmt)
|
||||
updateLabel();
|
||||
|
||||
elmt -> linkToElement(this);
|
||||
emit linkedElementChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +91,8 @@ void ReportElement::linkToElement(Element * elmt)
|
||||
*/
|
||||
void ReportElement::unlinkAllElements()
|
||||
{
|
||||
if (!isFree()){
|
||||
if (!isFree())
|
||||
{
|
||||
QList <Element *> tmp_elmt = connected_elements;
|
||||
|
||||
foreach(Element *elmt, connected_elements)
|
||||
@@ -107,6 +109,7 @@ void ReportElement::unlinkAllElements()
|
||||
elmt -> setHighlighted(false);
|
||||
elmt -> unlinkAllElements();
|
||||
}
|
||||
emit linkedElementChanged();
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user