7#include <QtCore/qlist.h>
8#include <QtCore/qstring.h>
9#include <QtCore/qvariant.h>
10#include <QtCore/qmap.h>
12#include <QtGui/qevent.h>
13#include <QtGui/qpainter.h>
15#include <QtWidgets/qwidget.h>
30 static inline void valueToVariantMap(T value, T defaultValue,
const QString &key, QVariantMap &v,
bool forceKey) {
31 if (forceKey || value != defaultValue)
32 v.insert(key, QVariant(value));
38 const auto it = v.constFind(key);
39 const bool found = it != v.constEnd();
41 value = qvariant_cast<T>(it.value());
68 qWarning(
"Attempt to set invalid grid with a spacing of 0.");
static const bool defaultVisible
static const char * KEY_DELTAY
static const int DEFAULT_GRID
static const char * KEY_SNAPX
static void valueToVariantMap(T value, T defaultValue, const QString &key, QVariantMap &v, bool forceKey)
static const char * KEY_DELTAX
static QT_BEGIN_NAMESPACE const bool defaultSnap
static const char * KEY_SNAPY
static const char * KEY_VISIBLE
static bool valueFromVariantMap(const QVariantMap &v, const QString &key, T &value)
Auxiliary methods to store/retrieve settings.