mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
folio report can be linked (basic)
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2680 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -81,6 +81,7 @@ class Element : public QetGraphicsItem {
|
||||
/// @return the maximum number of terminals for this element
|
||||
virtual int maxTerminalsCount() const = 0;
|
||||
bool isFree () const;
|
||||
virtual void linkToElement(Element *) {}
|
||||
/**
|
||||
Draw this element
|
||||
*/
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include "reportelement.h"
|
||||
#include "elementtextitem.h"
|
||||
#include "diagramposition.h"
|
||||
|
||||
ReportElement::ReportElement(const ElementsLocation &location, QGraphicsItem *qgi, Diagram *s, int *state) :
|
||||
CustomElement(location, qgi, s, state)
|
||||
@@ -24,6 +25,11 @@ ReportElement::ReportElement(const ElementsLocation &location, QGraphicsItem *qg
|
||||
texts().at(0)->setNoEditable();
|
||||
}
|
||||
|
||||
void ReportElement::linkToElement(Element * elmt) {
|
||||
texts().at(0)->setPlainText(QString ("%1-%2").arg(elmt->diagram()->folioIndex() + 1)
|
||||
.arg(elmt->diagram() -> convertPosition(elmt -> scenePos()).toString()));
|
||||
}
|
||||
|
||||
int ReportElement::linkType() const {
|
||||
return REPORT;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ class ReportElement : public CustomElement {
|
||||
|
||||
public :
|
||||
explicit ReportElement(const ElementsLocation &, QGraphicsItem * = 0, Diagram * = 0, int * = 0);
|
||||
virtual void linkToElement(Element *);
|
||||
|
||||
virtual int linkType() const;
|
||||
|
||||
|
||||
@@ -66,5 +66,9 @@ void FolioReportProperties::BuildRadioList() {
|
||||
* Apply the new properties for this folio report
|
||||
*/
|
||||
void FolioReportProperties::Apply() {
|
||||
if (element_to_link) {
|
||||
element_to_link->linkToElement(element_);
|
||||
element_->linkToElement(element_to_link);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user