Bug fix : some element informations can't be set

This commit is contained in:
Claveau Joshua
2020-05-15 10:26:05 +02:00
parent 4ee65320f3
commit e40ba32281
2 changed files with 15 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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