mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Bug fix : some element informations can't be set
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
#include "diagramcontext.h"
|
||||
#include <QRegExp>
|
||||
#include "qet.h"
|
||||
#include <algorithm>
|
||||
#include <QDebug>
|
||||
|
||||
/**
|
||||
* @brief DiagramContext::add
|
||||
@@ -213,7 +213,7 @@ void DiagramContext::fromSettings(QSettings &settings, const QString &array_name
|
||||
@see keyIsAcceptable()
|
||||
*/
|
||||
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());
|
||||
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, bool> m_content_show;
|
||||
};
|
||||
|
||||
QDebug operator <<(QDebug debug, const DiagramContext &context);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user