mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Bug fix : some element informations can't be set
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
#include "diagramcontext.h"
|
#include "diagramcontext.h"
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include "qet.h"
|
#include "qet.h"
|
||||||
#include <algorithm>
|
#include <QDebug>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DiagramContext::add
|
* @brief DiagramContext::add
|
||||||
@@ -213,7 +213,7 @@ void DiagramContext::fromSettings(QSettings &settings, const QString &array_name
|
|||||||
@see keyIsAcceptable()
|
@see keyIsAcceptable()
|
||||||
*/
|
*/
|
||||||
QString DiagramContext::validKeyRegExp() {
|
QString DiagramContext::validKeyRegExp() {
|
||||||
return("^[a-z0-9-]+$");
|
return("^[a-z0-9-_]+$");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -231,3 +231,14 @@ bool DiagramContext::keyIsAcceptable(const QString &key) const {
|
|||||||
QRegExp re(DiagramContext::validKeyRegExp());
|
QRegExp re(DiagramContext::validKeyRegExp());
|
||||||
return(re.exactMatch(key));
|
return(re.exactMatch(key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDebug operator <<(QDebug debug, const DiagramContext &context)
|
||||||
|
{
|
||||||
|
debug << "DiagramContext";
|
||||||
|
for (auto key : context.keys()) {
|
||||||
|
debug.nospace() << key << " : " << context.value(key) << "\n";
|
||||||
|
}
|
||||||
|
debug << " end DiagramContext";
|
||||||
|
|
||||||
|
return debug;
|
||||||
|
}
|
||||||
|
|||||||
@@ -90,4 +90,6 @@ class DiagramContext
|
|||||||
QHash<QString, QVariant> m_content;
|
QHash<QString, QVariant> m_content;
|
||||||
QHash<QString, bool> m_content_show;
|
QHash<QString, bool> m_content_show;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QDebug operator <<(QDebug debug, const DiagramContext &context);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user