folio report can only be linked to inverted folio report

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2694 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-01-01 19:21:10 +00:00
parent c0f1aa735b
commit c795bf72fc
9 changed files with 29 additions and 17 deletions

View File

@@ -20,10 +20,12 @@
#include "diagramposition.h"
#include "qetproject.h"
ReportElement::ReportElement(const ElementsLocation &location, QGraphicsItem *qgi, Diagram *s, int *state) :
ReportElement::ReportElement(const ElementsLocation &location, QString link_type,QGraphicsItem *qgi, Diagram *s, int *state) :
CustomElement(location, qgi, s, state)
{
texts().at(0)->setNoEditable();
link_type == "next_report"? link_type_=NextReport : link_type_=PreviousReport;
link_type == "next_report"? inverse_report=PreviousReport : inverse_report=NextReport;
}
ReportElement::~ReportElement() {
@@ -43,8 +45,8 @@ void ReportElement::linkToElement(Element * elmt) {
if (connected_elements.first() == elmt) i = false;
}
//ensure elmt is a report
if (elmt->linkType() == Report && i) {
//ensure elmt is a inverse report of this element
if ((elmt->linkType() == inverse_report) && i) {
unlinkAllElements();
connected_elements << elmt;
connect(elmt, SIGNAL(positionChange(QPointF)), this, SLOT(updateLabel()));
@@ -81,7 +83,7 @@ void ReportElement::unlinkAllElements(){
* @return the kind of link type
*/
int ReportElement::linkType() const {
return Report;
return link_type_;
}
/**