6#include <QtCore/qlist.h>
7#include <QtCore/qstring.h>
8#include <QtCore/qvariant.h>
9#include <QtCore/qmap.h>
11#include <QtGui/qevent.h>
12#include <QtGui/qpainter.h>
14#include <QtWidgets/qwidget.h>
29 static inline void valueToVariantMap(T value, T defaultValue,
const QString &key, QVariantMap &v,
bool forceKey) {
30 if (forceKey || value != defaultValue)
31 v.insert(key, QVariant(value));
37 const auto it = v.constFind(key);
38 const bool found = it != v.constEnd();
40 value = qvariant_cast<T>(it.value());
67 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)
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.