Aufgrund einer Störung des s3 Storage, könnten in nächster Zeit folgende GitLab Funktionen nicht zur Verfügung stehen: LFS, Container Registry, Job Artifacs, Uploads (Wiki, Bilder, Projekt-Exporte). Wir bitten um Verständnis. Es wird mit Hochdruck an der Behebung des Problems gearbeitet. Weitere Informationen zur Störung des Object Storage finden Sie hier: https://maintenance.itc.rwth-aachen.de/ticket/status/messages/59-object-storage-pilot

Commit 841a6a91 authored by Leander Schulten's avatar Leander Schulten
Browse files

ProgramBlockEditor:

 -Set programBlock to nullptr if the programBlock gets deleted
 -update the peropertyBase property of the qml items if the peropertyBase gets replaced
parent 950c66b0
......@@ -709,4 +709,13 @@ void ProgramBlockEditor::mouseReleaseEvent(QMouseEvent *event){
}
void ProgramBlockEditor::propertyBaseChanged(Modules::PropertyBase * oldPB, Modules::PropertyBase * newPB){
for(const auto & child : childItems()){
auto prop = child->property("propertyBase");
if(prop.isValid()){
if(prop.value<Modules::PropertyBase*>() == oldPB){
child->setProperty("propertyBase",QVariant::fromValue(newPB));
}
}
}
}
......@@ -153,6 +153,7 @@ class ProgramBlockEditor : public QQuickItem
double scale = 2;
int spaceBetweenLayers = 70;
bool run;
QMetaObject::Connection connection;
private:
void recreateView();
/**
......@@ -198,13 +199,23 @@ public:
Q_INVOKABLE void removeIncomingConnections();
static QQmlEngine * engine;
ProgramBlockEditor();
~ProgramBlockEditor()override{QObject::disconnect(connection);}
void setProgramBlock( Modules::ProgramBlock* _programBlock){
if(_programBlock != programBlock){
qDebug () << "Program Block changed";
programBlock = _programBlock;
recreateView();
setShowProperties(false);
emit programBlockChanged();
if(programBlock){
QObject::disconnect(programBlock,&Modules::ProgramBlock::propertyBaseChanged,this,&ProgramBlockEditor::propertyBaseChanged);
}
programBlock = _programBlock;
recreateView();
setShowProperties(false);
emit programBlockChanged();
QObject::disconnect(connection);
if(programBlock){
connection = QObject::connect(programBlock,&QObject::destroyed,[this](){
setProgramBlock(nullptr);
});
QObject::connect(programBlock,&Modules::ProgramBlock::propertyBaseChanged,this,&ProgramBlockEditor::propertyBaseChanged);
}
}
}
Modules::ProgramBlock* getProgramBlock() const {
......@@ -236,6 +247,8 @@ protected:
virtual void mouseReleaseEvent(QMouseEvent *event)override;
virtual void mouseMoveEvent(QMouseEvent *event)override;
virtual void mousePressEvent(QMouseEvent *event)override;
protected slots:
void propertyBaseChanged(Modules::PropertyBase * oldPB, Modules::PropertyBase * newPB);
signals:
void programBlockChanged();
void showPropertiesChanged();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment