Display Location Field in Diagram and assign Folio Variables to Element's Information Fields

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4546 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
dfochi
2016-06-07 12:55:05 +00:00
parent b4b63446c7
commit 46464a67a6
13 changed files with 120 additions and 39 deletions

View File

@@ -28,7 +28,8 @@
*/
SimpleElement::SimpleElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
CustomElement(location, qgi, state),
m_comment_item (nullptr)
m_comment_item (nullptr),
m_location_item (nullptr)
{
link_type_ = Simple;
connect(this, SIGNAL(elementInfoChange(DiagramContext, DiagramContext)), this, SLOT(updateLabel(DiagramContext, DiagramContext)));
@@ -88,14 +89,16 @@ void SimpleElement::updateLabel(DiagramContext old_info, DiagramContext new_info
new_info["label"].toString().isEmpty() ? eti->setVisible(true) : eti -> setVisible(new_info.keyMustShow("label"));
}
//Comment of element
//Comment and Location of element
QString comment = new_info["comment"].toString();
bool must_show = new_info.keyMustShow("comment");
QString location = new_info["location"].toString();
bool must_show_location = new_info.keyMustShow("location");
if (!(comment.isEmpty() || !must_show) && !m_comment_item) {
if ((!(comment.isEmpty() || !must_show) && !m_comment_item)||(!(location.isEmpty() || !must_show_location) && !m_comment_item)) {
m_comment_item = new CommentItem(this);
}
else if ((comment.isEmpty() || !must_show) && m_comment_item) {
else if (((comment.isEmpty() || !must_show) && m_comment_item) && ((location.isEmpty() || !must_show_location) && m_comment_item)) {
delete m_comment_item;
m_comment_item = nullptr;
}