mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-24 08:34:38 +03:00
followTo has been fixed
This commit is contained in:
parent
3807ac0c57
commit
658a6e7e09
@ -223,7 +223,10 @@ void TextItem::setContent(const QString &value)
|
||||
{
|
||||
if (m_strText.compare(value)!=0){
|
||||
QString oldValue = m_strText;
|
||||
m_strText=value;
|
||||
if (m_trimValue)
|
||||
m_strText=value.trimmed();
|
||||
else
|
||||
m_strText=value;
|
||||
|
||||
if (itemMode() == DesignMode){
|
||||
initTextSizes();
|
||||
@ -466,17 +469,29 @@ void TextItem::setFollowTo(const QString &followTo)
|
||||
QString oldValue = m_followTo;
|
||||
m_followTo = followTo;
|
||||
if (!isLoading()){
|
||||
TextItem* fi = scene()->findChild<TextItem*>(followTo);
|
||||
if (fi && initFollower(followTo)){
|
||||
notify("followTo",oldValue,followTo);
|
||||
} else {
|
||||
m_followTo = "";
|
||||
TextItem* fi = scene()->findChild<TextItem*>(oldValue);
|
||||
if (fi) fi->clearFollower();
|
||||
fi = scene()->findChild<TextItem*>(followTo);
|
||||
if (fi && fi != this){
|
||||
if (initFollower(followTo)){
|
||||
notify("followTo",oldValue,followTo);
|
||||
} else {
|
||||
m_followTo = "";
|
||||
QMessageBox::critical(
|
||||
0,
|
||||
tr("Error"),
|
||||
tr("TextItem \" %1 \" already has folower \" %2 \" ")
|
||||
.arg(fi->objectName())
|
||||
.arg(fi->follower()->objectName())
|
||||
);
|
||||
notify("followTo",followTo,"");
|
||||
}
|
||||
} else if (m_followTo != ""){
|
||||
QMessageBox::critical(
|
||||
0,
|
||||
tr("Error"),
|
||||
tr("TextItem \" %1 \" already has folower \" %2 \" ")
|
||||
.arg(fi->objectName())
|
||||
.arg(fi->follower()->objectName())
|
||||
tr("TextItem \" %1 \" not found !")
|
||||
.arg(m_followTo)
|
||||
);
|
||||
notify("followTo",followTo,"");
|
||||
}
|
||||
@ -491,6 +506,11 @@ void TextItem::setFollower(TextItem *follower)
|
||||
}
|
||||
}
|
||||
|
||||
void TextItem::clearFollower()
|
||||
{
|
||||
m_follower = 0;
|
||||
}
|
||||
|
||||
bool TextItem::hasFollower()
|
||||
{
|
||||
return m_follower != 0;
|
||||
|
@ -147,6 +147,7 @@ public:
|
||||
QString followTo() const;
|
||||
void setFollowTo(const QString &followTo);
|
||||
void setFollower(TextItem* follower);
|
||||
void clearFollower();
|
||||
bool hasFollower();
|
||||
TextItem* follower(){ return m_follower;}
|
||||
bool initFollower(QString follower);
|
||||
|
Loading…
Reference in New Issue
Block a user